Rework the MIDI_OCTAVE directive so that the octave offset can also be given in the next token.
parent
eccbb9ce64
commit
2b2d11ed3c
|
@ -41,8 +41,8 @@
|
||||||
# Two of the most common alternatives are listed below (uncomment one of
|
# Two of the most common alternatives are listed below (uncomment one of
|
||||||
# the following lines to use these):
|
# the following lines to use these):
|
||||||
|
|
||||||
#MIDI_OCTAVE-1 # ASA (Acoustical Society of America; middle C is C4)
|
#MIDI_OCTAVE -1 # ASA (Acoustical Society of America; middle C is C4)
|
||||||
#MIDI_OCTAVE-2 # alternate MIDI (various manufacturers; middle C is C3)
|
#MIDI_OCTAVE -2 # alternate MIDI (various manufacturers; middle C is C3)
|
||||||
|
|
||||||
# The program distinguishes between messages on different MIDI
|
# The program distinguishes between messages on different MIDI
|
||||||
# channels. By default, messages are assumed to be on MIDI channel 1,
|
# channels. By default, messages are assumed to be on MIDI channel 1,
|
||||||
|
|
|
@ -1214,6 +1214,9 @@ read_config_file(void)
|
||||||
if (!strncmp(tok, "MIDI_OCTAVE", 11)) {
|
if (!strncmp(tok, "MIDI_OCTAVE", 11)) {
|
||||||
char *a = tok+11;
|
char *a = tok+11;
|
||||||
int k, n;
|
int k, n;
|
||||||
|
if (!*a)
|
||||||
|
// look for the offset in the next token
|
||||||
|
a = token(NULL, &delim);
|
||||||
if (sscanf(a, "%d%n", &k, &n) == 1 && !a[n]) {
|
if (sscanf(a, "%d%n", &k, &n) == 1 && !a[n]) {
|
||||||
midi_octave = k;
|
midi_octave = k;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue