Soundspin

Soundspin

This website comes with an unusual request. It is best experienced on a mobile device sitting in a chair that spins 360 degrees (that's two PI radians for you nerds). The phone or tablet must be held vertically (also called "portrait"). It will work on a desktop computer, or in a normal chair but mobile, spinning, and vertical is the best experience.
Soundspin is an instrument like a player piano or a crank music box that you can program yourself to play different songs or noises. As you spin in the chair you play the notes, so your rate of spin determines how fast or slow or even what direction the song plays.

Demo

Press the HB button to load "Happy Birthday" into the Soundspiner, and rotate clockwise to play. Press "reset" to clear when you are done.

Creating sounds

The top row of green buttons creates sounds of varying length. The sound will be created at the blue dot that is in the center of the screen. The higher up and down you look the higher or lower the frequency of the sound that's created. You can test the current sound at the location you are pointing by pressing the "test" button.

Deleing Notes

Place the center dot over a note until the note turns green. Press the delete button to get rid of that note.

Note/Hz

The "Note/Hz" button toggles between creating a sound that "snaps" to the frequency of a typical note vs playing any frequency. The note indicator at the top center of the screen will show if you are on HZ or notes mode. Notes mode is good for making traditional songs.

Saving and loading songs

Click the "•••" button in the upper left to open the save and load buttons.
To load a song, paste the song data into the white box and press the load song button.
Pressing the save button downloads a .txt file with the current song data. It also replaces the instuctional text with the song data which you can copy and paste into any text edtor, if that's easier.

This is the code for Happy Birthday.
102.2390, -087.0869, -194.8003, 0.2: 145.8869, -017.5191, -164.6723, 0.2: 181.0564, -002.4987, -124.9742, 0.2: -146.4939, 025.4189, 164.1326, 0.2: -181.8497, 043.9676, 123.8170, 0.2: -205.7297, -015.0698, 077.9440, 0.2: -181.1989, 025.4189, -124.7675, 0.2: -146.3506, 043.9676, -164.2604, 0.2: -103.1141, -060.5182, -194.3385, 0.2: 206.2688, 025.4189, -076.5058, 0.2: 181.9577, -085.2923, 123.6583, 0.2: 145.9201, -015.0698, 164.6429, 0.2: 100.0489, -048.5534, 195.9342, 0.2: -218.7948, -002.4987, 022.9962, 0.4: -053.2228, -017.5191, -213.4650, 0.4: 218.2410, 025.0639, -027.7637, 0.4: 050.4240, -017.5191, 214.1434, 0.4: -196.4553, 049.6189, -099.0216, 0.2: -208.0140, 049.6189, -071.6249, 0.1: -100.7322, 049.6189, 195.5837, 0.1: -122.2254, 049.6189, 182.9233, 0.2: 055.0836, 049.6189, -212.9924, 0.1: 083.3026, 049.6189, -203.6189, 0.2: 206.0678, -107.1381, 077.0456, 0.1: 195.1423, -107.1381, 101.5846, 0.2:

Notes

iOS users will need to allow permission to access the sensor data. Nothing is being collected or montiored.
Some older versions of Safari want you to set the rotation permission through the settings. If you do that it should still work.
On the desktop, pressing the right direction arrow simulates spinning. Press again to stop. Saving also saves a txt file to your downloads folder.

credit

This project was created with p5.js
Thanks to the YouTuber dizicode for the excellent tutorial on how to access sensors in iOS.