[LAD] MIDI maps : C++ functions

Paul Davis paul at linuxaudiosystems.com
Wed Mar 23 12:39:52 UTC 2011


in ardour3, which the only implementation i want to talk about, we
have a basic object called a Controllable which consists fundamentally
of just a set() and get() method pair and a callback/signal that is
called/emitted when the value changes. Controllables are used for just
about everything in ardour that can "be controlled", and they all have
unique, persistent ID.

MIDI bindings link a particular MIDI message (e.g. a CC number) with
the ID of a Controllable, and will generally cause the set() method of
the object to be called when the message is received.

On 3/22/11, Harry Van Haaren <harryhaaren at gmail.com> wrote:
> Hey guys,
>
> I'm wondering how to approach creating a MIDI map to all controllers
> available in the GUI. Needless to say I can hard code in a MIDI CC, and from
> JACK's process callback call the function that I want to map that control
> to, but that's a little rigid.
>
> I like Ardour's one-click map idea, and I'm wondering how its implemented.
> Here's what I concluded so far:
> On mouse_3 down, pop up dialog, send message to JACK process to keep next
> MIDI input stored somewhere. That's the CC to map
>
> Where I'm getting stuck is how to make each CC point to a different
> "parameter" in the software, or a different function in the code. Function
> pointers come to mind, but somehow I don't like that idea much. Creating a
> generic interface to map every control in the entire engine might work, but
> I think that may be a little overkill?
>
> I'd be interested to hear how various projects handles this internally, if
> anybody wants to chip in?
> Cheers, -Harry
>



More information about the Linux-audio-dev mailing list