Drum Module Help

Status
Not open for further replies.

Avi Harel

Active member
I am trying to build a (very basic) drum module using teensy (3.1) and the audio shield
this is my setup :

Capture.JPG

where each piezo is connected to on an analog pin mediated by the adc-s. However I found out that
having more than one AudioInputAnalog is impossible (the program compiles but there is no sound).

My question is whether it is even appropriate to use the teensy+audio shield for this purpose ?
My thoughts are that the inputs from the drum pads are simple velocity inputs and not high definition
audio inputs as perhaps intended by the audio shield so there might be some way to convey
these inputs perhaps without using AudioInputAnalog ? Any help would be appreciated.
 
Hi Avi,

I'm not sure I will be of much help in answering your question, but I thought I could at least help explore it. I usually think of piezo devices as providing start trigger and optionally magnitude (velocity) when used as part of an electronic drum kit. Are you looking to translate the output from the piezo elements directly into drum sounds? A front end following the piezo elements could differentiate between background noise and a real trigger, assign a velocity value, and might also use information from the other piezo channels to cancel crosstalk. You may consider working on this as a separate stage with your own logic interpreting the A/D information before feeding requests into the audio shield.
 
Hi Avi,

I'm not sure I will be of much help in answering your question, but I thought I could at least help explore it. I usually think of piezo devices as providing start trigger and optionally magnitude (velocity) when used as part of an electronic drum kit. Are you looking to translate the output from the piezo elements directly into drum sounds? A front end following the piezo elements could differentiate between background noise and a real trigger, assign a velocity value, and might also use information from the other piezo channels to cancel crosstalk. You may consider working on this as a separate stage with your own logic interpreting the A/D information before feeding requests into the audio shield.

Thanks for your reply. I already did that - I am using a (very simple) peak holder using LM324 which gives good results. Actually everything works great and the only problem is I cannot
realize the setting I published above since I cannot define more than one AudioInputAnalog (hence I can use only one drum). So let me rephrase my question : How is it possible
to feed an input from an analog pin to the peak object the same way AudioInputAnalog objects does ?
 
but it is not just a trigger, I use the actual value of the peak to control the volume of the appropriate input to the mixer.

well, that's not evident from the diagram you've posted. anyhow, chances are that the audio library doesn't support more than one adc object (AFAIK); it's meant to be used for audio signals, not general purpose input. if you want to control the volume, not just trigger the file, a 44k sample rate probably isn't actually called for though. have you tried with analogRead (and say IntervalTimer)? -- what's inside the "peak" object is fairly simple.
 
well, that's not evident from the diagram you've posted. anyhow, chances are that the audio library doesn't support more than one adc object (AFAIK); it's meant to be used for audio signals, not general purpose input. if you want to control the volume, not just trigger the file, a 44k sample rate probably isn't actually called for though. have you tried with analogRead (and say IntervalTimer)? -- what's inside the "peak" object is fairly simple.

Ok, I will try that. Thanks for the help.
 
I would like to share the best I got so far. It does sound quite good and I think the only way to make it better
is to construct better physical drum pads (a la yamaha digital drum kits). In any case this is the analog part, i.e. the peak holder circuit :
drumTrigger_bb.jpg

this is for two drums, the parts are : 10Kohm resistor, 1uF electrolytic capacitor and a low signal 1N4148 diode (for each drum)
I connect each piezo on the drum pad to the appropriate input in the LM324 and connect its output to the analog pins on the teensy.
What this circuit does is basically give a nice output of the piezos : instead of a sketchy decaying sinewave it gives a nice (pseudo?)exponentially decaying curve
and so for example when I hit the drum pad hard I might get a series of values on the teensy as : "90 30 18 17 11". This allows me
to take the first reading as an amount proportional to the power of the hit which greatly simplifies the software side.
here is my code for two drums (I am using the audio files from "Samples" in the tutorial of the audio) :

View attachment drum8.ino

any suggestions or comments would be greatly appreciated. If you find this useful feel free to use it.
 
Status
Not open for further replies.
Back
Top