mattybrad / drumkid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need help with "manual tap drumming mode"

jordanlev opened this issue · comments

Hi Matt,
I'm the person who recently bought a DrumKid and was messaging you in Etsy about being able to manually trigger individual drum sounds with a button tap. I started hacking around the code, and have it kinda sorta working but not quite.
See master...jordanlev:drumkid:patch-1
...for my attempt at changes.

What I'm trying to implement is:

  • pressing A+C+D takes you into "manual mode"
  • when in "manual mode", press Start/Stop, A, B, C, or D to trigger kick, hat, snare, rim, or tom (respectively)
  • when done, press tap tempo to exit "manual mode"

The code I have above does work but only one time: after pressing A+C+D, I can press one of the buttons and hear a drum sound, but then I can't do anything else (no other button presses are honored, and the machine is stuck).
I assume there's a flag or some other variable or something to get this event-loop-kinda-thing to continue looping? But I'm not sure how to achieve this.

Thanks for any help or pointers you can provide.

-Jordan

Hey, so this is a bit of a guess because I don't have a Drumkid to play with at the moment, but I think rather than doing:

if(buttonGroup == B00000001) { triggerNote(0, 255); }

...you should try something like this:

if(buttons[0].fell()) { triggerNote(0, 255); }

Hope that helps!

That works! (I also had to remove the if(buttonsPressed == 0) condition).

The one foible is that it doesn't allow "polyphonic" drums (if I press 2 buttons at same time, only 1 drum sound is made instead of 2). Not sure if this could be addressed via code or if it's a limitation of the sound generation library (or hardware).

Thanks so much for your help!

-Jordan