Wording and syntax tweaks

This commit is contained in:
Joshua Boniface 2023-05-09 15:15:36 -04:00
parent 736bca8d81
commit 67625675a5
1 changed files with 22 additions and 20 deletions

View File

@ -19,7 +19,7 @@ A few years later I had moved on to a new job, working a 13:00-21:00 shift and g
## The Problem
But, the problem is, not drumming for nearly 4 years took an absolute toll on my skills. Before, I could easily play for an hour or more solid, doing back-to-back-to-back Rush, Dream Theater, Porcupine Tree, and other demanding songs, with nary a care in the world. But after the break, my endurance was absolutely shot - sometimes I could barely finish a song before my arms would "give out", and my general skill had also taken a dive, especially around double-bass and fast fills.
But, the problem is, not drumming for nearly 5 years took an absolute toll on my skills. Before, I could easily play for an hour or more solid, doing back-to-back-to-back Rush, Dream Theater, Porcupine Tree, and other demanding songs, with nary a care in the world. But after the break, my endurance was absolutely shot - sometimes I could barely finish a song before my arms would "give out", and my general skill had also taken a dive, especially around double-kick and fast fills.
There was also an issue with what I'll call "active feedback" on the Strike. With a real drumkit, I was able to put in earbuds for the music I was listening to, and the sheer sound of the drums would permeate me physically and around the earbuds, and I ended up with a perfect "mix" most of the time without being overly loud in my ears. But with the Strike, being purely electronic audio, it was very hard to find a mix that worked without either blowing out my eardrums or it being very hard to hear myself.
@ -31,7 +31,7 @@ As further motivation, the COVID-19 pandemic did an absolute number on me person
Drumming is *excellent* exercise. Even if you're just playing basic beats, you're doing cardio, strength training on at least 2, maybe 3 or even 4, limbs, and you can work up a sweat fairly easily. So I knew what I needed to do: I needed to actually *play* my drums. But how?
Well, there was another thing I did a lot of in my early-to-mid 20's: Rock Band! I love this game, even today. Playing Rock Band drums was pretty close to a real drumkit in terms of workout, and was always fun for me, even solo. I still had all my gear kicking around, and a few months ago my good friend suggested we bust out the game for a small gathering of friends, which was a smashing success. And it really got me thinking: could I play Rock Band with my Strike? It would solve all the problems: I'd get *visual* feedback for my playing, no audio mixing issues, I could work up to harder songs over time, I could play for just as long as I wanted. So I went looking for how to do this.
Well, there was another thing I did a lot of in my early-to-mid 20's: Rock Band! I love this game, even today. Playing Rock Band drums was pretty close to a real drumkit in terms of workout, and was always fun for me, even solo. I still had all my gear kicking around, and a few months ago my good friend suggested we bust out the game for a small gathering of friends, which was a smashing success. And it really got me thinking: could I play Rock Band with my Strike? It would solve all the problems: I'd get *visual* feedback for my playing, no audio mixing issues, and I could work up to harder songs and longer sessions over time. So I went looking for how to do this.
It turns out I'm definitely nowhere near the first, and I definitely won't be the last. So, the rest of this blog post will detail my setup, how I got it working, the parts I used, and the challenges I've faced with the Strike, with an eye towards helping others do this as well.
@ -39,15 +39,15 @@ It turns out I'm definitely nowhere near the first, and I definitely won't be th
I've never been much of a gamer, even going back to my childhood. We had a complete mishmash of consoles over the years (Sega Saturn, then XBox, then PS3), and for the PS3 I think the most we ever owned was 3 games: LittleBigPlanet 1 & 2 and Rock Band 3. But my PS3 still worked perfectly, and as luck would have it, it was an early Slim model that was fully compatible with modding/jail-breaking so I could use RB3 Deluxe and custom songs. I won't detail that part in this blog post, but I was able to jailbreak, reload, and put custom songs onto my PS3 in about an afternoon's worth of work.
Then, as luck would have it, my sister told me that she actually had an old spare PS3 from an ex who had abandoned it with her before they broke up. Even better it was an original fat model, though alas not one with native PS2 support and NAND flash. Further, her current fiancé had an older 42" Samsung TV I could use. In my head I jumped right to the idea of having a dedicated PS3 and TV for my drum area so I wouldn't have to move anything around: I could just sit down and play! I got all the pieces, fully cleaned and re-pasted the PS3, set up the TV, moved my drums, and got to work with the setup.
Then, as luck would have it, my sister told me that she actually had an old spare PS3 from an ex who had abandoned it with her before they broke up. Even better it was an original fat model, though alas not one with native PS2 support and NAND flash. Further, her fiancé had an older 42" Samsung TV I could use. In my head I jumped right to the idea of having a dedicated PS3 and TV for my drum area so I wouldn't have to move anything around: I could just sit down and play! I got all the pieces, fully cleaned and re-pasted the PS3, set up the TV, repositioned my drums, and got to work with the setup.
## Part One: Rock Band 3 Pro
The first step of this is Rock Band Pro mode. Introduced in Rock Band 3, pro mode is designed to give a fully "authentic experience" in playing the instruments. Pro guitar/bass feature a full-fret plastic guitar (versus just 5 buttons), pro keys has you play actual notes over a 2 octave range, and pro drums adds support for 3 cymbals in addition to just the "toms"/pads.
The first step of this is Rock Band Pro mode. Introduced in Rock Band 3, pro mode is designed to give a fully "authentic experience" in playing the instruments. Pro guitar/bass feature a full-fret plastic guitar (versus just 5 buttons), pro keys has you play actual notes over a 2 octave range, and pro drums adds support for 3 cymbals in addition to the "toms"/pads.
As part of Pro mode, Mad Catz made the "Rock Band Pro MIDI adapter", which is pretty much exactly what it sounds like: you can input MIDI from an instrument into it, and it will "convert" it into the signals that Rock Band's Pro mode can handle. And it works with virtually anything as long as you send the right MIDI notes. And doing Pro mode with electronic drums is of course one of the supported options.
As part of Pro mode, Mad Catz made the "Rock Band Pro MIDI adapter", which is pretty much exactly what it sounds like: you can input MIDI from an instrument into it, and it will "convert" it into the signals that Rock Band's Pro mode can handle. It works with virtually anything as long as you send the right MIDI notes, and doing Pro mode with electronic drums is of course one of the supported options.
I got the Wii version of the adapter, because according to much of the community, this was the best option as it could easily be changed (by removing a resistor) to support the PS3, while costing up to 1/3 of the price. So I ordered one from Amazon along with a MIDI cable and hooked it up.
I got the Wii version of the adapter, because according to much of the community, this was the best option as it was widely available and could be easily modified (by removing a resistor) to support the PS3, while costing up to 1/3 of the price of the PS3 version, the only limitation being a lack of shoulder buttons. So I ordered one from Amazon along with a MIDI cable and hooked it up.
And it worked!
@ -55,46 +55,48 @@ And it worked!
But, there were a couple issues I had. Well, OK, really just one issue that wasn't "me": the Hi-Hat.
See, Rock Band 3 Pro mode for the drums comes with a "Hi-Hat Pedal" mode. They would sell you a second pedal you could use as either a second bass drum or the "hi-hat pedal", and there is an option in the game to turn this mode on. Problem is, this mode doesn't do *jack*. It does nothing to affect the gameplay or the charts whatsoever.
See, Rock Band 3 Pro mode for the drums comes with a "Hi-Hat Pedal" mode. They would sell you a second pedal you could use as either a second kick drum or the "hi-hat pedal", and there is an option in the game to turn this mode on. Problem is, this mode doesn't do *jack*. It does nothing to affect the gameplay or the charts whatsoever.
Now why might that be a problem? Well, as a convention, Rock Band Pro drum charts use the Yellow Cymbal (hereafter YC) for a closed hi-hat note, and sometimes a secondary or tertiary crash. Then the use the Blue Cymbal (BC) for a ride note, a secondary or tertiary crash, and, most importantly: for an open hi-hat note. But only sometimes.
Now why might that be a problem? Well, as a convention, Rock Band Pro drum charts use the Yellow Cymbal (hereafter YC) for a closed hi-hat note, and sometimes a secondary or tertiary crash. Then they use the Blue Cymbal (BC) for a ride note, a secondary or tertiary crash, and, most importantly, for an open hi-hat note. But only sometimes.
What this means is that a fairly common drum pattern of closed and open notes looks something like this (YC, BC, Ki[ck], Sn[are]):
```
YC BC YC BC YC BC YC ...
Ki Sn Ki Sn ...
```
On a real drumkit, this is played with the hi-hat pedal opening and closing the hat on each 8th note. No motion, no moving between arm positions, just a simple beat. It's so basic it's often one of the first "exotic" beats that people learn. Further there's often little open hi-hat splashes that occur inside other beats, which are trivial on a drumkit.
On a real drumkit, this is played with the hi-hat pedal opening and closing the hat on each 8th note. No moving between arm positions, just use of the left foot. It's so basic it's often one of the first "exotic" beats that people learn. Further there's often little open hi-hat splashes that occur inside other beats, which are trivial on a drumkit.
But because of the complete lack of functionality of the "Hi-hat pedal mode", you're forced to play this in Rock Band on two different cymbals. Now, on the tiny plastic Rock Band kit this is annoying but manageable, since your arm only has to move about 10-20 degrees and about 12-18 inches. But on a real kit, this is functionally impossible to do accurately and comfortably at any amount of speed. It's a breaking feature, and I really wanted to solve this.
Now, many *low-end* drumkits have a workaround for this. You could simply have the drum head unit send a different note, specifically a YC note, for the hi-hat when it's closed, and a BC note for when it's open. Great!
But, the problem is, that's only for *low-end* kits. See that method of doing things isn't flexible for doing "real things" with DAWs or sequencers or what have you. On higher end kits - and the Alesis Strike Pro is a very high-end kit - what is done instead is to send a single "note" for the hi-hat hit itself, and then also send MIDI CC#4 (Control Channel #4) events containing the position of the pedal. This gives the maximum flexibility for audio equipment to handle the signal. But you can't switch modes on the drum kit itself, you're stuck with this "high-end" mode of operation.
But, the problem is, that's only for *low-end* kits. See that method of doing things isn't flexible for doing "real things" with DAWs or sequencers or what have you. On higher end kits - and the Alesis Strike Pro is a very high-end kit - what is done instead is to send a single "note" for the hi-hat hit itself, and then also send MIDI CC#4 (Control Channel #4) events containing the position of the pedal. This gives the maximum flexibility for audio equipment to handle the signal. And you can't switch off this mode on the drum kit itself; you're stuck with this mode of operation.
And here's the craziest thing: Rock Band 3 can accept that CC#4 signal! In fact, it's what the Hi-Hat pedal in the game is mapped to! But because the feature isn't actually implemented, it's useless. It doesn't affect the chart or rewrite the note for you as it "should" (at least, as I think it should have...). A dead end, so I thought.
Now here's the craziest thing: Rock Band 3 can accept that CC#4 signal! In fact, it's what the Hi-Hat pedal in the game is mapped to! But because the feature isn't actually implemented, it's useless. It doesn't affect the chart or rewrite the note for you as it "should" (at least, as I think it should have...). A dead end, so I thought.
## Part Three: An Arduino and a MIDI Shield
I asked around a few places about this, and I got answers ranging from "why would you want that?" (clearly not a drummer) to "it's impossible". But I knew it wasn't. The solution seemed fairly obvious to me. If I could somehow read the MIDI signal as it was coming out of the drumkit, and, using the CC#4 signal as a guide, rewrite the Hi-Hat note based on the pedal position, I could *fake* a simple on/off hi-hat signal mode.
I asked around a few places about this, and I got answers ranging from "why would you want that?" (clearly not a drummer) to "it's impossible". But I knew it wasn't. The solution seemed fairly obvious to me: if I could somehow read the MIDI signal as it was coming out of the drumkit, and, using the CC#4 signal as a guide, rewrite the Hi-Hat note based on the pedal position, I could *fake* a simple on/off hi-hat signal mode.
Enter the [SparkFun MIDI Shield for the Arduino](https://www.sparkfun.com/products/12898)! This shield gives you MIDI-IN and MIDI-OUT ports and interfaces with the internal serial bus of the Arduino. And [there is a fully feature-complete library for it as well](https://github.com/FortySevenEffects/arduino_midi_library), allowing one to easily build MIDI functionality in the Arduino IDE.
All the pieces came together for me: I just had to write a bit of conditional code that would read in the MIDI CC#4 events, track the hi-hat "openness" state, handle nodes asynchronously, and rewrite the YC signal to be a BC signal whenever the hi-hat was opened.
As part of this, I leveraged the Pro MIDI adapter's ability to map multiple notes to each game note, so I would send note 22 for the Hi-Hat yellow cymbal, but send note 25 for the Crash yellow cymbal, so they could operate independently. I'd then rewrite only note 22 events based on the pedal, so the crash would always work while the hi-hat would change in response to the pedal.
As part of this, I leveraged the Pro MIDI adapter's ability to map multiple notes to each game note, so I would send note 22 for the Hi-Hat yellow cymbal, but send note 26 for the Crash yellow cymbal, so they could operate independently. I'd then rewrite only note 22 events based on the pedal, so the crash would always work while the hi-hat would change in response to the pedal.
I also wanted the ability to turn this remapping on and off. Very quickly I noticed some songs where the charting was such that all hi-hat notes, even "open" ones, were mapped to the yellow cymbal, especially during double bass drum passages. Thus for those songs I'd want the ability to turn remapping off so I could still play naturally without needing to adjust my hi-hat physically, then swap back for other songs easily. Luckily the MIDI Shield also comes with push-buttons, so I attached one of them to the board, and added this to the code. I use the red and green LEDs on the board to indicate what mode it's in as well, so I have clear visual feedback of when the remapping is on (green) or off (red).
I also wanted the ability to turn this remapping on and off. Very quickly I noticed some songs where the charting was such that all hi-hat notes, even "open" ones, were mapped to the yellow cymbal, especially during double kick drum passages. Thus for those songs I'd want the ability to turn remapping off so I could still play naturally without needing to adjust my hi-hat physically, then swap back for other songs easily. Luckily the MIDI Shield also comes with push-buttons, so I attached one of them to the board, and added this to the code. I used the red and green LEDs on the board to indicate what mode it's in as well, so I have clear visual feedback of when the remapping is on (green) or off (red).
At this point I had things working enough to do a quick demo video, [visible on my YouTube channel here](https://www.youtube.com/watch?v=ocAzJ67x4Z0). While my videography failed quite spectacularly after about 3.5 minutes, it gets the point across: this solution was a success!
## Part Four: Building the Final Form
One thing I didn't like about the build as it was, was using the Arduino Uno as the computer. It's hard to explain or really quantify, but the responsiveness of the kit just felt "sluggish" to me, and I attributed this to the performance of the Arduino in reading the MIDI events and then writing them back out. There were also weird issues with floating capacitance causing the mode to flip back and forth constantly at times which became really annoying.
One thing I didn't like about the build at this point was the Arduino Uno I was using as the microcontroller. It's hard to explain or really quantify, but the responsiveness of the kit just felt "sluggish" to me, and I attributed this to the performance of the Arduino in reading the MIDI events and then writing them back out. There were also weird issues with floating capacitance causing the mode to flip back and forth constantly at times, which became really annoying.
So I decided to replace the Arduino itself with another microcontroller, the much faster STM32 "Blackpill", of which I had over a dozen lying around from another (failed) project. The Blackpill had a number of benefits: first, it was much faster (up to 16x faster than the Arduino Uno, CPU-wise), it was much smaller and could fit into a smaller area, it had 2 serial UARTs so I could actually *debug* the thing with serial prints, and finally it was able to be powered over USB-C which, while smaller, meant that I had more flexibility in cables and where they were positioned.
So I decided to replace the Arduino itself with another microcontroller, the much faster STM32 "Blackpill", of which I had over a dozen lying around from another (failed) project. The Blackpill had a number of benefits: first, it was much faster (up to 16x faster than the Arduino Uno, CPU-wise, with dual ARM cores), it was much smaller and could thus fit into a smaller area, it had 2 serial UARTs so I could actually *debug* the thing with serial prints, and finally it was able to be powered over USB-C (of which I had many more long cables than I had for USB-A to USB-B).
I soldered everything together with my (brand new) [Pine64 Pinecil](https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/), which - aside - is the best soldering iron I've ever used - using 22-gauge Ethernet wire I had laying around, and covered it in tape to protect it and the leads as well as eliminate any stray bridging from touching it. I then made a quick little wire mount, soldered onto the potentiometer anchor points of the MIDI Shield, and used this to attach it to the top of my speaker controller for a clean, easily accessible setup.
I soldered everything together with my (brand new) [Pine64 Pinecil](https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/) - which, aside, is the best soldering iron I've ever used - using 22-gauge Ethernet wire I had laying around, and covered it in tape to protect it and the leads as well as eliminate any stray bridging from touching it. I then made a quick little wire mount, soldered onto the potentiometer anchor points of the MIDI Shield, and used this to attach it to the top of my speaker controller for a clean, easily accessible setup.
## Part Five: Pictures and Code!
@ -102,16 +104,16 @@ What would this post be without some pictures?
![Wiring of the Blackpill and MIDI Shield](/images/gamifying-my-drumming/blackpill-hat-wiring.jpg)
Here is a quick WIP shot of the wiring for the Blackpill and the MIDI Shield. You can see the power along the left and the various signal lines to the shield across the center. A2 and A2 are the second serial UART, A5 is the button for mode control, and A6 and A7 are the LEDs for status indication. Not shown is the aforementioned heavy wire mount, which was soldered to the mechanical anchor points at the top of the board in this image.
Here is a quick WIP shot of the wiring for the Blackpill and the MIDI Shield. You can see the power along the left and the various signal lines to the shield across the center. A2 and A3 are the second serial UART on the Blackpill; A5 is the button for mode control; and A6 and A7 are the LEDs for status indication. Not shown is the aforementioned heavy wire mount, which was soldered to the mechanical anchor points at the top of the board in this image.
![MIDI Rewriter module in situ, front](/images/gamifying-my-drumming/midi-rewriter-front.jpg)
![MIDI Rewriter module in situ, back](/images/gamifying-my-drumming/midi-rewriter-back.jpg)
Here are two images, front and back, of the MIDI Rewriter module in its final position with all connections. From the front, the MIDI-IN from the drum head is on the, right, while the MIDI-OUT to the Pro Adapter is on the left. USB power is visible on the back, and all the cables are neatly organized using small cable ties. The two USB cables (USB-C power for the Blackpill and USB signal for the Pro Adapter) are routed over to a USB hub by the PS3 along the drum frame.
Here are two images, front and back, of the MIDI Rewriter module in its final position with all connections. From the front, the MIDI-IN from the drum head is on the right, while the MIDI-OUT to the Pro Adapter is on the left. USB power is visible on the back, and all the cables are neatly organized using small cable ties. The two USB cables (USB-C power for the Blackpill and USB signal for the Pro Adapter) are routed over to a USB hub by the PS3 along the drum frame.
![Pro Adapter/Controller](/images/gamifying-my-drumming/pro-controller.jpg)
Here is a shot of me holding the Pro Controller. The cables are neatly routed to provide me plenty of slack to hold the controller if needed, and the MIDI cable acts as a loop to hook onto the golden-coloured 3D-printed hook attached ot the side of the drum module. Also (slightly) visible underneath the drum module are my headphones that I use during "quiet hours", on another golden 3D-printed hook. This keeps everything together and nicely out of the way while I'm playing while still being accessible instantly.
Here is a shot of me holding the Pro Controller. The cables are neatly routed to provide me plenty of slack to hold the controller if needed, and the MIDI cable acts as a loop to hook onto the golden-coloured 3D-printed hook attached to the side of the drum module. Also (slightly) visible underneath the drum module are my headphones that I use during "quiet hours", on another golden 3D-printed hook. This keeps everything together and nicely out of the way while I'm playing while still being accessible instantly.
![Whole Setup](/images/gamifying-my-drumming/whole-setup.jpg)