Comment changes.
This commit is contained in:
parent
bad70bfaf7
commit
395fd5ebe8
67
readconfig.c
67
readconfig.c
|
@ -894,47 +894,54 @@ re_press_temp_modifiers(void)
|
||||||
|
|
||||||
/* Parser for the MIDI message syntax. The same parser is used for both
|
/* Parser for the MIDI message syntax. The same parser is used for both
|
||||||
the left-hand side (lhs) and the right-hand side (rhs) of a translation.
|
the left-hand side (lhs) and the right-hand side (rhs) of a translation.
|
||||||
The syntax we actually parse here is, somewhat abridged:
|
The syntax we actually parse here is the following:
|
||||||
|
|
||||||
tok ::= ( note | msg ) [ number ] [ "[" number "]" ] [ "-" number] [ incr ]
|
tok ::= msg [ number ] [ steps ] [ "-" number] [ flag ]
|
||||||
|
msg ::= note | other
|
||||||
note ::= ( "a" | ... | "g" ) [ "#" | "b" ]
|
note ::= ( "a" | ... | "g" ) [ "#" | "b" ]
|
||||||
msg ::= "ch" | "pb" | "pc" | "cc" | "cp" | "kp:" note
|
other ::= "ch" | "pb" | "pc" | "cc" | "cp" | "kp:" note
|
||||||
incr ::= "-" | "+" | "=" | "<" | ">" | "~"
|
steps ::= "[" number "]" | "{" list "}" | "[" number "]" "{" list "}"
|
||||||
|
list ::= number { "," number | ":" number }
|
||||||
|
flag ::= "-" | "+" | "=" | "<" | ">" | "~" | "'"
|
||||||
|
|
||||||
Case is insignificant. Numbers are always in decimal. The meaning of
|
Case is insignificant. Numbers are always in decimal. The meaning of
|
||||||
the first number depends on the context (octave number for notes and
|
the first number depends on the context (octave number for notes and
|
||||||
key pressure, the actual data byte for other messages). This can
|
key pressure, the actual data byte for other messages). This can
|
||||||
optionally be followed by a number in brackets, denoting a step
|
optionally be followed by a number in brackets, denoting a step size,
|
||||||
size. Also optionally, the suffix with the third number (after the
|
or (in some translations) a list of values in curly braces. Also
|
||||||
dash) denotes the MIDI channel; otherwise the default MIDI channel is
|
optionally, the suffix with the third number (after the dash) denotes
|
||||||
used.
|
the MIDI channel; otherwise the default MIDI channel is used.
|
||||||
|
|
||||||
Note that not all combinations are possible -- "pb" and "cp" have no
|
Note that not all combinations are possible -- "pb" and "cp" have no
|
||||||
data byte; and "ch" must *not* occur on the lhs at all, and is
|
data byte, "pc" no step size and flag; and "ch" must *not* occur on
|
||||||
followed by just a channel number. (In fact, "ch" is no real MIDI
|
the lhs at all, and is followed by just a channel number. (In fact,
|
||||||
message at all; it just sets the default MIDI channel for subsequent
|
"ch" is no real MIDI message at all; it just sets the default MIDI
|
||||||
messages in the output sequence.)
|
channel for subsequent messages in the output sequence.)
|
||||||
|
|
||||||
The incr flag indicates an "incremental" controller or pitch bend
|
The optional flag at the end of the token indicates an "incremental"
|
||||||
value which responds to up ("+") and down ("-") changes; it is only
|
controller or pitch bend value which responds to up ("+") and down
|
||||||
permitted in conjunction with "cc", "pb", "cp" and "kp", and (with
|
("-") changes; it is only permitted (with one exception, see below)
|
||||||
one exception, see below) only on the lhs of a translation. In
|
on the lhs of a translation. In addition, "<" and ">" can be used in
|
||||||
addition, "<" and ">" can be used in lieu of "-" and "-" to indicate
|
lieu of "-" and "-" to indicate a relative controller in "sign bit"
|
||||||
a relative controller in "sign bit" representation, where controller
|
representation, where controller values > 64 denote down, and values
|
||||||
values > 64 denote down, and values < 64 up changes. This notation is
|
< 64 up changes. This notation is only permitted with "cc". It is
|
||||||
only permitted with "cc". It is used for endless rotary encoders, jog
|
used for endless rotary encoders, jog wheels and the like, as can be
|
||||||
wheels and the like, as can be found, e.g., on Mackie-like units.
|
found, e.g., on Mackie-like units.
|
||||||
|
|
||||||
Finally, the flags "=" and "~" are used in lieu of "+"/"-" or
|
The flags "=" and "~" are used in lieu of "+"/"-" or "<"/">",
|
||||||
"<"/">", respectively, to denote a "bidirectional" translation which
|
respectively, to denote a "bidirectional" translation which applies
|
||||||
applies to both positive and negative changes of the controller or
|
to both positive and negative changes of the parameter value. Since
|
||||||
pitch bend value. Since bidirectional translations cannot have
|
bidirectional translations cannot have distinct keystroke sequences
|
||||||
distinct keystroke sequences for up and down changes associated with
|
for up and down changes associated with them, this makes most sense
|
||||||
them, this makes most sense with pure MIDI translations.
|
with pure MIDI translations.
|
||||||
|
|
||||||
The only incr flag which is also permitted on the rhs of a
|
Among these, only the "~" flag is also permitted on the rhs of a
|
||||||
translation, and only with "cc", is the "~" flag, which is used to
|
translation, and only with "cc", where it is used to denote a
|
||||||
denote a relative (sign bit) controller change on output. */
|
relative (sign bit) controller change on output.
|
||||||
|
|
||||||
|
Finally, the special "transposition" flag "'" is used in so-called
|
||||||
|
"mod" translations where it swaps offset and data value; please check
|
||||||
|
the documentation for details. */
|
||||||
|
|
||||||
static int note_number(char c, char b, int k)
|
static int note_number(char c, char b, int k)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue