Category Archives: Moushira Elamrawy

Your moves into sound

Ever wondered what would happen if you tracked your motion, used your motion parameters in building a sound wave? I also wondered and thought we can try. Click here to listen to the result (ps: it is super noisy).
The initial idea was to track my skateboard rides and map the falls! (because I fall a lot on the side walks) where the repetion of the zero speed parameter, will make a rhythm. However, due to GPS problems with my phone, I ended up using random values that don’t correspond to a specific motion track.

The tone was generated by building a sine wave, which is constructed by 3 parameters, a frequency, an amplitude [-1, 1] and a sampling rate. You can learn more about sine waves here . The sketch on the left is a quick render of different waves constructed with different frequencies and amplitudes, which I generated using Audacity. Even though, we are converting data to sound and not the opposite, it is still important to learn how waves are constructed before we build them.

Now, as far as processing is concerned, it seems that minim library makes it an interesting tool to deal with sound, nevertheless, minim examples, which are installed by default in your package, and which come with an exact illustration of how sinwaves works in your code (click Sinewave on the left tab). You don’t have to stick to sinewaves, you can also construct your waves using square or triangulate functions. They are all controlled by the same 3 parameters: (frq, amplitude, samplerate).

In order to move to the code, after understanding how sound is being built, we need to start by having a look on how classes are built , then we use that to manipulate Antimap’s example (Yeah, we all love free examples), or generate your own from scratch, if you aren’t a fan or freebies. I needed it to help deal with csv data input, however, I think that table() could provide a better solution, but I didn’t try it. The whole idea is to use different arrays to control the sine wave parameters in the function SineWave(frq, latitude, out.sampleRate()) then you can manipulate the different values from different arrays and see how interesting results could come along. You can also control sine.portamento() for different effects. If you got a the “buffer underrun in AudioOutput” it is mostly because your draw function has nothing there, so check the processing forum for tips, also don’t forget the minum.stop () at the end of your code, otherwise the noise will loop forever, and it is too noisy indeed:)

Also posted in Exercises, Int Programming | Comments closed