I'd like to make a musical harp that utilizes break beam sensors.
I'd really appreciate guidance on these two questions:
How should I go about listening for multiple beam breaks at the same time? I'd like the box to be able to play cords, so I'd need to listen for the break beams while simultaneously taking the action do to other previous break beams. Are there any links to similar projects for guidance on handling multiple inputs (possibly multiple interrupts) at the same time, as well is multiple outputs?
Where is a good place to start to understand how to output non-buzzer sound with an Arduino? I bought a Adafruit Wave Shield to do the trick, but I'd appreciate advice on using this, or possibly taking an easier route.
My major concern is the first question however, and it makes me think I may need a Pi possibly? But I've never worked with those, so I'd like to avoid it if possible.
Q1. How should I go about listening for multiple beam breaks at the same time?
You poll all the sensors in sequence, say hundreds of times a second, to determine which have been activated. Are you going to use sensors consisting of single IR emitter / IR receiver pairs or what are you intending? Can you produce a diagram of this music box, maybe hand drawn, because it is difficult to visualize from the description.
A simple way to generate the sound is to send out MIDI signals to a MIDI sound generator. These are normally polyphonic and can handle many notes at the same time.
I would recommend that you use modulated IR and an IR receiver to reduce interference from ambient light. Then you just scan all the sensors one after the other very fast. That is you start the emitter flashing at the modulation rate and then look at the associated receiver. Repeat for all beams and then start again. This will help with the beam spreading problem where adjacent sensors can be triggered by the wrong beam.
6v6gt:
Q1. How should I go about listening for multiple beam breaks at the same time?
You poll all the sensors in sequence, say hundreds of times a second, to determine which have been activated. Are you going to use sensors consisting of single IR emitter / IR receiver pairs or what are you intending? Can you produce a diagram of this music box, maybe hand drawn, because it is difficult to visualize from the description.
I think I'll do something similar to this.
Here is a diagram of the ROUGH concept. Clearly nothing has been quite worked out yet, but yes I plan to turn them on/off in series very quickly and then look for the signal at the receiver simultaneously.
Delta_G:
From the sounds of things over there you need to learn how to time your notes without using the delay function. See the famous Blink Without Delay example and any of the many fine tutorials all over the web about it.
LINK to SE added in main post.
I'll check this out today. Thanks!
Grumpy_Mike:
A simple way to generate the sound is to send out MIDI signals to a MIDI sound generator. These are normally polyphonic and can handle many notes at the same time.
I would recommend that you use modulated IR and an IR receiver to reduce interference from ambient light. Then you just scan all the sensors one after the other very fast. That is you start the emitter flashing at the modulation rate and then look at the associated receiver. Repeat for all beams and then start again. This will help with the beam spreading problem where adjacent sensors can be triggered by the wrong beam.
This is a much earlier project that did not use the scanning technique on the inputs nor the modulated IR bit. http://www.thebox.myzen.co.uk/Hardware/The_Sound_Square.html
Fine device though that is it will only play one file or sound at a time so you can't do chords.
This was an extremely helpful post on multiple fronts. Thank you. I'll likely follow the on/off beam advice and I'll look into a MIDI option.
The current Wave Shield I have chosen seems functional but in a very clunky way. It seems like I'll need 1000's of files if I want a complete set of cords.