Tool: Renoise Device Router

Just released this project:
http://code.google.com/p/renoise-router/

I have been using this in a live-set for about a month. Works pretty well.

I’d really like to get some more device config files, and general cross-platform testing, so I am very open to feedback, and I will help anyone who needs it with setting it up.

Thanks goes to Kieran Foster of Renoise support for his invaluable help with making midi control messages over OSC.

Description:
I wanted to use MIDI keyboards and joysticks to control a specific instrument on a specific track, so I made this device router.

I use it in a live set to allow me to play my devices with pre-made effects racks and instrument settings, along with sequenced and vocal tracks.

You must enable renoise’s OSC server (in settings.) Think of the included yml files as a base for your own devices. They are written in simple YAML, and should be pretty self-explanatory. Included are examples for basic midi keyboards, an XBOX classic controller (hooked to USB) and an XBOX360 guitar-hero controller (also connected to USB.) I have only tested this in Linux, but it should be cross-platform. It requires python YAML and pygame libraries. The devices are searched by the name as they show up in lists of midi input devices and joysticks by pygame. You can see the output if you run the router in a terminal (to get a list of available devices.)

1 Like

f**ing sweet man, ive been trying to get a way to use my xbox gamepad with renoise for donkeys!!! will be trying this when i get home:-)

Nice work, David. I’m glad I could help in some small way. Thanks for sharing this; I’m sure a lot of people will find it useful.

wow, really nice man. i will not be using this as this is currently way over my head, but it’s always great to see people making this kind of stuff.

What would make it easier to deal with?

I am trying to work out ideas for making yml files based on unknown devices, but it is sort of specific to the use-case.

I’d also like to make compiled packages (no dependencies) for mac and windows, but I don’t have a mac around, currently.

Any other suggestions?

Also, it should be noted that I intend it as a general Renoise OSC trigger, so it can do lots more then just send instrument+track messages. In my setup, it loads songs when you press midi buttons, it sends control messages, and turns joystick events into OSC messages.

hhhhmmmm, Have I done something wrong? ive installed Python Yaml, and Python Pygame, but when I run ./renoise_router.py I get this…

Config files:
.svn
text-base
Traceback (most recent call last):
File “./renoise_router.py”, line 454, in
dev_map, host, port = parse_yaml()
File “./renoise_router.py”, line 442, in parse_yaml
f = open(os.path.join(directory,device_type, fname),“r”)
IOError: [Errno 21] Is a directory: ‘./devices/.svn/text-base’

Ive enable the osc sever in renoise(The Osc.py works by the way).

Looks like you need the newest version. I realized after I put it in SVN that svn uses (hidden) dot directories.

You can grab the updated download here or do an svn update.

After this, in the command-line it will list the available config files, and list the midi/joystick devices you have attached. You can use my yml files as an example, just set “name” field to what shows up in list, and save it as whatever.yml in the right directory (midi/joystick.) Again, I am happy to help people with writing config files if I know what their system calls the device, and even help setup custom actions, like I am using, in python.

Thanks for the work youve been putting into this, and the help!!

sweet, it detects the gamepad, (Microsoft X-Box pad v2 (US)) , and ive managed to enable it, but could you tell me the format for adding the OSC messages?
for instance, if i wanted the Y button (which is being displayed as <Event(10-JoyButtonDown {‘joy’:0, ‘button’:4})>) to set bpm on a “Button Down” how would I add it to the config file?
/renoise/song/bpm(64) would be an example of the osc command id ike to use,(are we supposed to keep the argument in brackets?) not so sure where to put that in the config either…
oh and i was thinking, a threshold limiter(like a deadzone) on the sticks could be a good idea, on some games it helps as the sticks tend to hop around even when im not using them. Dont know if anyone else ever has that problem tho.

cheers:-)

ahh, upon reading through renoise_router.py, it seems it has to be coded into that, and not just dropped in the config file next to the event…not sure im able for that:-(

they are dropped into config file, in the sense that in the yml there is

10: button_down  
11: button_up  

These are function calls. It must all be done in code, because everybody is going to have different things they want their’s to do.

So, if you wanted to assign all the buttons to bpm presets, add this to ForkbombRenoiseDeviceRouter as a function:

  
 def joystick_bpm(self, event, device_id):  
 if event.button == 0:  
 self.osc('/renoise/song/bpm', 30)  
 elif event.button == 1:  
 self.osc('/renoise/song/bpm', 60)  
 elif event.button == 2:  
 self.osc('/renoise/song/bpm', 90)  
 elif event.button == 3:  
 self.osc('/renoise/song/bpm', 120)  
 else:  
 self.joystick_button_down(event, device_id)  
  

this makes buttons 1-4 trigger bpm presets, and all else get sent on normally as button events.

And make your xbox_classic.yml look like this:

  
name: Microsoft X-Box pad v2 (US)  
events:  
 7: axis_motion  
 9: hat_motion  
 10: bpm  
  

This means button-down will be handled by joystick_bpm function. button-up, in this case, will be ignored.

Good tip on the deadzone idea. I will think about this for the next release. I thought pygame did this already, but maybe not.

cheers man, i always wanted to learn python,(did some of the various tutorials and hello worlds) maybe some of this might sink in:-) Il have a go and see what I come up with:-)

These are awesome examples. I would really appreciate a short demo video type thing of what you accomplish with the joystick support?
Thanks for this!

Big ups! This looks sweet.