Rework the MIDI_OCTAVE directive so that the octave offset can also be given in the next token.

master
Albert Graef 2018-08-12 09:01:54 +02:00
parent eccbb9ce64
commit 2b2d11ed3c
2 changed files with 5 additions and 2 deletions

View File

@ -41,8 +41,8 @@
# Two of the most common alternatives are listed below (uncomment one of
# the following lines to use these):
#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 -1 # ASA (Acoustical Society of America; middle C is C4)
#MIDI_OCTAVE -2 # alternate MIDI (various manufacturers; middle C is C3)
# The program distinguishes between messages on different MIDI
# channels. By default, messages are assumed to be on MIDI channel 1,

View File

@ -1214,6 +1214,9 @@ read_config_file(void)
if (!strncmp(tok, "MIDI_OCTAVE", 11)) {
char *a = tok+11;
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]) {
midi_octave = k;
} else {