I finally received ten retroreflectors, the experiments started in « Playing with laser beams to create very simple rhythms », we can now move on.
Once again, the rotating mirror is reflecting the four parallel laser beams so that they sweep a 180 degrees area, where some retroreflectors are positioned to hit the beams trajectories.
Every time a beam hits a reflector then it should trigger a sound on a MIDI synth (here it is my little microkorg playing the sounds).
Generative music (a.k.a mangled rhythm)
However in the first try I forgot to set a short loop perid (the period was set to 100ms). Given the velocity of the laser beam when it hits the reflectors there is very little time to catch the signal on the sensors, and with a measure every 100ms the Arduino is missing most hits.
This means we got a simple and regular theoretical rhythm that is mangled by the input sampling process, and this fuzzyness actually creates « interesting » generative music, as in the video:
Note that it is not totally random… (actually it is not random at all, just the result of different frequencies that sometime are in sync and most times are not).
Regular rhythm at last
With a shorter Arduino loop period (10ms) it becomes reliable: every (almost) hit triggers a note, as illustrated in the next video where we can hear a steady rhythmic pattern.
The Arduino code is quite simple: for each of the 4 sensors, read analog value, compare to threshold, debounce (not to send multiple notes for the actual same hit), then send MIDI note.
Any feedback welcome…