Turn the Rock Band 3 keyboard into a sampling instrument with the WAV Trigger

The Rock Band 3 keyboard happens to also be a nice battery powered MIDI keyboard controller that you can pick up on eBay for 20 bucks or so. With a WAV Trigger and a little electronic glue, which I’ll explain in this article, you can make a self-contained, velocity-sensitive, multi-bank sample playback instrument. The Rock Band 3 keyboard buttons and left hand controller allow you to re-map the keys, change sound banks and adjust note release time (sustain) on the fly. I’ll be using classic Mellotron sounds here, but you can easily create your own sample banks using a VSTi software synth.

For those of you just tuning in, the WAV Trigger is a high-fidelity polyphonic audio player. It has 14 “voices” to play and mix uncompressed, stereo, 44.1kHz wav files directly from a microSD card. Audio can be triggered either from digital inputs or serial commands, and latency averages around 8ms (12ms max). The serial control port also supports MIDI protocol, and in MIDI mode it’s velocity sensitive (MIDI velocity maps to volume) and supports adjustable release times (sustain). The mixing engine includes a voice-stealing algorithm so that new MIDI notes take precedent if all 14 voices are being used, and the oldest playing voice is “stolen” to play the new note.

 

RBK_Hero001

 

Step 1: Prep your WAV Trigger. We’ll need to provide 5V to our MIDI input interface circuit, and the easiest way to do this is to close the solder jumper on the WAV Trigger that connects the on-board 5V to the serial connector. The WAV Trigger doesn’t ship from SparkFun this way, because people might connect an FTDI Basic at the same time that they’re powering the WAV Trigger from the barrel connector. I always close this jumper because it allows me to power the WAV Trigger from the FTDI basic.

WTrig_Jumper001

I also strongly advise that you install post headers or receptacles in any WAV Trigger connector that you’re planning to use. PCB connector pads are not meant for direct soldering and I’ve seen too many pads ripped off boards because people solder directly to them and don’t provide strain relief.

While you’re at it, update your firmware from the download page. The latest firmware v1.04 contains new MIDI features that are used by the Rock Band 3 keyboard.

Step 2: Build the MIDI Input interface circuit. The RB3 keyboard has a standard 5-pin circular DIN MIDI Out port on its right side. We need to convert the output’s 20mA current loop to a logic level signal that can feed the WAV Trigger’s RX pin, and this is done with an opto-isolator. Here’s the circuit:

MIDI_In_Schem001

As you can see, it’s pretty simple – just a single 8-pin IC, one diode and two resistors – and is easy to build on a small breadboard. I used an 6N138 optoisolator, but the PC-900 works equally well. The diode is a 1N914, but any small signal diode should work.  I also sacrificed a MIDI cable and soldered posts on the two wires we’ll be using to make it easy to insert into the breadboard. Here’s the completed MIDI In circuit:

 

MIDI_In_Bread001

 

Step 3: Connect the MIDI Input circuit to the WAV Trigger. There are only 3 connections required: 5V, GND and the logic level TX output of the Opto to the WAV Trigger RX. Here are the connections:

MIDI_IN_Hookup003

 

And here’s the completed assembly:

 

MIDI_IN_Assy001

 

Step 4: Prepare the WAV Trigger’s microSD card. In MIDI mode, the WAV Trigger maps incoming MIDI note numbers to track numbers using an internal MIDI bank number. In the default bank 1, MIDI note number 48 maps to track “048xxx.wav” and so on. Each MIDI bank adds 100 to the track number, so that in bank 2 MIDI note number 48 maps to track “148xxx.wav”, in bank 3 MIDI note number 48 maps to track “248xxx.wav” and so on. In this way, you can have up to 10 complete sets of sample tracks for the MIDI key range of notes 0 – 99.

You can change banks in any one of 3 ways:

  1. Change the MIDI Channel that your MIDI Controller is transmitting on. The MIDI Channel number (starting at 0) is added to the bank number.
  2. Install buttons on two of the WAV Trigger’s trigger inputs and use the MIDI BankUp and MIDI BankDn trigger functions.
  3. Send MIDI Program Change messages from your MIDI Controller.

We’ll use the last method here because the Rock Band 3 keyboard supports this feature using its front panel buttons. How convenient.

To get you started, here are the track files for 5 complete sets of classic Mellotron sounds, sampled from an actual Mellotron, courtesy of Leisureland, USA. The track filenames have already been assigned to map the sounds to the correct MIDI Notes in banks 1 through 5.

Copy all files to your microSD card root directory. Run the InitMaker application, enable MIDI on the serial port and save the init file to the microSD card. Install the microSD card into the WAV Trigger.

Step 5: Connect everything up and play! Plug the MIDI cable into the Rock Band 3 keyboard, connect your amp or powered speakers to the WAV Trigger’s audio out (or use the on-board mono amp with an 8-Ohm speaker), supply power to the WAV Trigger and turn on the Rock Band 3 keyboard. If all is well, you should hear the violins in bank 1 when you play the keyboard.

 

MIDI_In_Assy002

 

Here’s a quick summary of the functions available using the RB3 keyboard front panel controller buttons. First up, The 1 and B buttons shift the keyboard up and down an octave at a time, allowing access to more notes than the physical 25 keys on the controller. This function is internal to the RB3 keyboard and simply shifts the note numbers that the keyboard sends up or down 12 note numbers (one octave.)

 

RBK_Buttons_003

 

Next, the 2 and A buttons increment and decrement the WAV Trigger’s MIDI Bank number, thereby changing the sound banks. This works because these buttons send MIDI Program Change messages.

 

RBK_Buttons_002

 

The – button is a panic button, and tells the WAV Trigger to immediately stop all sounds. This is the same as MIDI All-Notes-Off. Technically, this button sends the MIDI RealTime Stop command (0xFC) and I’ve added code to the WAV Trigger to stop all voices when this is received.

 

RBK_Buttons_004

 

Finally, the continuous controller on the left “handle” of the RB3 keyboard adjusts the WAV Trigger’s release time or sustain. This pad sends MIDI Mod Wheel Controller data which I’ve mapped to MIDI release time in the WAV Trigger.

 

RBK_Buttons_005

 

That’s it. Here’s a short demo video of all this in action. (Please keep in mind that I’m a guitar player, not a keyboard player!) Please consider sharing if you create additional sound banks.

  •  



 

Jamie

  • reply Massimo ,

    Great job Jamie! But could you make a version that adds a digit to the MIDI bank? Using your own words: In the default bank 1, MIDI note number 123 maps to track “123xxx.wav” and so on. Each MIDI bank adds 1000 to the track number, so that in bank 2 MIDI note number 123 maps to track “1123xxx.wav”, in bank 3 MIDI note number 123 maps to track “2123xxx.wav” and so on. In this way, you can have up to 10 complete sets of sample tracks for the MIDI key range of notes 0 – 999 and not lose backward compatibility.

    • reply Alain6870 ,

      Hello Jamie,
      I recently bout your wavetrigger and I have a lot of fun with it. the audio quality is really astonnishing considering the size of the board!!
      I tried to use sample higher than 999 and it seems that I freeze the board when I try to trigger them. Is this really the case? Note I use soft 1.04 actually the latest version.

      • reply jamie@robertsonics.com ,

        The WAV Trigger only supports 3 digits in the filename for the track number, so the highest track number currently is 999. To be honest, I never thought to test what happens when you try to trigger tracks above that number. How are you doing this? Are you using the Arduino WAV Trigger Serial Library or just sending serial protocol commands directly? Specifically what command causes the WAV Trigger to freeze?

      • reply alain6870 ,

        I trigger my sounds by midi. For common midi usage it would be better to improve the numbering of the waves. I suggest a 5 digit number like this, xx for midi channel and y for prog number and zz for midi note number giving xxyzz. Thus, it would still be an integer and the board would less be prone to midi incompatibility . Of course a larger number would even give more flexibility. For the moment it is not possible to play with the board in a multitimbral environnement because for instance wave 127 could be triggerd by either midi chnl 0 note 127 or midi chnl 1 note 27.
        Anyway the wavtrigger has the audio quality of my akai sampler and this is important. I would notre ask too much!

        • reply Fred ,

          I use the WAV Trigger with the MIDI Breakout but I don’t manage to run midi. The firmwave 1.10 is charged into the wav trigger with the FDTI Basic, the jumper to enable 5V on serial connector is close. The connection 5V, GND between WAV Trigger and MIDI Breakout is made. The Tx of MIDI breakout is connecting to the Rx of WAV Trigger.
          The SD card is ready with sample WAV of “number” and wavtrigr.ini is installing. I used InitMaker application and check MIDI into “Sytem”. Nothing, the MIDI don’t work.
          The trigger pins work fine.

          • reply jamie@robertsonics.com ,

            Don’t really have enough info to be of much help. Have you numbered your tracks according to the MIDI Channel and Note Numbers that you’re sending? (Did you try the Piano or Mellotron samples which are already named correctly?) What MIDI keyboard/controller are you using?

            • reply Fred ,

              Hi Jamie. Thank you for your fast answer. My problem is solved. The SD card which I used was one 250Mo. it did not work correctly. I installed a 128Go SD card and that works perfectly!!
              For information, I used a Roland PC-180A keyboard.

          • reply KGalle ,

            Will you please provide a complete parts list for this project including the resistor wattages, etc.?

            • reply jamie@robertsonics.com ,

              Between the schematic and the pictures above, I believe everything is already detailed. I used 5%, 1/4W resistors.

            • reply Prakash ,

              Dear Mr.Jamie thanks for great project
              Anyone help me to make one rhythm machine with sampler and sequencing function like Rolland, with MIDI in and out ,i need to assign Two wave file for on midi key with different velocity (adjustable volume level ) .

              • reply Pieter ,

                Jamie, I have a bunch of these RB3 MIDI keytars and have been looking for something like WAV trigger for ages. I want to make a bunch of synths I can give my daughter’s school to encourage the kids to make music. Is there any way to get the electronic glue already built?

                • reply jamie@robertsonics.com ,

                  • reply Pieter ,

                    That is pretty yet it’s only the casing. Also I’d need a 3D printer. I’d assemble the electronics myself as you explained except, that’s not possible for me. Thank you in any case for your nice explanations.

                    • reply jamie@robertsonics.com ,

                      I was referring also to the small circuit board he designed for the MIDI interface components.

                • reply Bob ,

                  Great project! Got me thinking.
                  Are they Mellotron samples, by any chance 🙂

                  • reply Steve ,

                    Your schematic for the midi input circuit doesn’t match what you have on the breadboard.
                    It will work that way, but it doesn’t match …

                    • reply dian ,

                      I saw that to, the schemstics for the midi input and whats is on the breadboard does not match,
                      Anyway, i got one midi input board that does work fine, and it works great,
                      Sounds nice, triggers fine, very good work.
                      Dian from the Netherlands

                      • reply Watoo Watoo ,

                        • reply Ethan Collins ,

                          Hi Jamie, my panic code is not working. Here is what I am sending:
                          tx(0xb0) ; //channel mode messages channel 0
                          tx(0x7c) ; //all notes off
                          tx(0x00) ; //omni mode?

                          Any ideas what I am doing wrong?

                          All other MIDI code, including pitch bend is working. I am using latest v1.28 hex. I have not chosen “ignore all notes off” in init maker. Thanks.

                          • reply jamie@robertsonics.com ,

                            I did not implement official MIDI All Notes Off – probably should have, but the RB3 keyboard doesn’t send this. If you look at the article above, you’ll see that instead I used the “-” button, which sends the MIDI RealTime Stop command; Just a single byte: 0xfc.

                          • reply Ethan ,

                            Yessss! That worked!! Thanks for the quick response.
                            ” 0xfc.”

                            • reply Raulton ,

                              Hey Jamie,
                              I assume that so long as wav trigger is powered, i could use another midi controller? was thinking a yamaha reface cp or a bassstation 2 i already have in service. Thx!

                              • reply Raulton ,

                                Would actually love if it could be purchased from you plug and play…my solder technique is poor…my organ tech told me i wasn’t alllowed to touch a board anymore! 🙂

                                • reply Jamie ,

                                  Any MIDI Controller should work.

                                  I don’t provide hardware, except through SparkFun. I suggest you find a local maker/Arduino group and either enlist or pay someone to help you out.

                                • reply Seshu ,

                                  Hi how much is the cost of a rock band keyboard of 5 octave.

                                  • reply Samoth ,

                                    Hi Jamie, thanks so much for this amazing tutorial !
                                    I have a tsunami, hooked up a midi din tout the midi in pads, and a female jack to the stereo output, as shown on the sparkfun website.
                                    Will all the midi stuff described here work with the rockband keyboard on the Tsunami in the same way it does here?
                                    I don’t know much about midi mapping, and I’d love to get the same results as you do on the video. Are there differences I should be aware of for this tutorial to work on my Tsunami ?
                                    Thanks again, cheers from France !

                                    • reply Jamie ,

                                      Since the Tsunami includes the MIDI input circuit (opto-isolator) on board, you don’t need the external circuitry in this tutorial. Other than that, it should work the same. The Tsunami supports additional filename options that can assign MIDI notes to specific outputs (see the User Guide), but if you don’t use these, all the notes will be assigned to output 1.

                                    Leave a comment