2003 March 27:
Updated the man pages to abc2abc, abc2midi and midi2abc and created a
new man page for yaps.  Minor changes to midifile.c and midifile.h
were made to minimize the number of warning error messages. Midi2abc
was upgraded to be in line with the version I use with the script
midi2abc.tcl. The syntax in mftext.c was improved to reduce the
number of compilation warnings.


2003 April 12
abc2midi: for abc tunes with no guitar chords, an error
message "Command not recognized" is issued whenever a %%MIDI
chordprog or %%MIDI bassprog command is encountered.
The problem occurs mainly with runabc, which
performs only one pass through the tune and is unable to
know whether guitar chords are present before sending 
%%MIDI commands. Since no MIDI program command is issued
in this situation, the error message  was disabled, The
fix was made in dodeferred() in genmidi.c

2003 April 12
abc2midi assumes the ratio of 2:1 for long/short notes
in broken rhythms specified with angle brackets (eg. c>d),
Though this can be changed using the %%MIDI ratio command, it
is inconvenient for many users since it is necessary to edit
each tune in the abc file in order to effect this change.
A new command parameter -RS (ratio standard) changes default
ratio to 3:1 which is the standard music notation. The new
parameter still allows the %%MIDI ratio command to override
the default. The change was incorporated in event_init()
of store.c.
 
2003 Apri 19
The proposed abc standard allows non numeric identifications
for the voice field, eg. V: soprano instead of V:1.  If you
are creating a midi file, each unique identification string will
mapped to a sequential numbers 1,2 etc, as if you had used numbers
originally. The change allows abcMIDI to handle a number of 
new multivoiced abc files which have adopted this convention.
Only the first 20 characters of the identification
string are distinguished. Anything following the identification
string is ignored. The identification string should not end with
an equal sign =.  If nonnumeric identifications are used,
abc2midi will print the mapping between the id's and the numbers.
This may be useful for catching spelling errors in the id's.
The fix was made in function parsefield in parseabc.c. The
change does not yet allow V: commands to appear before the
body of the tune.

A number of abc files may designate a rest using x instead of
z. This means that this rest exists but should not appear 
in the printed score. I have modified the parser so it shall
now interpret x as rest; however, if you are using yaps to 
print the score, this rest will still remain visible. Abc2midi
will now treat x exactly like z. Abc2abc will probably
automatically convert the x's to z's whether you want it or not.
A minor change was made in parsemusic in parseabc.c. It is
necessary to modify toabc.c and yapstree.c to fix the
remaining problems.

2003 April 27
Guitar chords. The base note preceeded by a slash in the guitar
chord may now  be in lower case as well as upper case. For example,
"G/B" and "G/b" will both be treated the same way. This complies
with the proposed abc standard 1.7.6 (abc-draft.txt) and avoids
problems with some files in the Nottingham database. The fix was
made in event_handle_gchord in store.c.

Guitar chords. When there is a change of meter, the gchord beat
does not seem to get changed. I inserted a call to setbeat()
in writetrack() in genmidi.c whenever a TIME feature is encountered.
It was also necessary to change the definition of setbeat in
store.c from static to external.

2003 May 3
Karoake lyrics: Improved the documentation for the functions
write_syllable and getword in genmidi.c  which handle the lyrics
in the w: body line. If a bar line is placed in the lyric
line between two tied notes, for example see below,

"C6" c> G E2- | E2 (3 c d c | "E7" B> ^G E2- | E4 |
w: All of me, | * why not take | all of me.*
              ^
write_syllable loses synchrony with the music while searching
for the next bar line in the music. The problem was fixed
by resetting waitforbar to 0 between the two calls of
write_syllable, in writetrack (genmidi.c) after TNOTE is 
handled.

I found most warning messages about mismatched
lyric syllables to music notes have to do with users
failing to notate syllables correctly when tied notes
occur.  (Failure to place a * or  _ (underscore)  preceding
syllable of tied note. Confusing hyphen with underscore...)



2003 May 4

abc2midi file xref: Abc2midi has the option of converting
only a particular tune in a abcfile to a midi file by specifying
the X: reference number immediately following the abc file name.
When this feature is used, warning messages such as

Warning in line 28: T: outside tune body - possible missing X:

The problem occurs in the function parsefield in parseabc.c.
In order to catch the reference number of the selected tune,
every line of the input file is parsed. A flag "parsing" equal
to 0 or 1 is used to turn on the parsing inside the body of
the of the music. This flag is turned in function event_refno()
in store.c by calling the function parseon() in parseabc.c.
Unfortunately all field lines (eg. T: , M:, L:, V: ...) were 
unaffected by this flag and continued to be parsed. When the
T: field command is encountered, it falls through to the
default: in parsefield and it is processed by the function,
event_field in store.c. Event_field was designed to treat
the T: and R: conditions but before handling these conditions
it checks whether the control flag dotune is set. This flag
is also set by event_refno. If the flag is not set, then 
event_field assumes that a T: field command was encountered
without a preceding X: reference field which is a valid
error condition.

Since all field lines in the abc file are parsed this
introduces other problems. Any anomaly in the field lines
whether they are from the selected tune or not are reported.
For example, if a user has selected for example tune 500
from a large abc file, errors in the field lines of other 
tunes will be reported. Furthermore, in some cases the
program may crash in processing a field line of another tune.

To address these problems, the functions parseline and
parsefield in parseabc.c were modified so that all field
lines (except for the X: field line) and all text lines are
ignored for nonselected tunes. Parseline checks whether 
the flag parsing is set before calling parsemusic or
event_text. In parsefield, the condition key == 'X'
was moved from the switch control structure and
treated separately immediately when entering this function.
If parsing flag has not been set, the function returns
immediately after checking for key == 'X'.

This introduces a new problem. If the abc file has no 
X: field, the abcmidi programs does nothing 
without any error indication. To handle, this situation
I introduced a the global variable parsing_started into
parseabc.c, It is initialized to 0 and set to 1
when the function parseron() is called. Prior to the
end of the function parsefile, the parsing_started
variable is checked. If it is still 0, an error message
is returned.

Finally, event_linebreak() is suppressed in parsefile()
whenever the variable parsing is not set. This avoids
a lot of blank line output from abc2abc whenever the
X: field is missing from the input abc file.

This is a major change to the code, since it affects
three programs, abc2midi, yaps and abc2abc. I hope this
has not introduced new problems.

2003 May 11

Many tunes have a left repeat sign (|:) missing. In most
cases it is fairly clear where to place the repeat sign
and abc2midi merely puts a warning message "Assuming repeat".
When you are processing a large group of abc tunes these
messages may be annoying. A new parameter -NAR (no assuming
repeat) will suppress this message when you are
running abc2midi. However, occasionally you get the error
message "Found unexpected :| ...". This is a more serious
problem.  Due to some ambiguity, the program store.c was
unable to place a missing |: into the tune. During the
second pass, genmidi.c encounters the :| and does not know
where to begin the repeat. This is a real error since the
repeat will not occur. This error message is not suppressed.

The instructions !trill! and !fermata! are recognized by
yaps and abc2midi and are treated in the same way as the
decorations T and H preceding a note. To do this I introduced
a new integer global array decorator_passback[] which is set
by event_handle_instruction in both yapstree.c and store.c.
The array is passed between files parseabc.c, store.c
and yapstree.c as an extern.

2003 May 18

The symbol y used to denote a space in Barfly, is ignored
and no longer causes an error message. It is deleted by
abc2abc.

2003 May 19

Added an option to number bars in yaps. Note the bar numbers
may not match those in abc2midi or other abc*ps programs.
Introduced global flag barnums and global integer nnbars in 
yapstree.c which is set by event_init and linked to 
drawtune.c. Added new -k option in event_init
in yapstree.c. In event_bar in yapstree.c passed the current
bar number instead of NULL in addfeature. In drawtune.c
introduced a new function printbarnumber which is called
in various places in the function printvoiceline.

%%MIDI chordname accepts negative semitone shifts relative
to root. In function event_specific in store.c, replaced
readnump with readsnump.

2003 May 22

Bar numbering in yaps is now in agreement with abc2midi but
may differ by one unit with abc2ps and other members of its
family. See abcguide.txt for more discussion. I moved the
position of the call to checkbar() in event_bar() (yapstree.c)
so it occurs before addfeature is called rather than after.

The decoration field line d: (used inabcm2ps) is not parsed as
a music line but is an ignored field line. Change
was made in parseabc.c in parsefield() and parseline().
