manual/include/generic-midi-binding-maps.html

390 lines
14 KiB
HTML
Raw Normal View History

2013-01-29 19:26:36 -05:00
<p>
Ardour 2.X supported
<a href="@@generic-midi-learn"><dfn>MIDI learning</dfn></a>
2014-02-05 18:59:35 -05:00
for more or less any control. This was a nice feature that quite a few other
DAWs are providing by now, but it didn't allow Ardour to work "out of the
box" with sensible defaults for existing commercial MIDI
controllers. In Ardour 3 and later versions, we have augmented the
MIDI learn feature with the ability to load a <dfn>MIDI binding map</dfn>
2014-02-05 18:59:35 -05:00
for a given controller, which can set up an arbitrary number of physical
controls with anything inside Ardour that can be controlled.
2014-02-05 18:59:35 -05:00
</p>
<p>
Currently (August 2016), we have presets for the following devices/modes:
</p>
2013-01-29 19:26:36 -05:00
<ul>
<li>AKAI MPD-32</li>
<li>AKAI MPK61</li>
<li>AKAI MPKmini</li>
<li>Behringer BCF2000</li>
<li>Behringer BCF2000 (Mackie Emulation mode; better to use
Ardour's actual Mackie Control Protocol support)</li>
2014-02-05 18:59:35 -05:00
<li>Behringer DDX3216</li>
<li>Korg nanoKONTROL (2 layouts)</li>
<li>Korg nanoKONTROL 2 (2 layouts)</li>
<li>Korg Taktile</li>
<li>M-Audio Axiom 25 (2 layouts)</li>
<li>M-Audio Axiom 61</li>
<li>M-Audio Oxygen 49</li>
<li>M-Audio Oxygen 61v3</li>
<li>M-Audio Oxygen 25</li>
<li>M-Audio Oxygen 8v2</li>
<li>Novation Impulse 49</li>
<li>Novation Impulse 61</li>
<li>Novation LaunchControl XL</li>
<li>Novation LaunchKey 25</li>
<li>Roland SI-24</li>
<li>Roland V Studio 20</li>
<li>Yamaha KX25</li>
2013-01-29 19:26:36 -05:00
</ul>
At this time, new binding maps need to be created with a text editor.
2013-01-29 19:26:36 -05:00
<p>
2014-02-05 18:59:35 -05:00
MIDI binding maps are accessible by double-clicking <kbd class="menu">Edit
&gt; Preferences &gt; Control Surfaces &gt; Generic MIDI</kbd>. Ardour will
2014-02-05 18:59:35 -05:00
retain your selection after you choose one.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<h2>Creating new MIDI maps</h2>
<h3>The Basic Concept</h3>
2013-01-29 19:26:36 -05:00
<p>
Since the beginning of time (well, sometime early in the 2.X series),
Ardour has had the concept of identifying each track and bus with a
<dfn>remote control ID</dfn>. This ID uniquely identifies a track or bus
so that when messages arrive from elsewhere via MIDI or OSC , we can determine
which track or bus they are intended to control. See
2017-03-21 09:41:38 -04:00
<a href="@@controlling-track-ordering">
remote control IDs</a> for more information.
You just need to know that there is a "first track" and its remote control
2014-02-05 18:59:35 -05:00
ID is 1, and so on.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<h3>Getting Started</h3>
2013-01-29 19:26:36 -05:00
<p>
MIDI bindings are stored in files with the suffix ".map" attached to their
2014-02-05 18:59:35 -05:00
name. The minimal content looks like this:
</p>
2013-01-29 19:26:36 -05:00
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
2014-02-05 18:59:35 -05:00
&lt;ArdourMIDIBindings version="1.0.0" name="The name of this set of
bindings"&gt;
2013-01-29 19:26:36 -05:00
&lt;/ArdourMIDIBindings&gt;
</pre>
2014-02-05 18:59:35 -05:00
<p>
So, to start, create a file with that as the initial contents.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<p>
On OS X, Ardour loads midi maps from its binary-bundle folder in
<code>Ardour-&lt;version&gt;/midi_maps/</code> and checks
various other locations as well (defined by the ARDOUR_MIDIMAPS_PATH
environment variable). On GNU/Linux the easiest is to save the file to
2014-02-05 18:59:35 -05:00
<code>~/.config/ardour3/midi_maps/</code>.
2013-05-19 18:03:43 -04:00
</p>
2014-02-05 18:59:35 -05:00
<h3>Finding out what your MIDI control surface sends</h3>
2013-01-29 19:26:36 -05:00
<p>
This is the most complex part of the job, but its still not very hard.
You need to connect the control surface to an application that will show
you the information that the device sends each time you modify a knob,
slider, button etc. There are a variety of such applications (notably
<code>gmidimon</code> and <code>kmidimon</code>, but you can actually use
Ardour for this if you want. Start Ardour in a terminal window, connect
MIDI ports up, and in the Preferences window, enable "Trace Input" on the
relevant MIDI port. A full trace of the MIDI data received will show up in
the terminal window. (Note: in Ardour3, you get a dedicated, custom dialog
2014-02-05 18:59:35 -05:00
for this kind of tracing.)
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<h3>Types of Bindings</h3>
2013-01-29 19:26:36 -05:00
<p>
There are two basic kinds of bindings you can make between a MIDI message
and something inside Ardour. The first is a binding to a specific parameter
of a track or bus. The second is a binding to a function that will change
2014-02-05 18:59:35 -05:00
Ardour's state in some way.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<h4>Binding to Track/Bus controls</h4>
2013-01-29 19:26:36 -05:00
<p>
2014-02-05 18:59:35 -05:00
A track/bus binding has one of two basic structures
</p>
<code>
&lt;Binding <em>msg specification</em> uri="<em>&hellip; control address &hellip;</em>"/&gt;
&lt;Binding <em>msg specification</em> function="<em>&hellip; function name &hellip;</em>"/&gt;
2014-02-05 18:59:35 -05:00
</code>
2013-01-29 19:26:36 -05:00
<h4>Message specifications</h4>
<p>
2014-02-05 18:59:35 -05:00
You can create a binding for either 3 types of channel messages, or for a
system exclusive ("sysex") message. A channel message specification looks
2014-02-05 18:59:35 -05:00
like this:
</p>
<code>
&lt;Binding channel="1" ctl="13" &hellip;.
2014-02-05 18:59:35 -05:00
</code>
<p>
This defines a binding for a MIDI Continuous Controller message involving
controller 13, arriving on channel 1. There are 16 MIDI channels, numbered
1 to 16. Where the example above says <code>ctl</code>, you can alternatively
use <code>note</code> (to create binding for a Note On message) or
2014-02-05 18:59:35 -05:00
<code>pgm</code> (to create a binding for a Program Change message).
2013-01-29 19:26:36 -05:00
</p>
<p>
As of Ardour 4.2, <code>enc-r</code>, <code>enc-l</code>, <code>enc-2</code> and
<code>enc-b</code> may be used for surfaces that have encoders that send
offsets rather than values. These accept Continuous Controller messages
but treat them as offsets. These are good for banked controls as they are
always at the right spot to start adjusting. (
<a href="@@generic-midi-and-encoders">
Learn more about working with encoders
</a>)
</p>
2013-01-29 19:26:36 -05:00
<p>
2014-02-05 18:59:35 -05:00
You can also bind sysex messages:
</p>
<code>
&lt;Binding sysex="f0 0 0 e 9 0 5b f7" &hellip;.
&lt;Binding sysex="f0 7f 0 6 7 f7" &hellip;.
2014-02-05 18:59:35 -05:00
</code>
<p>
The string after the <code>sysex=</code> part is the sequence of MIDI bytes,
2014-02-05 18:59:35 -05:00
as hexadecimal values, that make up the sysex message.
2013-01-29 19:26:36 -05:00
</p>
<p>
2014-02-05 18:59:35 -05:00
Finally, you can bind a totally arbitrary MIDI message:</p>
<code>
&lt;Binding msg="f0 0 0 e 9 0 5b f7" &hellip;.
&lt;Binding msg="80 60 40" &hellip;.
2014-02-05 18:59:35 -05:00
</code>
<p>
The string after the <code>msg=</code> part is the sequence of MIDI bytes, as
hexadecimal values, that make up the message you want to bind. Using this is
slightly less efficient than the other variants shown above, but is useful for
2014-02-05 18:59:35 -05:00
some oddly designed control devices.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<p class="note">
As of Ardour 4.6 it is possible to use multi-event MIDI strings such as
two event CC messages, RPN or NRPN.
</p>
<p class="note">
The <code>sysex=</code> and <code>msg=</code> bindings will only work with
<code>function=</code> or <code>action=</code> control addresses. They
will <em>not</em> work with the <code>uri=</code> control addresses.
2016-10-29 13:28:01 -04:00
Controls used with <code>uri=</code> require a <em>Value</em> which is
only available in a known place with channel mode MIDI events.
</p>
2013-01-29 19:26:36 -05:00
<h4>Control address</h4>
<p>
A <dfn>control address</dfn> defines what the binding will actually control.
2014-02-05 18:59:35 -05:00
There are quite a few different things that can be specified here:
</p>
2017-03-14 12:43:24 -04:00
<table class="dl">
<tr><th>/route/gain</th>
<td>the gain control ("fader") for the track/bus</td></tr>
<tr><th>/route/trim</th>
<td>the trim control for the track/bus (new in 4.1)</td></tr>
<tr><th>/route/solo</th>
<td>a toggleable control for solo (and listen) of the track/bus</td></tr>
<tr><th>/route/mute</th>
<td>a toggleable control to mute/unmute the track/bus</td></tr>
<tr><th>/route/recenable</th>
<td>a toggleable control to record-enable the track</td></tr>
<tr><th>/route/panwidth</th>
<td>interpreted by the track/bus panner, should control image "width"</td></tr>
<tr><th>/route/pandirection</th>
<td>interpreted by the track/bus panner, should control image "direction"</td></tr>
<tr><th>/route/plugin/parameter</th>
<td>the Mth parameter of the Nth plugin of a track/bus
</td></tr>
<tr><th>/route/send/gain</th>
<td>the gain control ("fader") of the Nth send of a track/bus</td></tr>
</table>
2013-01-29 19:26:36 -05:00
<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>
2017-03-14 12:43:24 -04:00
<table class="dl">
<tr><th>a number, eg. "1"
</th>
<td>identifies a track or bus by its remote control ID
</td></tr>
<tr><th>B, followed by a number
</th>
<td>identifies a track or bus by its remote control ID within the current bank (see below for more on banks)
</td></tr>
<tr><th>S, followed by a number
</th>
<td>identifies a selected track in order they have been selected, S1 should be the same track as the Editor Mixer
</td></tr>
<tr><th>one or more words
</th>
<td>identifies a track or bus by its name
</td></tr>
</table>
2014-02-05 18:59:35 -05:00
<p>
For send/insert/plugin controls, the address consists of a track/bus
address (as just described) followed by a number identifying the plugin/send
(starting from 1). For plugin parameters, there is an additional third
2014-02-05 18:59:35 -05:00
component: a number identifying the plugin parameter number (starting from
1).
2013-01-29 19:26:36 -05:00
</p>
<p>
One additional feature: for solo and mute bindings, you can also add
<code>momentary="yes"</code> after the control address. This is useful
primarily for NoteOn bindings&mdash;when Ardour gets the NoteOn it
will solo or mute the targetted track or bus, but then when a NoteOff
2014-02-05 18:59:35 -05:00
arrives, it will un-solo or un-mute it.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
2013-01-29 19:26:36 -05:00
<h4>Bindings to Ardour "functions"</h4>
<p>
Rather than binding to a specific track/bus control, it may be useful to
have a MIDI controller able to alter some part of Ardour's state. A
2014-02-05 18:59:35 -05:00
binding definition that does this looks like this:
</p>
<code>
2013-01-29 19:26:36 -05:00
&lt;Binding channel="1" note="13" function="transport-roll"/&gt;
2014-02-05 18:59:35 -05:00
</code>
<p>
In this case, a NoteOn message for note number 13 (on channel 1) will
2014-02-05 18:59:35 -05:00
start the transport rolling. The following function names are available:
2013-01-29 19:26:36 -05:00
</p>
2017-03-14 12:43:24 -04:00
<table class="dl">
<tr><th>
2013-01-29 19:26:36 -05:00
<code>transport-stop</code>
2017-03-14 12:43:24 -04:00
</th>
<td>stop the transport
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>transport-roll</code>
2017-03-14 12:43:24 -04:00
</th>
<td>start the transport "rolling"
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>transport-zero</code>
2017-03-14 12:43:24 -04:00
</th>
<td>move the playhead to the zero position
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>transport-start</code>
2017-03-14 12:43:24 -04:00
</th>
<td>move the playhead to the start marker
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>transport-end</code>
2017-03-14 12:43:24 -04:00
</th>
<td>move the playhead to the end marker
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>loop-toggle</code>
2017-03-14 12:43:24 -04:00
</th>
<td>turn on loop playback
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>rec-enable</code>
2017-03-14 12:43:24 -04:00
</th>
<td>enable the global record button
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>rec-disable</code>
2017-03-14 12:43:24 -04:00
</th>
<td>disable the global record button
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>next-bank</code>
2017-03-14 12:43:24 -04:00
</th>
<td>Move track/bus mapping to the next bank (see Banks below)
</td></tr>
<tr><th>
2013-01-29 19:26:36 -05:00
<code>prev-bank</code>
2017-03-14 12:43:24 -04:00
</th>
<td>Move track/bus mapping to the previous bank (see Banks below)
</td></tr>
</table>
2014-02-05 18:59:35 -05:00
<h4>Binding to Ardour "actions"</h4>
2013-01-29 19:26:36 -05:00
<p>
2014-02-05 18:59:35 -05:00
You can also bind a sysex or arbitrary message to any of the items
that occur in Ardour's main menu (and its submenus). The <a
href="@@list-of-menu-actions">
list of actions</a> shows all available values of <em>action-name</em>.
2014-02-05 18:59:35 -05:00
<p>
To create a binding between an arbitrary MIDI message (we'll use a
note-off on channel 1 of MIDI note 60 (hex) with release velocity
2014-02-05 18:59:35 -05:00
40 (hex)), the binding file would contain:
</p>
<code>
2013-01-29 19:26:36 -05:00
&lt;Binding msg="80 60 40" action="Editor/temporal-zoom-in"/&gt;
2014-02-05 18:59:35 -05:00
</code>
<p>
The general rule, when taken an item from the keybindings file and
using it in a MIDI binding is to simply strip the
<code>&lt;Action&gt;</code> prefix of the second field in the
2014-02-05 18:59:35 -05:00
keybinding definition.
2013-01-29 19:26:36 -05:00
</p>
2014-02-05 18:59:35 -05:00
<h3>Banks and Banking</h3>
2013-01-29 19:26:36 -05:00
<p>
Because many modern control surfaces offer per-track/bus controls
for far fewer tracks &amp; busses than many users want to control,
Ardour offers the relatively common place concept of <dfn>banks</dfn>. Banks
allow you to control any number of tracks and/or busses easily,
regardless of how many faders/knobs etc. your control surface has.<br>
To use banking, the control addresses must be specified using the
<dfn>bank relative</dfn> format mentioned above ("B1" to identify
the first track of a bank of tracks, rather than "1" to identify
2014-02-05 18:59:35 -05:00
the first track).
2013-01-29 19:26:36 -05:00
</p>
<p>
One very important extra piece of information is required to use
banking: an extra line near the start of the list of bindings
that specifies how many tracks/busses to use per bank. If the
device has 8 faders, then 8 would be a sensible value to use for
2014-02-05 18:59:35 -05:00
this. The line looks like this:</p>
<code>
2013-01-29 19:26:36 -05:00
&lt;DeviceInfo bank-size="8"/&gt;
2014-02-05 18:59:35 -05:00
</code>
<p>
In addition, you probably want to ensure that you bind something
on the control surface to the <code>next-bank</code> and
<code>prev-bank</code> functions, otherwise you and other users
will have to use the mouse and the GUI to change banks, which
2014-02-05 18:59:35 -05:00
rather defeats the purpose of the bindings.
2013-01-29 19:26:36 -05:00
</p>
<h3>The Selected Strip</h3>
<p>
Often times one wants to just deal with the strip currently
selected by the GUI (or the control surface). In the same way as with
banks above the selected strip can be designated with <em>S1</em>.
</p>
2013-01-29 19:26:36 -05:00
<h2>A Complete (though muddled) Example</h2>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ArdourMIDIBindings version="1.0.0" name="pc1600x transport controls"&gt;
&lt;DeviceInfo bank-size="16"/&gt;
&lt;Binding channel="1" ctl="1" uri="/route/gain B1"/&gt;
&lt;Binding channel="1" ctl="2" uri="/route/gain B2"/&gt;
&lt;Binding channel="1" ctl="3" uri="/route/send/gain B1 1"/&gt;
&lt;Binding channel="1" ctl="4" uri="/route/plugin/parameter B1 1 1"/&gt;
&lt;Binding channel="1" ctl="6" uri="/bus/gain master"/&gt;
&lt;Binding channel="1" note="1" uri="/route/solo B1"/&gt;
&lt;Binding channel="1" note="2" uri="/route/solo B2" momentary="yes"/&gt;
&lt;Binding channel="1" note="15" uri="/route/mute B1" momentary="yes"/&gt;
&lt;Binding channel="1" note="16" uri="/route/mute B2" momentary="yes"/&gt;
&lt;Binding sysex="f0 0 0 e 9 0 5b f7" function="transport-start"/&gt;
&lt;Binding sysex="f0 7f 0 6 7 f7" function="rec-disable"/&gt;
&lt;Binding sysex="f0 7f 0 6 6 f7" function="rec-enable"/&gt;
&lt;Binding sysex="f0 0 0 e 9 0 53 0 0 f7" function="loop-toggle"/&gt;
&lt;Binding channel="1" note="13" function="transport-roll"/&gt;
&lt;Binding channel="1" note="14" function="transport-stop"/&gt;
&lt;Binding channel="1" note="12" function="transport-start"/&gt;
&lt;Binding channel="1" note="11" function="transport-zero"/&gt;
&lt;Binding channel="1" note="10" function="transport-end"/&gt;
&lt;/ArdourMIDIBindings&gt;
</pre>
<p>
Please note that channel, controller and note numbers are specified as
decimal numbers in the ranges 1-16, 0-127 and 0-127 respectively
2014-02-05 18:59:35 -05:00
(the channel range may change at some point).
2013-01-29 19:26:36 -05:00
</p>