3 title: Generic MIDI Binding Maps
8 <a href="/using-control-surfaces/generic-midi/midi-learn/"><dfn>MIDI learning</dfn></a>
9 for more or less any control. This was a nice feature that quite a few other
10 DAWs are providing by now, but it didn't allow Ardour to work "out of the
11 box" with sensible defaults for existing commercial MIDI
12 controllers. In Ardour 3 and later versions, we have augmented the
13 MIDI learn feature with the ability to load a <dfn>MIDI binding map</dfn>
14 for a given controller, which can set up an arbitrary number of physical
15 controls with anything inside Ardour that can be controlled.
18 Currently (August 2016), we have presets for the following devices/modes:
24 <li>Behringer BCF2000</li>
25 <li>Behringer BCF2000 (Mackie Emulation mode; better to use
26 Ardour's actual Mackie Control Protocol support)</li>
27 <li>Behringer DDX3216</li>
28 <li>Korg nanoKONTROL (2 layouts)</li>
29 <li>Korg nanoKONTROL 2 (2 layouts)</li>
31 <li>M-Audio Axiom 25 (2 layouts)</li>
32 <li>M-Audio Axiom 61</li>
33 <li>M-Audio Oxygen 49</li>
34 <li>M-Audio Oxygen 61v3</li>
35 <li>M-Audio Oxygen 25</li>
36 <li>M-Audio Oxygen 8v2</li>
37 <li>Novation Impulse 49</li>
38 <li>Novation Impulse 61</li>
39 <li>Novation LaunchControl XL</li>
40 <li>Novation LaunchKey 25</li>
42 <li>Roland V Studio 20</li>
45 At this time, new binding maps need to be created with a text editor.
47 MIDI binding maps are accessible by double-clicking <kbd class="menu">Edit
48 > Preferences > Control Surfaces > Generic MIDI</kbd>. Ardour will
49 retain your selection after you choose one.
52 <h2>Creating new MIDI maps</h2>
53 <h3>The Basic Concept</h3>
55 Since the beginning of time (well, sometime early in the 2.X series),
56 Ardour has had the concept of identifying each track and bus with a
57 <dfn>remote control ID</dfn>. This ID uniquely identifies a track or bus
58 so that when messages arrive from elsewhere via MIDI or OSC , we can determine
59 which track or bus they are intended to control. See
61 href="/working-with-tracks/controlling-track-ordering/track-ordering-and-remote-control-ids/">
62 remote control IDs</a> for more information.
63 You just need to know that there is a "first track" and its remote control
66 <h3>Getting Started</h3>
68 MIDI bindings are stored in files with the suffix ".map" attached to their
69 name. The minimal content looks like this:
72 <?xml version="1.0" encoding="UTF-8"?>
73 <ArdourMIDIBindings version="1.0.0" name="The name of this set of
75 </ArdourMIDIBindings>
78 So, to start, create a file with that as the initial contents.
81 On OS X, Ardour loads midi maps from its binary-bundle folder in
82 <code>Ardour-<version>/midi_maps/</code> and checks
83 various other locations as well (defined by the ARDOUR_MIDIMAPS_PATH
84 environment variable). On GNU/Linux the easiest is to save the file to
85 <code>~/.config/ardour3/midi_maps/</code>.
88 <h3>Finding out what your MIDI control surface sends</h3>
90 This is the most complex part of the job, but its still not very hard.
91 You need to connect the control surface to an application that will show
92 you the information that the device sends each time you modify a knob,
93 slider, button etc. There are a variety of such applications (notably
94 <code>gmidimon</code> and <code>kmidimon</code>, but you can actually use
95 Ardour for this if you want. Start Ardour in a terminal window, connect
96 MIDI ports up, and in the Preferences window, enable "Trace Input" on the
97 relevant MIDI port. A full trace of the MIDI data received will show up in
98 the terminal window. (Note: in Ardour3, you get a dedicated, custom dialog
99 for this kind of tracing.)
101 <h3>Types of Bindings</h3>
103 There are two basic kinds of bindings you can make between a MIDI message
104 and something inside Ardour. The first is a binding to a specific parameter
105 of a track or bus. The second is a binding to a function that will change
106 Ardour's state in some way.
108 <h4>Binding to Track/Bus controls</h4>
110 A track/bus binding has one of two basic structures
113 <Binding <em>msg specification</em> uri="<em>... control address ...</em>"/>
114 <Binding <em>msg specification</em> function="<em>... function name ...</em>"/>
117 <h4>Message specifications</h4>
119 You can create a binding for either 3 types of channel messages, or for a
120 system exclusive ("sysex") message. A channel message specification looks
124 <Binding channel="1" ctl="13" ....
127 This defines a binding for a MIDI Continuous Controller message involving
128 controller 13, arriving on channel 1. There are 16 MIDI channels, numbered
129 1 to 16. Where the example above says <code>ctl</code>, you can alternatively
130 use <code>note</code> (to create binding for a Note On message) or
131 <code>pgm</code> (to create a binding for a Program Change message).
134 As of Ardour 4.2, <code>enc-r</code>, <code>enc-l</code>, <code>enc-2</code> and
135 <code>enc-b</code> may be used for surfaces that have encoders that send
136 offsets rather than values. These accept Continuous Controller messages
137 but treat them as offsets. These are good for banked controls as they are
138 always at the right spot to start adjusting. (
139 <a href="/using-control-surfaces/generic-midi/working-with-encoders/">
140 Learn more about working with encoders
144 You can also bind sysex messages:
147 <Binding sysex="f0 0 0 e 9 0 5b f7" ....
148 <Binding sysex="f0 7f 0 6 7 f7" ....
151 The string after the <code>sysex=</code> part is the sequence of MIDI bytes,
152 as hexadecimal values, that make up the sysex message.
155 Finally, you can bind a totally arbitrary MIDI message:</p>
157 <Binding msg="f0 0 0 e 9 0 5b f7" ....
158 <Binding msg="80 60 40" ....
161 The string after the <code>msg=</code> part is the sequence of MIDI bytes, as
162 hexadecimal values, that make up the message you want to bind. Using this is
163 slightly less efficient than the other variants shown above, but is useful for
164 some oddly designed control devices.
168 As of Ardour 4.6 it is possible to use multi-event MIDI strings such as
169 two event CC messages, RPN or NRPN.
173 The <code>sysex=</code> and <code>msg=</code> bindings will only work with
174 <code>function=</code> or <code>action=</code> control addresses. They
175 will <em>not</em> work with the <code>uri=</code> control addresses.
176 Controls used with <code>uri=</code> require a <em>Value</em> which is
177 only available in a known place with channel mode MIDI events.
180 <h4>Control address</h4>
182 A <dfn>control address</dfn> defines what the binding will actually control.
183 There are quite a few different things that can be specified here:
185 <dl class="wide-table">
187 <dd>the gain control ("fader") for the track/bus</dd>
189 <dd>the trim control for the track/bus (new in 4.1)</dd>
191 <dd>a toggleable control for solo (and listen) of the track/bus</dd>
193 <dd>a toggleable control to mute/unmute the track/bus</dd>
194 <dt>/route/recenable</dt>
195 <dd>a toggleable control to record-enable the track</dd>
196 <dt>/route/panwidth</dt>
197 <dd>interpreted by the track/bus panner, should control image "width"</dd>
198 <dt>/route/pandirection</dt>
199 <dd>interpreted by the track/bus panner, should control image "direction"</dd>
200 <dt>/route/plugin/parameter</dt>
201 <dd>the Mth parameter of the Nth plugin of a track/bus
203 <dt>/route/send/gain</dt>
204 <dd>the gain control ("fader") of the Nth send of a track/bus</dd>
206 <p>Each of the specifications needs an address, which takes various forms too. For track-level controls (solo/gain/mute/recenable), the address is one the following:</p>
207 <dl class="wide-table">
208 <dt>a number, eg. "1"
210 <dd>identifies a track or bus by its remote control ID
212 <dt>B, followed by a number
214 <dd>identifies a track or bus by its remote control ID within the current bank (see below for more on banks)
216 <dt>S, followed by a number
218 <dd>identifies a selected track in order they have been selected, S1 should be the same track as the Editor Mixer
220 <dt>one or more words
222 <dd>identifies a track or bus by its name
226 For send/insert/plugin controls, the address consists of a track/bus
227 address (as just described) followed by a number identifying the plugin/send
228 (starting from 1). For plugin parameters, there is an additional third
229 component: a number identifying the plugin parameter number (starting from
233 One additional feature: for solo and mute bindings, you can also add
234 <code>momentary="yes"</code> after the control address. This is useful
235 primarily for NoteOn bindings — when Ardour gets the NoteOn it
236 will solo or mute the targetted track or bus, but then when a NoteOff
237 arrives, it will un-solo or un-mute it.
240 <h4>Bindings to Ardour "functions"</h4>
242 Rather than binding to a specific track/bus control, it may be useful to
243 have a MIDI controller able to alter some part of Ardour's state. A
244 binding definition that does this looks like this:
247 <Binding channel="1" note="13" function="transport-roll"/>
250 In this case, a NoteOn message for note number 13 (on channel 1) will
251 start the transport rolling. The following function names are available:
253 <dl class="narrower-table">
255 <code>transport-stop</code>
257 <dd>stop the transport
260 <code>transport-roll</code>
262 <dd>start the transport "rolling"
265 <code>transport-zero</code>
267 <dd>move the playhead to the zero position
270 <code>transport-start</code>
272 <dd>move the playhead to the start marker
275 <code>transport-end</code>
277 <dd>move the playhead to the end marker
280 <code>loop-toggle</code>
282 <dd>turn on loop playback
285 <code>rec-enable</code>
287 <dd>enable the global record button
290 <code>rec-disable</code>
292 <dd>disable the global record button
295 <code>next-bank</code>
297 <dd>Move track/bus mapping to the next bank (see Banks below)
300 <code>prev-bank</code>
302 <dd>Move track/bus mapping to the previous bank (see Banks below)
306 <h4>Binding to Ardour "actions"</h4>
308 You can also bind a sysex or arbitrary message to any of the items
309 that occur in Ardour's main menu (and its submenus). The <a
310 href="/appendix/menu-actions-list/">
311 list of actions</a> shows all available values of <em>action-name</em>.
313 To create a binding between an arbitrary MIDI message (we'll use a
314 note-off on channel 1 of MIDI note 60 (hex) with release velocity
315 40 (hex)), the binding file would contain:
318 <Binding msg="80 60 40" action="Editor/temporal-zoom-in"/>
321 The general rule, when taken an item from the keybindings file and
322 using it in a MIDI binding is to simply strip the
323 <code><Action></code> prefix of the second field in the
324 keybinding definition.
327 <h3>Banks and Banking</h3>
329 Because many modern control surfaces offer per-track/bus controls
330 for far fewer tracks & busses than many users want to control,
331 Ardour offers the relatively common place concept of <dfn>banks</dfn>. Banks
332 allow you to control any number of tracks and/or busses easily,
333 regardless of how many faders/knobs etc. your control surface has.<br />
334 To use banking, the control addresses must be specified using the
335 <dfn>bank relative</dfn> format mentioned above ("B1" to identify
336 the first track of a bank of tracks, rather than "1" to identify
340 One very important extra piece of information is required to use
341 banking: an extra line near the start of the list of bindings
342 that specifies how many tracks/busses to use per bank. If the
343 device has 8 faders, then 8 would be a sensible value to use for
344 this. The line looks like this:</p>
346 <DeviceInfo bank-size="8"/>
349 In addition, you probably want to ensure that you bind something
350 on the control surface to the <code>next-bank</code> and
351 <code>prev-bank</code> functions, otherwise you and other users
352 will have to use the mouse and the GUI to change banks, which
353 rather defeats the purpose of the bindings.
355 <h3>The Selected Strip</h3>
357 Often times one wants to just deal with the strip currently
358 selected by the GUI (or the control surface). In the same way as with
359 banks above the selected strip can be designated with <em>S1</em>.
361 <h2>A Complete (though muddled) Example</h2>
363 <?xml version="1.0" encoding="UTF-8"?>
364 <ArdourMIDIBindings version="1.0.0" name="pc1600x transport controls">
365 <DeviceInfo bank-size="16"/>
366 <Binding channel="1" ctl="1" uri="/route/gain B1"/>
367 <Binding channel="1" ctl="2" uri="/route/gain B2"/>
368 <Binding channel="1" ctl="3" uri="/route/send/gain B1 1"/>
369 <Binding channel="1" ctl="4" uri="/route/plugin/parameter B1 1 1"/>
370 <Binding channel="1" ctl="6" uri="/bus/gain master"/>
372 <Binding channel="1" note="1" uri="/route/solo B1"/>
373 <Binding channel="1" note="2" uri="/route/solo B2" momentary="yes"/>
375 <Binding channel="1" note="15" uri="/route/mute B1" momentary="yes"/>
376 <Binding channel="1" note="16" uri="/route/mute B2" momentary="yes"/>
378 <Binding sysex="f0 0 0 e 9 0 5b f7" function="transport-start"/>
379 <Binding sysex="f0 7f 0 6 7 f7" function="rec-disable"/>
380 <Binding sysex="f0 7f 0 6 6 f7" function="rec-enable"/>
381 <Binding sysex="f0 0 0 e 9 0 53 0 0 f7" function="loop-toggle"/>
383 <Binding channel="1" note="13" function="transport-roll"/>
384 <Binding channel="1" note="14" function="transport-stop"/>
385 <Binding channel="1" note="12" function="transport-start"/>
386 <Binding channel="1" note="11" function="transport-zero"/>
387 <Binding channel="1" note="10" function="transport-end"/>
388 </ArdourMIDIBindings>
391 Please note that channel, controller and note numbers are specified as
392 decimal numbers in the ranges 1-16, 0-127 and 0-127 respectively
393 (the channel range may change at some point).