Yesterday, we spent some time trying to use the data stream from the range-finder to drive the interval rates of certain frequencies that were then played on a piezo-speaker.
During our attempts, we concluded that we would definitely need a richer sound stream, like a MIDI file for the aural experience to be something that people can enjoy.
In order to use the arduino board as a MIDI controller (:output), we’ll need a MIDI connector which costs ~$2. A tutorial on the ITP program’s Physical Computing lab page here shows the procedure to do this, and also mentions at the end how these different tones can be driven by an analog sensor instead of a switch. The tutorial also challenges us in the end to figure out ways to make different instruments’ sounds using the same circuit setup with differing MIDI values.
For this purpose, there are many MIDI libraries available online which we can make use of. Also, to make ‘melodious’ tones, we’ll need to stick to some grounded rules of music theory like the Octave or Chords. Since our experiment yesterday revealed that the range-finder’s linearized data-stream is noisy for slight variations in distance, we probably shouldn’t directly correlate a tune to the distance value, and rather give it in a synthesizer format whenever a change in factor of distance (say every 10th centimeter) is detected.
Some examples of making music with the Arduino and basic tutorials on creating melodies: