From cd62fa7eba187750e78a3bd97812dda7dbc6a5e6 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 7 Jan 2024 15:29:50 -0700 Subject: [PATCH] Hi hat now makes yellow cymbal = blue cymbal --- MockBand.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MockBand.ino b/MockBand.ino index 7bb3da2..ac6d4b2 100644 --- a/MockBand.ino +++ b/MockBand.ino @@ -144,8 +144,12 @@ void loop() { buttonState.buttons |= (buttons >> 10) & 0b01011; // Cymbals bitWrite(buttonState.buttons, 10, (buttons >> 0) & 0b01111); // Drum pad modifier bitWrite(buttonState.buttons, 11, (buttons >> 10) & 0b01011); // Cymbals modifier - //buttonState.axis[3] = bitRead(buttons, 12)?255:0; // High hat - buttonState.axis[2] = 127; + + // High hat pedal (SOLO_RED) makes yellow cymbal strike a blue cymbal strike + if ((bitRead(buttons, 12) && bitRead(buttons, 13)) { + bitWrite(buttonState.buttons, 3, bitRead(buttons, 3)); // Yellow drum hit still counts + bitWrite(buttonState.buttons, 0); // Set blue + } // rbdrum2midi wants these set: it ignores the button states. buttonState.velocity[0] = bitRead(buttonState.buttons, 3)?127:0; // Y @@ -158,7 +162,7 @@ void loop() { // If these aren't set, all pads (except red) register as simultaneous drum and cymbal hits. if (bitRead(buttons, 10)) { buttonState.hatAndConstant = 0; // up - } else if bitRead(buttons, 13) { // + } else if (bitRead(buttons, 13)) { // buttonState.hatAndConstant = 4; // down } else { buttonState.hatAndConstant = 8; // nothing