3 comments

Rockband 2 Drum Instrument for Linux

by Javantea
Dec 1, 2008 - March 17, 2009
Released (GPLv2): July 6, 2009
Updated: Dec 29, 2012

Rockband 2 Drum version 0.2 [sig]
Rockband 2 Drum version 0.1a [sig]

INTRODUCTION

The Rockband 2 Drum controller is a wireless velocity sensitive percussive instrument that is cheaper than its competitors (~$90 retail) and arguably as good as many medium quality drum controllers. With this software and a Linux computer, you can use the controller to compose your own music in real time.

I plan to do an analysis of the drum quality, but for now please download the midi files I have created to see for yourself if the below midi files generated by an impromptu outdoor session make sense.

METHOD

libusb is a cross-platform userland driver abstraction library that uses kernel hooks to allow drivers to be written that do not require actual kernel drivers. In this way I able to create a driver without modifying your kernel with experimental code.

The following libusb functions are used to make this possible:
libusb_submit_transfer
libusb_alloc_transfer
libusb_fill_interrupt_transfer
libusb_detach_kernel_driver
libusb_claim_interface
I plan to explain how they are used in a future version.

ALSA is a Linux platform specific driver library for audio (PCM and MIDI). My program becomes a client that emulates a MIDI sequencer.

The following ALSA functions are used to make this possible:
snd_seq_open
snd_seq_set_client_name
snd_seq_create_simple_port
snd_seq_client_id
snd_seq_queue_tempo_*
snd_seq_ev_*
I plan to explain how they are used in a future version.

Instead of a while loop or some other high latency, low performance method, I found that it is possible to use libusb to call events when the usb device sends them. This makes my system as low latency as a userland system can get without setting up a real-time kernel (although I suspect that it will work if you are using a real-time kernel). Let me know if you'd like to test this or improve upon it.

USAGE

$ make
$ cat /proc/usb/devices
$ ls -l /dev/usbdev*
$ ./rbdrum2 &
$ sleep 2
$ timidity -iA -B2,8 -Os -EFreverb=0 &
$ sleep 2
$ aconnect -lio
$ aconnect 128:0 129:0

Linux MIDI is an interesting beast, I wish you the best of luck.

You are welcome to e-mail me for free support at my discretion. I am also available for paid support upon request.









Permalink

Comments: 3

Leave a reply »

 
  • 91Chang

    I must say you have very interesting content here.
    Your page should go viral. You need initial traffic only.
    How to get it? Search for: Miftolo's tools go viral

     
     
  • XRumerTest

    Hello. And Bye.

     
     
  • SaulX

    I have noticed that your website needs some fresh posts.
    Writing manually takes a lot of time, but there is tool for this time consuming
    task, search for: Wrastain's tools for content

     
     
  • Leave a Reply
    Your gravatar
    Your Name