Cleanup
Mockband / build (push) Failing after 20s Details

This commit is contained in:
Neale Pickett 2024-01-07 15:55:26 -07:00
parent cd62fa7eba
commit c7807b0c26
4 changed files with 81 additions and 26 deletions

View File

@ -15,13 +15,11 @@ firmwares: MockBand.drums.hex
MockBand.drums.hex: VID=0x1bad MockBand.drums.hex: VID=0x1bad
MockBand.drums.hex: PID=0x3110 MockBand.drums.hex: PID=0x3110
firmwares: MockBand.drumsx.hex MockBand.drums-xbox.hex: VID=0x1bad
MockBand.drumsx.hex: VID=0x1bad MockBand.drums-xbox.hex: PID=0x0003
MockBand.drumsx.hex: PID=0x0003
firmwares: MockBand.drums1.hex MockBand.drums-rb1.hex: VID=0x1bad
MockBand.drums1.hex: VID=0x1bad MockBand.drums-rb1.hex: PID=00005
MockBand.drums1.hex: PID=00005
MockBand.%.hex: MockBand.ino MockBand.%.hex: MockBand.ino

View File

@ -127,30 +127,33 @@ void loop() {
// //
// Calculate and send an HID update // Calculate and send an HID update
// //
uint16_t vbuttons = buttons; // We're going to mess with the button state
buttonState.buttons = (buttons & 0b1100111111); // +-..!OYRGB buttonState.buttons = (vbuttons & 0b1100111111); // +-..!OYRGB
#ifdef GUITAR #ifdef GUITAR
buttonState.buttons |= (buttons >> 10) & 0b11111; // Solo keys buttonState.buttons |= (vbuttons >> 10) & 0b11111; // Solo keys
bitWrite(buttonState.buttons, 6, buttons & (0b11111 << 10)); // Solo modifier bitWrite(buttonState.buttons, 6, vbuttons & (0b11111 << 10)); // Solo modifier
if (bitRead(buttons, 6)) { if (bitRead(vbuttons, 6)) {
buttonState.hatAndConstant = 0; // up buttonState.hatAndConstant = 0; // up
} else if bitRead(buttons, 7) { // } else if bitRead(vbuttons, 7) {
buttonState.hatAndConstant = 4; // down buttonState.hatAndConstant = 4; // down
} else { } else {
buttonState.hatAndConstant = 8; // nothing buttonState.hatAndConstant = 8; // nothing
} }
#else // DRUMS #else // DRUMS
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
// High hat pedal (SOLO_RED) makes yellow cymbal strike a blue cymbal strike // Hi hat pedal (SOLO_RED) makes yellow cymbal strike a blue cymbal strike
if ((bitRead(buttons, 12) && bitRead(buttons, 13)) { if (bitRead(vbuttons, 12) && bitRead(vbuttons, 13)) {
bitWrite(buttonState.buttons, 3, bitRead(buttons, 3)); // Yellow drum hit still counts bitClear(vbuttons, 13);
bitWrite(buttonState.buttons, 0); // Set blue bitSet(vbuttons, 10);
} }
buttonState.buttons |= (vbuttons >> 10) & 0b01011; // Cymbals
bitWrite(buttonState.buttons, 10, (vbuttons >> 0) & 0b01111); // Drum pad modifier
bitWrite(buttonState.buttons, 11, (vbuttons >> 10) & 0b01011); // Cymbals modifier
// rbdrum2midi wants these set: it ignores the button states. // rbdrum2midi wants these set: it ignores the button states.
buttonState.velocity[0] = bitRead(buttonState.buttons, 3)?127:0; // Y buttonState.velocity[0] = bitRead(buttonState.buttons, 3)?127:0; // Y
buttonState.velocity[1] = bitRead(buttonState.buttons, 2)?127:0; // R buttonState.velocity[1] = bitRead(buttonState.buttons, 2)?127:0; // R
@ -160,9 +163,9 @@ void loop() {
// Clone Hero 1.0.0.4080-final needs blue and yellow cymbals to send up and down on d-pad. // Clone Hero 1.0.0.4080-final needs blue and yellow cymbals to send up and down on d-pad.
// This is what the mysterous CymExt1 and CymExt2 mappings mean. // This is what the mysterous CymExt1 and CymExt2 mappings mean.
// If these aren't set, all pads (except red) register as simultaneous drum and cymbal hits. // If these aren't set, all pads (except red) register as simultaneous drum and cymbal hits.
if (bitRead(buttons, 10)) { if (bitRead(vbuttons, 13)) {
buttonState.hatAndConstant = 0; // up buttonState.hatAndConstant = 0; // up
} else if (bitRead(buttons, 13)) { // } else if (bitRead(vbuttons, 10)) {
buttonState.hatAndConstant = 4; // down buttonState.hatAndConstant = 4; // down
} else { } else {
buttonState.hatAndConstant = 8; // nothing buttonState.hatAndConstant = 8; // nothing

27
docs/CHANGELOG.md Normal file
View File

@ -0,0 +1,27 @@
# Changelog
## [1.0-beta2] - 2024-01-07
### Added
- CI/CD build
- Make-based build, but it still works with the Arduino IDE!
- XBox controller
### Fixed
- Blue and Yellow cymbal strikes send up and down on the D-pad.
- This fixes a bug with Clone Hero where Blue, Yellow, and Green pads,
both cymbal and drum pads,
triggered a drum and cymbal hit at the same time.
- Clone Hero's mysterious CymExt1 and CymExt2 are read on Yellow and Blue
cymbal hits, and must map to dpad up and down. In Windows this might be called "POV Hat";
in Linux it's called "Hat 0"
### Changed
- The "high hat" pin now causes the yellow cymbal to send a blue cymbal hit,
similar to devices sold in the past for this express purpose.
Previously it changed a hat axis,
because I thought "hat" meant "high hat". Heh.
### Removed
- No more DEBUG option
## [1.0-beta1] - 2024-01-04

View File

@ -11,12 +11,11 @@ Sample Rate
----------- -----------
The number of samples taken since the last HID report The number of samples taken since the last HID report
is sent as the second Y axis. is sent as the second Y axis,
If you `#define DEBUG`, which doesn't appear to be used by anything else.
you can use the You can use the
[included gamepad tester](gamepad.html), [included gamepad tester](gamepad.html),
to see the approximate number of samples as an integer, to see the approximate number of samples as an integer.
on the first X axis.
This is approximate, This is approximate,
because the browser encodes the value as a real number between -1 and 1. because the browser encodes the value as a real number between -1 and 1.
@ -24,6 +23,11 @@ We convert it back, but may lose a little precision.
It's close enough for me, It's close enough for me,
hopefully it's close enough for you. hopefully it's close enough for you.
This number will not be very useful
unless you are polling the wammy bar,
since without that input,
updates are only sent when a button state changes.
Debouncing Debouncing
---------- ----------
@ -132,8 +136,31 @@ None of the Wii games I have
seem to care what these values are set to. seem to care what these values are set to.
Clone Hero
==========
This controller doesn't have a dpad (currently),
so we're using 12 buttons to represent the state of 9 inputs.
Sometimes software is just weird!
Clone Hero has two undocumented CymExt1 and CymExt2 mappings.
It talks about what they should be set to (on Windows) in the wiki,
but doesn't explain what they're used for.
It seems that Clone Hero expects the Yellow and Blue cymbals
to send dpad inputs, in addition to the pad color and cymbal modifier.
If the controller doesn't send these,
then every drum pad hit plays that color's drum and cymbal at the same time,
and every cymbal pad hit does the same thing.
I'm not exactly sure why Clone Hero does this,
but in any case,
Mockband sends the right things now,
so the drum controller should work correctly after you map everything.
References References
========= ==========
The most valuable sources of information I found were: The most valuable sources of information I found were: