Rockband Drumkit midi driver for linux with cymbal support. Driver midi per batteria rockband con supporto per i piatti.

Versione Italiana segue quella inglese.

English:   

So you’re a rockband fanatic and own one of those nice new rockband pro-drumkits with the added bonus of three cymbal pads. Suppose you’re also a free software user, like tinkering and are wondering whether you can use your new toy as an e-drumkit for midi recording purposes. Well guess what you can!

Now when I started my endeavor to get this working I came across a few solutions, the easiest was rerouting  joystick input to keyboard and using those in hydrogen, but that was not midi and didn’t have velocity. I eventually found a program here, this worked very well, but unfortunately did not support cymbals for the newer pro-drumkits and had a note mapping that was useless with Hydrogen. So I figured that seeing as I talked the talk of free-software it was high time to walk the walk! I pulled out my trusty C manual and started cursing and banging my head against the wall. Eventually, more due to the original author leaving his testing code in the source than to my hacking expertise (ok so I hadn’t written a line of C in over 10 years), I cracked it.

You can find the products of my labor on this sourceforge page. You’ll find both a standard tar.gz source package and a .deb. Instructions for compilation are in the readme file.

Usage:

Plug your wireless ps3 dongle in and type rbdrum2midi in a terminal (you may have to do this as root if you haven’t set up proper usb device privileges). This will create an ALSA midiport, start the jack audio server and Hydrogen,
in the connection window under the alsa tab connect “129:PS3 Joystick Client” to Hydrogen.
the midi channels are mapped as follows

kick pedal 1:     midi note 36
kick pedal 2:     midi note 42
red pad :     midi note 37
yellow pad:    midi note 38
yellow Cymbal:    midi note 41
blue pad:    midi note 39
blue Cymbal:    midi note 43
green pad:    midi note 40
green Cymbal:    midi note 45

This corresponds to the setup for the Hydrogen YamahaVintageKit.

Enjoy!!!

P.s. to fix the permissions problems create a file called 90-PS3-drumkit.rules in /etc/udev/rules.d/ containing:

SUBSYSTEM==”usb”, ATTR{idVendor}==”12ba”, ATTR{idProduct}==”0210″, GROUP=”audio”, MODE=”0664″

and make sure your user is a member of group “audio”

Sourceforge Project Page

Italiano:

Siete dei fieri possessori di strumenti di plastica per giochi ritmici, magari di una di quelle batterie per rockband 3 e vi chiede se fosse possibile usarle come delle vere e proprie batterie midi. Beh me lo chiedevo anch’io!

Per windows esistono delle ottime soluzioni ma se siete degli utilizzatori del pinguino, le soluzioni sono meno ovvie. Ne ho provate parecchie da quelle più semplici che constavano nel deviare il segnale joystick alla tastiere lette dalle tastiere midi virtuali e da hydrogen (ottima batteria elettronica open source), altre soluzioni per quanto buone avevano comunque dei limiti, o non registravano la forza d’impatto o comunque gli mancava il supporto dei piatti. Ho finalmente trovato questo programma a cui mancava solo il supporto dei piatti e una mappatura delle note midi che potesse essere utile in hydrogen. Beh … nonostante siano più di dieci anni che non scrivo una linea di codice in C ho ripescato il mio fido (e polveroserrimo) manuale e mi ci sono messo di buzzo buono. Parecchie craniate e improperi dopo, ne sono emerso vincitore! E non contento ho affrontato pure autotools e checkinstall per pacchettizare il programma in un targ.gz con il codice sorgente e un .deb pronto da installare che ho messo in in questa pagina sourceforge. Le istruzioni di compilazione e di utilizzo sono nel file README.

Utilizzo:

Attaccate il trasmettitore wireless usb della batteria al PC (funziona per certo quella per PS3, forse quella della Wii, per l’xbox credo serva un’adattatore), da terminale digitate:

rbdrum2midi

Questo creerà una porta midi con ALSA, fate partire il server jack con qjackctl, fate partire hydrogen e nella finestra delle connessioni selezionate il tab alsa e connettete la porta “129:PS3 Joystick Client” in uscita a hydrogen in ingresso.

La mappatura midi e configurata così:

kick pedal 1: midi note 36
kick pedal 2: midi note 42
red pad : midi note 37
yellow pad: midi note 38
yellow Cymbal: midi note 41
blue pad: midi note 39
blue Cymbal: midi note 43
green pad: midi note 40
green Cymbal: midi note 45

Che è configurata per adattarsi al meglio alla batteria hydrogen YamahaVintageKit.

Divertitetevi!!!

Ps. Se avete problemi di permessi usb, create un file chiamato 90-PS3-drumkit.rules in /etc/udev/rules.d/ contenente la riga seguente:

SUBSYSTEM==”usb”, ATTR{idVendor}==”12ba”, ATTR{idProduct}==”0210″, GROUP=”audio”, MODE=”0664″

Controllate che il vostro utente sia membro del gruppo audio e fate ripartire udev:

sudo services udev reload

Dovreste essere a posto.

Advertisements

22 Comments

  1. According to lsusb I have a Harmonix Music Drum Kit for Xbox 360, and I installed rbdrum2midi on Ubuntu Studio 12.04 via the deb file. When I run rbdrum2midi it simply states “Could not find/open the device.” I’m not a programmer, but is there anything I can provide or do to force it to recognize my device? I would love to be able to use it as a MIDI controller, even if it is in some sort of crippled state, lol.

    Reply

    1. Hi Chip, have you tried the new version (0.2), I put up recently, it should have the correct usb ids. in any case could you post what you get if write “lsusb” in a terminal once you’ve plugged the drumkit in.
      If I have the usb ids wrong it’s trivial to fix, it’s what happens if the irq messaging is wrong that could be problematic … 😉

      Reply

      1. Thanks for your quick reply, I didn’t even see the 0.2 version, I installed it and placed the permissions file in the correct place and restarted udev and it didn’t work at first, but I rebooted the whole computer and now when I run rbdrum2midi it reads “claimed interface” and shows up in Qjackctl now but no MIDI input is read when I connect it to Hydrogen. Just to test I hooked my piano to Hydrogen and it still reads MIDI input from there. Just FYI it reads in lsusb with:

        Bus 007 Device 007: ID 1bad:0003 Harmonix Music Drum Kit for Xbox 360

        Might it be mapped differently? There’s only four drumpads and a pedal for this. I’m willing to tinker with source to get it to work, but I’m not a programmer, the kids are waiting ever so patiently for me.

      2. Ok, so as I feared the PS3 X-Box and at this point probably Wii Drumkits have different signaling (insert series of violent unrepeatable swear-words here), which means going back to the drawing board …
        How deep do you want dive into this? I’m no programmer myself, but I could juggle enough C to add what I was after to the old code base. So I can point you in the right direction and implement the needed changes if you manage to do the necessary hardware investigation and debugging (I don’t have X-box hardware so I can’t).
        Here’s what you need to do:
        download the tar file from sourceforge and extract it. In the src folder open the main.c file with an editor and modify line 52 so it reads:

        static int verbose = 1;

        Now follow the compilation instructions, but don’t do the “make install” step just the make step as a normal user you don’t need to install it yet.
        BTW removing the version installed with the .deb might be a good idea.
        Now plug the drumkit in and run the newly built executable “./rbdrum2midi”. You should now see a column of obscure hex strings appearing on screen.
        Those are the messages sent by the Drumkit. These are the ones I got out of the PS3 kit:


        Empty
        0000087f 7f7f7f00 00000000 00000000 00000002 00020002 000200

        Kick 1
        00 00 00 00
        1000087f 7f7f7f00 00000000 00000000 00000002 00020002 000200

        Kick 2
        2000087f 7f7f7f00 00000000 00000000 00000002 00020002 000200

        Red
        VV
        210 00 00 00
        0404087f 7f7f7f00 00000000 d2000000 00000002 00020002 000200
        VV
        210 00 00 00
        0404087f 7f7f7f00 00000000 d2000000 00000002 00020002 000200
        VV
        210 00 00 00
        0404087f 7f7f7f00 00000000 d2000000 00000002 00020002 000200
        VV
        210 00 00 00
        0404087f 7f7f7f00 00000000 d2000000 00000002 00020002 000200
        VV
        210 00 00 00
        0404087f 7f7f7f00 00000000 d2000000 00000002 00020002 000200

        Yellow
        VV
        00 126 00 00
        0804087f 7f7f7f00 0000007e 00000000 00000002 00020002 000200
        VV
        00 126 00 00
        0804087f 7f7f7f00 0000007e 00000000 00000002 00020002 000200
        VV
        00 126 00 00
        0804087f 7f7f7f00 0000007e 00000000 00000002 00020002 000200
        VV
        00 126 00 00
        0804087f 7f7f7f00 0000007e 00000000 00000002 00020002 000200

        Yellow Cymbal
        VV
        00 168 00 00
        0808007f 7f7f7f00 000000a8 00000000 00000002 00020002 000200
        VV
        00 168 00 00
        0808007f 7f7f7f00 000000a8 00000000 00000002 00020002 000200
        VV
        00 168 00 00
        0808007f 7f7f7f00 000000a8 00000000 00000002 00020002 000200
        VV
        00 168 00 00
        0808007f 7f7f7f00 000000a8 00000000 00000002 00020002 000200
        VV
        00 168 00 00
        0808007f 7f7f7f00 000000a8 00000000 00000002 00020002 000200

        Blue
        VV
        00 00 42 00
        0104087f 7f7f7f00 00000000 00002a00 00000002 00020002 000200
        VV
        00 00 42 00
        0104087f 7f7f7f00 00000000 00002a00 00000002 00020002 000200
        VV
        00 00 42 00
        0104087f 7f7f7f00 00000000 00002a00 00000002 00020002 000200
        VV
        00 00 42 00
        0104087f 7f7f7f00 00000000 00002a00 00000002 00020002 000200

        Blue Cymbal
        VV
        00 00 84 00
        0108047f 7f7f7f00 00000000 00005400 00000002 00020002 000200
        VV
        00 00 84 00
        0108047f 7f7f7f00 00000000 00005400 00000002 00020002 000200
        VV
        00 00 84 00
        0108047f 7f7f7f00 00000000 00005400 00000002 00020002 000200
        VV
        00 00 84 00
        0108047f 7f7f7f00 00000000 00005400 00000002 00020002 000200

        Green
        VV
        00 00 00 42
        0204087f 7f7f7f00 00000000 002a0000 00000002 00020002 000200
        VV
        00 00 00 42
        0204087f 7f7f7f00 00000000 002a0000 00000002 00020002 000200
        VV
        00 00 00 42
        0204087f 7f7f7f00 00000000 002a0000 00000002 00020002 000200
        VV
        00 00 00 42
        0204087f 7f7f7f00 00000000 002a0000 00000002 00020002 000200
        VV
        00 00 00 42
        0204087f 7f7f7f00 00000000 002a0000 00000002 00020002 000200

        Green Cymbal
        VV
        00 00 00 168
        0208087f 7f7f7f00 00000000 00a80000 00000002 00020002 000200
        VV
        00 00 00 168
        0208087f 7f7f7f00 00000000 00a80000 00000002 00020002 000200
        VV
        00 00 00 168
        0208087f 7f7f7f00 00000000 00a80000 00000002 00020002 000200
        VV
        00 00 00 168
        0208087f 7f7f7f00 00000000 00a80000 00000002 00020002 000200

        Once you send me something like this I can fix the code (or you could try yourself if you like), but you’ll have to do the testing cause I dont have an x-box kit. Bare in mind that the debug code was written specifically for the PS3 kits so it may not work as advertised with the x-box one. In that case we’ll have to think how to fix that too.

        Best of luck!

  2. I set some time today to work on it, but I can’t seem to configure it due to missing dependency, alsa, which I have installed but it can’t find it. This is a common problem I have when trying to compile software, but I never can figure out how to work around it.

    Reply

      1. As always, thanks for the tip, I installed it and was able to complete the ./configure, but now I’m unable to “make” the program. It exits with a lot of errors about undefined reference to ‘libusb_ . . .

      2. go to the src directory and execute this line:

        gcc -Wall -g -O2 -o rbdrum2midi main.o -I/usr/include/ -g -O2 -lusb-1.0 -lasound

        Does this work?
        They’ve changed some stuff in 12.04 … I’m not good enough to know what or why, but something in how gcc takes its linking instructions changed … This seemed to work on my 12.04 machine.

      3. Okay, I’ve finally got it to work and I get nothing. This is what happens:

        airlynx@Airlynx-Ubuntu:~/Desktop/rbdrum2midi-0.2/src$ ./rbdrum2midi
        claimed interface
        Setting up alsa
        client:port = 128:0
        Returning 1

  3. This is a great program! I’ve really enjoyed learning drums on my rockband kit, and the latency is not noticeable.

    I’ve made some patches/changes to the source, most notably adding options to select what midi message is assigned to each drum and support for xbox rockband 1 kits. I posted it on the sourceforge page in the discussion section. I can email it to you as well.

    Reply

  4. curious if there is any way to get the unit that ships with 4 pads and one pedal to make the kick drum pedal operate as a hi hat controller? with this rig under windows ages ago I got it to work with (forget the drum sampler package but im sure you all know it) and a similar project for windows. I’m not terribly familiar with hydrogen and as a one man band drums have always been my weakness. But I figure since I found this kit in the trash to begin with and im not able to afford to get the higher end model (couldnt find any on kijiji used either) I’d like to be able to toggle back and forth between using the pedal as a kick with two pads each with a different snare sound, one pad with a hihat (combined with the controller if possible) and another pad as a crash. When I set it up in windows I was able to use the pedal to actually make each pad make two different sounds so I was able to do a snare with springs and a snare rimshot based on the pedal, and two cymbals on one, hihat on another and kick and tom on the remaining pad. It was an ugly hack, but since I dont play the drums it wasn’t hard to pick up. I can’t remember if it was an app similar to yours that I used or if it was built into glovepie or not, my memory is not so good – but i’d love to get that functionality now. Is this functionality inherent to hydrogen in some way? Right now i’m hunting down a note/drum map just to get things tweaked a little bit more to my liking but i’d love to figure out how to get the pedal working so I can flip between modes.

    Next question, you mentioned velocity, I know little about rockband hardware since I found it in the trash, nor do I know much about hydrogen’s abilities – but do the pads support any degree of velocity? Is hackery required in hydrogen to get that working (if it exists?)

    Thanks so much for this project, it worked plug and play for me. I was worried I was going to have to get a proper midi drumkit or play the drums on my weighted key midi piano (not ideal) or some other hack since my programming is limited to debugging and minor modifications, the old adage to the artist and the blank page, I need more than a dot on the canvas to make anything useful = ) Thanks again, and more info would be greatly appreciated. — G

    Reply

    1. Everything is possible, but a lot depends on the drumkit you have.
      I found out that rockband1 kits don’t have velocity, while I think RB2 and 3 and the pro kit do. Personally I use the second pedal on the rb3 kit as an open-hat/hi-hat controller. I don’t know if you can add a pedal to RB1 kits, is there a second mini-jack plug?
      Don’t worry about your coding ability, it’s probably better than mine, after all I got the code off another project and twisted its arm until it did what I wanted. Fortunately other more knowledgeable people joined the game and lent a hand.

      If you need any help and advice on this just post in the forum on the sourceforge project page. We may even be able to hammer in a few lines to get it to do what you need, or better still show you where to put them.
      I’m glad you found the project useful!

      Reply

  5. I have done more research, I remember now more about my windows experience – I have the same kit you do I believe (1bad:0003) so no velocity, but i’m not sure if I got the pedal as a modifier function working in the windows application or if it was a function as maybe a midi learn in toontrack ez (I remembed what I was running after going through some old files) … I can’t find anything in hydrogen so far to allow for that kind of functionality but I bet its in there somewhere … I’m also going to go through the source of the windows driver and see if there was some useful way they did it in there, perhaps it converted from a note to a control in the little gui it came with. I got this set of rb drums in trash (I might have said that) and I was looking at how much it would cost to add cymbals – $160 minimum used from what I could see, and that doesn’t include a second foot pedal, it just adds clamp on cymbals that use a seperate usb input from what I could tell. Anyways, I will keep hunting and switch to the sourceforge page. Thanks again for all the good work.

    Reply

  6. All the PS3 drumkits have the same usb id, so unfortunately that doesn’t help much … But if you check on the back of the kit you should see a number of mini-jacks, the RB3 pro kit has 2 vertical jacks for pedals and three horizontal ones for cymbals. I think RB2 kit has the same, but I don’t know about the RB1 kit.
    Are you using the 0.3 version of the program? Do you use the -rb1p option? If you do you have an rb1 kit and we’d have to modify the code to get the pedal working as a switch (it’s in the program not hydrogen).
    On the other hand if you’re using a RB3/RB2 kit you can try and plug your pedal into the second pedal jack and start the program with the -phat option.
    I don’t know about cymbals, but building an RB pedal is easy, just get a magnet switch (the kind used for house alarms) and attach it to a cheap drum pedal and you’re done, if you check the rockband game forum there should be quite a few examples.
    Glad the program is working for you!

    Reply

  7. i’ve been looking at a few different options and tomorrow I will look at the source of the windows driver and compare it to see if its maybe from the same origins and fattened out. Pretty sure I have an rb1 kit – I use the rb1x option. I’m using svn or git, I cant remember which but it is whatever development version is on the site. I don’t want to hassle you to make this work, I can probably figure it out when I have more time and come up with a patch. I could have sworn that I had velocity when I was using it with windows but I could be confusing it with when I was using my midi piano. I found I got really good results playing with the controller built in since i’m not a drummer at heart as well. I think i’m also going to order a kit (there are a few available) that let you connect switch or rocker pedals and connect to midi (or usb) that way I could use the same unit perhaps with mididings to do the hi hat stop and switch – there is a script on pastebin I found on google to do it with edrum unit and it looks pretty hackable. Just not sure about the hydrogen end, I assume there is some cv magic in there somewhere and its just not obvious to me yet. For me having a functional hi hat is critical enough to consider upgrading the rockband kit if I can find one used, sounds like the 3 pro has everything I would need and more. I love how thin hydrogen is and how good the samples sound for the heft of the sample files. Anyways, I will see what I can put together and switch to sf after I get a bit less busy. Thanks for the replies

    Reply

    1. Hi greg!
      Great to see your interest (I’m the co-developer on this project). Just FYI I’ve just tested the new bass pedal functionality and it works on rockband 1 sets. To get it build the latest version from the dev branch in git. Run it using the command
      ./rbdrum2midi -htp ob -htdm y -hto 46 -htc 42 -ob 44
      This will set the yellow pad to be the hihat and the pedal controls if it plays an open or closed hat. The last option and argument are to make the pedal play the hat closing sample when you press it. These numbers are for GM, with the hydrogen kit you might need different midi notes.

      Go ahead and post a discussion topic on sourceforge and I’ll help you through any problems that pop up.

      Reply

  8. (still havent switched over to sf sorry will as soon as I get going.

    Couple questions, and I assume here, with the last post – that this does in fact convert the functionality of the bass drum pedal to a hi hat pedal (and i’d move green pad to be bassdrum.

    This effort is absolutely fantastic – I was waffling a bit on my new music studio to be upstairs in my bungaloo and am teetering between leaving beloved slackware and either going back to winblows with a heavy jack reworking and installation of mingw etc. but at least have precious reaper working but im close to that point anyways right now and just need to get the rt kernel going a bit better (my fault as is most on slackware) and convince the more recent carla-gits to work. I achieved the virtually impossible at one time even with the SDK and got wine-rt to work with wineasio (albeit in 32bit only) and in reaper with directsound I can get *ALL* of my plugins to load including the extremely vital native soundtoys that are integral to my sound. And on windows the hihat pedal works as a switch potentially for all pads, allowing for african kits and more bizarre sounds to work on the pads albeit with the slow refresh time inherent to the physical pads and the lack of transitioning logic that exists in (ugh) toontrack but not in something as clean and simple as hydrogen. Right now, after listening to some really good old fugazi drum solos and segoes I was reminded just how important it is in much of my favorite music (im not into punk, i’m an alt-country type as well as some electronic) the effect of hitting those pads really really hard (on a real usually cheap kit) is only paralleled in difficulty to faux with the beauty that happens with high end tube based and power supplied compression units to get that unreproduceable compression-distortion and character (not to mention the whole issue of doing guitar distortion without elaborate convolvors,etc) … however, I just got something that might come in very handy (on its way) which is a midi vco pedal I need for guitar/bass recording and I can possibly simulate the velocity enough for what I need to do just using the pedal since as far as I know contrary to my fuzzy memory I dont think there is any potential even with a rewire or modification of making those pads pump out velocity and their recoil time makes things like elaborate snares, I love marching band style synchronized snares in a few contexts and its going to require some midi lv2 plugins or serious futzing around or some winblows software to make THAT work. As a primarily guitarist, learned first on bass and then picked up rhodes technique piano (and years doing electronica) I dont really listen to the drums and im terrible for playing on stage because I speed up without the clicktrack i’m used to, drums just get tuned out. But they are a core part and the first thing many many people in the potential audience listen to and as much as im not going to ever learn to be an ace drummer, homeless whenever my girlfriend dumps me or a friend is in town and the pain in the ass that is a full drum kit – I want to get the absolute best out of this (free) harmonix set. I am considering buying the velocity sensitive cymbals addon that is on a seperate USB – now theres a pickle for you, would I have to loan it to you by post in order to get something like that supported? I would probably actually use a cymbal as a snare drum just to get the velocity. I unfortunately have a big garden and this time of year i’m penniless and then a vacuum tube got clipped top off the other day (and other misfortune) so I had a busy week and a miserable visa statement in order to just get what I need for my recording room, sans bass guitar and anything that can faithfully reproduce via novel midi (plastic toy grade) midi options woodwind, brass and string (bowed) instruments. So that is fall’s project. I may end up moving to kxstudio (hate hate debian) in order to get a setup with ardour3 capable of running my library of costly VST’s that have long shaped my sound, or if I can finally figure out what the problem is (and its bleeding edge git right now with a new bridge system that is quite up in the air and actively working on such that it will not be working right on a slackware multilib system until its in its next period of accepting bugfix requests etc. Love the work thats happening on that though. I was hoping to try your driver and the kit with toontrack but it just doesnt like wine-rt and I havent figured out why so I need to look into that a bit further. I am curious how it compares to hydrogen and anything I have that I made using this kit with the winblows driver with toontrack nashville.

    Few questions that I think might be asked by others, you just branched and im not familiar with git – i’m disabled and have a certain amount of trouble understanding the dialect of some documentation writers althogh I suspect most people are the same way regardless. How would I go about telling git to fetch me a new copy of the dev branch, my git tree informed me it exists but I cant seem to grep how to actually pull it. Its just never come up before!

    Next point/question, if you have added support (THANK YOU!!! I was terrified of doing it myself) for that functionality, could it be easily expanded for a mode that could use the pedal like I mentioned, so for other pads than hihat just swap between two samples? I found this functionality to greatly expand the abilities of such a humble yet useful drumkit.

    Lastly, does hydrogen in the gm kit use 2,3 or 4 samples to do the hihat, I know there are open and closed sounds, but are there also algorithms, scripts or samples that make some effort at the sound of (think disco) the opening and closing itself because some of the sounds that i use the most come out of that and im tired of finding random drummers in my constantly evolving student neighborhood and asking if I can spend some time with their hi hat and snare drum a laptop and a couple not really suitable microphones. If you managed to make hydrogen give me a pretty passable hihat I officially owe you a cookie. Thanks for the work especially since i’m busy this time of year and kind of cramming to get this music room set up and a significant portion of the hardware has either disappeared or quit working (like my monitor) and I want to be set up in the first week of june at the latest. Perhaps I am going to end up running a windows box and a linux box with jacknet and some kludge and go that route, I bought a delta 410 one day and got home and opened the box and it had a delta 44 in it and got zero support from the store on the subject and ever since have had to deal with asio only allowing one card to be bound (in reaper) and in linux I can have as many midi cards in the jack stack as I want from whatever cards. Not so in windows and I wish now I had gone to extreme measures to get the delta 410 that I *(((*(*ing paid for. And I might mention, my fast-track pro as great as it is came complete with no warranty and a broken pot that affects all sounds in and out. joy.

    Thanks, looking forward to trying this out!

    G

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s