Noodle-Synth icon indicating copy to clipboard operation
Noodle-Synth copied to clipboard

how do I know what note is playing now?

Open hdw0 opened this issue 5 years ago • 2 comments

I start playing the music sequence. For every note I play, I have to light the right led. As to know what note plays in this moment?

hdw0 avatar Dec 09 '19 11:12 hdw0

At this line you can get the current note playing:

noodleSynth->mTrigger(myInstrument, (NOTE_C1 - 1)+((scale - 1) * 12 + note));

You can manually edit the library and create another private variable called uint8_t currentNotePlaying; and set that note as

currentNotePlaying = (NOTE_C1 - 1)+((scale - 1) * 12 + note);

Then in your arduino code, you can do

if(buzzer.currentNotePlaying == NOTE_A1){
    digitalWrite(LED_BUILTIN, HIGH);
}

That's just some pseudo-code though, I'll update the master-branch later. Meanwhile, just edit the library in your own local machine.

nathanRamaNoodles avatar Dec 09 '19 17:12 nathanRamaNoodles

Thanks very much. Thank you for your responsiveness.

hdw0 avatar Dec 10 '19 06:12 hdw0