MIDI Learn Layout (v11): Midi OSC Bridge & Monitor

Tech Specs

Category: TouchOsc Templates

Format: iPad

Special Instructions

Instructions

  1. Set up the connections

Open the layout in TouchOSC. Open the connections window (chain-link icon). Enable a MIDI connection for your device or software. If you’re using OSC, enable an OSC connection. Set the host IP, the send port, and the Receive port to match the other program. Press Play (?). The scripts only run in play mode.

  1. Using the controls

Use the Page 1, 2 and 3 buttons to switch pages. Drag faders and knobs to send their MIDI. On Page 3 you can read each knob’s CC under it.

  1. Learn a MIDI CC

Turn Learn on. Touch a control. The status line says it’s armed. Move a knob or fader on your MIDI device. The status line confirms what was learned. Turn Learn off.

  1. Learn an OSC address Do the same, but send an OSC message instead of moving a MIDI control. To test, run python3 send_osc_test.py 127.0.0.1 8000 /test/fader1 0.5, using your Receive port in place of 8000.

  2. Choose a bridge direction

Tap Bridge until the label shows the mode you want. For strictly one-way traffic, use OSC>MIDI or MIDI>OSC.

  1. Reset Tap Reset to clear all learned mappings.

  2. Save your work Save the layout in the editor, or your learned mappings and Bridge mode won’t persist.

Optional: photo background Run tosc_photo_bg.py on the layout:

python3 tosc_photo_bg.py photo.jpg midi_learn_v11.tosc

It rebuilds the photo from boxes. The default mode uses fewer boxes so TouchOSC stays quick. Lower --cols and --palette for more speed, or raise them for more detail.

Quick troubleshooting

Nothing responds: check you’re in play mode and the connection is enabled. OSC not arriving: the status line should show it. If it doesn’t, check the Receive port and IP. OSC shows (ignored): the Bridge mode is MIDI>OSC or Off, so tap Bridge to change it. A control doesn’t move: it may not be learned to that CC. Fader 1 listens to CC 1 and fader 2 to CC 2 by default.

Layout

The document is 1000 × 690. A top bar stays visible on every page. The top bar has Learn, a status line, Reset, Bridge, and the page buttons Page 1, Page 2 and Page 3. Pages 1 and 2 hold 8 faders each, 16 in total, named f1 to f16. Page 3 holds 16 radial knobs in two rows of 8, named k1 to k16. Each shows its live value from 0 to 127 in the centre and its CC number underneath. Every control shifts from a dim colour to a bright one as it moves.

Default MIDI mapping (channel 1)

Controls Sends Faders f1–f16 14-bit CC: MSB on CC 1–16 and LSB on CC 33–48 Radials k1–k16 7-bit CC 49–64

Learn

With Learn on, touching a control arms it. The next incoming MIDI CC or OSC message is bound to it. A MIDI CC binds that CC and channel. For faders, the 14-bit pairing is automatic: CC 0–31 is treated as the MSB with its LSB 32 higher, CC 32–63 as the LSB, and CC 64 and above as plain 7-bit. An OSC message binds its address. A float is read as 0 to 1 and an integer as 0 to 127. A control can hold both a MIDI mapping and an OSC address. Learn each by arming the control again. Learned mappings are stored in each control’s tag.

Bridge modes

Each tap on Bridge moves to the next mode:

Mode Behaviour Both (green) MIDI becomes OSC and OSC becomes MIDI, with an echo guard that ignores a bounced-back message for about 150 ms OSC>MIDI (blue) OSC in becomes MIDI out. Nothing is sent out over OSC MIDI>OSC (orange) MIDI in becomes OSC out. Incoming OSC is ignored Off (grey) MIDI only

OSC addresses used by the bridge

/midi/cc/[HTML_REMOVED]/[HTML_REMOVED] as a float from 0 to 1 /midi/cc14/[HTML_REMOVED]/[HTML_REMOVED] as a float from 0 to 1, which sends the MSB and the LSB 32 higher /midi/note/[HTML_REMOVED]/[HTML_REMOVED] as velocity from 0 to 1, with 0 meaning note off /midi/pitchbend/[HTML_REMOVED] as a float from 0 to 1 /midi/pc/[HTML_REMOVED] as the program number

When you move a control

It sends its MIDI. If the Bridge mode allows OSC out, it also sends its /midi/... address and any OSC address you’ve learned for it. Controls send only while you’re touching them. A value moved by incoming data doesn’t echo back out.

Status line

Incoming MIDI shows as MIDI: CC 7 ch1 = 64, and incoming OSC as OSC: /path 0.5. When a message moves a learned control, it adds -> f1 or the control’s name. In a mode that ignores OSC, it shows (ignored).

Reset Puts every control back to its default mapping and clears any learned OSC addresses.