For sometime I wanted to build a 8 Button Arduino drum pad Thingy, and can’t find anything like what I want. I’ve scoured the internet for the type of stuff and just can’t find anything, and I don’t quite know how I would do it myself...
The features I am looking for are something like this: you press one of 8 buttons, and you get the corresponding sound, played through a speaker (I.E. kick, snare, Tom, hihat, etc.), no MIDI or anything fancy here. Sounds pretty simple, but I just can’t figure it out.
I want each drum sound to be synthesized directly from the arduino, and I don’t care about the quality, as long as it provides the sort of arcade/chiptune drum sound.
I’ve tried something like:
byte kick[] {
262, 233, 363 //etc. you get the idea
}
const int spkPin = 8;
Int btnVal = digitalRead(2);
void setup() {
pinMode(spkPin, OUTPUT);
pinMode(2, INPUT);
}
void loop() {
If (btnVal == High) (
tone(kick, spkPin);
)
}
but in theory it should only play a sequence of tones...
How would I use an array of values to synthesize a crappy drum sound and play it when I press a button?
Drum Thingy..txt (230 Bytes)