Package: touchosc2midi
> a TouchOSC Bridge clone, aimed at linux, written in python.MotivationI wanted to have a TouchOSC Bridge running on a raspberrypi. After researching the options and running into several
deadends, I figured out, I need to write my own. Specifically this program aims to achieve the following:it works on linuxit works on ARMit doesn’t need the.touchosclayout-filesit can provide virtual midi ports, like the original TouchOSC Bridge fromhttp://hexler.net/software/touchoscit is open sourceit advertises the service viazeroconfit needs minimal configurationDependenciestouchosc2midiis built on top of these pip-installable packages:pyliblomido(needspython-rtmidiand/or(FIXME!)portmidi)zeroconfand without these, it wouldn’t be such an embarrassingly trivial program.Installation### Prerequisites
You will need a recent version ofpipandcythonpip install -U pip
pip install cython### From pypipip install touchosc2midi### From sourcegit clonehttps://github.com/velolala/touchosc2midicd touchosc2midi
pip install .pylibloandpython-rtmidineed some OS libraries installed (i.e.liblo-devandlibrtmidi-devDebian). Check outhttps://github.com/velolala/touchosc2midi/tree/master/docker/Dockerfileto see how to install from a plain Debian with python 2.7.Getting startedAfter installation you should have a thetouchosc2midiscript in your path. Start it withtouchosc2midiand open the “Midi Bridge” configuration dialog on your TouchOSC device. You should see an entry for your host. Click on your host and click “Done”. Now you should have midi in- and out-ports named “TouchOSC Bridge” that you can use with your client software.Midi ConfigurationThis section shows you, how to do more specific midi configurations.### BackendsSincetouchosc2midiusesmido, it can be configured with several backends (see:http://mido.readthedocs.org/en/latest/backends.htmlfor details).By default it tries to mimic the behavior of the originalTouchOSC Bridge(see:http://hexler.net/software/touchosc); that is: opening virtual in- and out-ports named “TouchOSC Bridge”. Therefore, it tries to use anrtmidibackend by default, since only this backend allows the creation of virtual midi ports.Unfortunately, it get’s more confusing, becausertmidiallows several API’s (e.g. ‘LINUX_ALSA’, ‘UNIX_JACK’).
The default fortouchosc2midiis to use thertmidibackend with the first available/implemented API.If you want to change the backend, the command:touchosc2midi list backendslists the available full backend strings that you can use for theMIDO_BACKEND=…environment variable.
To make use of another backend, calltouchosc2midilike this:MIDO_BACKEND=<backend string> touchosc2midi### Midi PortsBy defaulttouchosc2midiuses virtual ports for midi-in and midi-out. You can, however, connect midi-ports directly. The command:touchosc2midi list portslists all available ports with their ID and their port string. You can connect midi-in and midi-out ports either by ID or by their name string, e.g.:touchosc2midi –midi-in=1 –midi-out=”iConnectMIDI4+ MIDI 11”Please note, that it is currently not possible to mix virtual and direct midi ports (but I’d be happy to accept your PR for this!).OSC Configurationtouchosc2miditries to detect your main network interface for the network part automatically and you can expect this to work in most cases. You can, however, make it listen on a specific IP address:touchosc2midi –ip=192.168.0.53DockerThe git repository contains aDockerfile. To use it:cd dockerdocker build -t touchosc2midi:latest .Above builds a container with all OS dependencies andtouchosc2midiinstalled. Whenrun`ning, you will need to share the `/dev/snd/seqdevice and expose the OSC receiving port, e.g. like this:docker run -p 0.0.0.0:12101:12101/udp –device=/dev/snd/seq:/dev/snd/seq touchosc2midi:latestNote, that when using docker, thezeroconfservice announcement does not work, so you’ll have to configure your ip address manually on the touchOSC device.LicenseThis program is published under the MIT License. SeeLICENSEfor details.