[linux-audio-dev] Re: Language fanboys [was Re: light C++ set for WAV]

Jens M Andreasen jens.andreasen at chello.se
Sun Jul 23 11:41:02 UTC 2006

On Sun, 2006-07-23 at 19:36 +1000, Loki Davison wrote:
> On 7/23/06, Jens M Andreasen <jens.andreasen at chello.se> wrote:
> > On Sun, 2006-07-23 at 11:52 +1000, Loki Davison wrote:
> >
> > > Yay! i want my whole app to communicate between engine and gui via
> > > midi! That's going to really be interesting... So what CC would i use
> > > for add a new node named "node"? Sysex i guess? ....
> >
> > CC 06 (Data Entry) would be a good candidate for entering text,
> > possibly with 96, 97 (data increment, decrement) to be used as a
> > cursor.
> >
> > The backend will "know" that you are setting the text field of a node
> > because you immediately before have send a Non-Registered Pararameter
> > Number (CC 98 MSB, 99 LSB), setting the mode or destination to
> > whatever you have found reasonable to represent "node-name".
> >
> > Problems: Attempts at midi-merge may fail. The data-entry slider cannot
> > be connected to two separate destinations simultaniously in any
> > meaningful way, other than that the last connection wins and all of the
> > data goes there.
> >
> > > Loki
> > --
> minor downside is that it sounds horrible and complicated and like
> you've escaped to the 80's. Yay back to the future...  You just can't
> say in midi "set the sine osc to 440 hz." I.e you can say in your
> message that you are setting a oscillator called something. You can in
> osc, so much more human readable.

The implementation could be a switch on the current NRPN. Nothing
complicated or unusual here. Or with a bit of carefulness, you could
also do an array of dynamically allocated function pointers

The upside is that we can actually have (and I do have) a physical
rotary knob that sets an oscillator to, say 440Hz. As for human
readability  of the message, I couldn't care less since I am not going
to read the datastream aloud to myself anyway.

To get text representations of unique NPRN's for readability in your
sources, you would typically use something like:

-- myNRPN.h ---------------
#define NODE_NAME __LINE__
#define OSC_FREQ  __LINE__

... which is of course an old-fashioned technique known since the
beginning of the UNIX epoch. But it still works as intended.

> Loki

More information about the Linux-audio-dev mailing list