I received a lot of messages from TouchOSC
users on Windows systems asking how to use custom layouts with Pure Data
to translate OSC messages to MIDI. My answer was usually that you'd have to roll your own, using the example PD MIDI patches for the default layouts as a starting point, but that obviously didn't make a lot of people very happy as PD is probably not the most accessible tool to many.
So to make the process a little more painless I decided to make the little utility presented here to automatically generate a custom-tailored PD patch from a TouchOSC layout. The tool generates routes for all controls found in the layout (except for those using custom OSC messages) and (optionally) creates MIDI CC messages for each of them. Obviously the output is not going to look pretty as even hand-made PD patches tend to get messy quickly, but even if you are not interested in MIDI translation, using this tool definitely beats connecting hundreds of multi-toggle messages and gives you a quick, fully-mapped patch as a starting point for whatever it is you want to do today...
Alright, before you grab this, take note that this is probably not the most polished piece of code in this world, it is implemented in pure Java
so you need a Java runtime 1.5+ (which you already have if you are running the TouchOSC Editor) and that it creates the PD patch in the same directory as the input layout using the same name plus a .pd extension added.
The zip file contains a jar bundle which on most platforms can be launched by double-clicking: