Hi hat now makes yellow cymbal = blue cymbal

This commit is contained in:
Neale Pickett 2024-01-07 15:29:50 -07:00
parent f35e123474
commit cd62fa7eba
1 changed files with 7 additions and 3 deletions

View File

@ -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