abcMIDI :   abc <-> MIDI conversion utilities

midi2abc version 1.6.3
abc2midi version 1.5.1
abc2abc  version 1.6.2

15th June 1997

James Allwright
jra@ecs.soton.ac.uk
Department of Electronics and Computer Science,
University of Southampton, UK
4th June 1996

These programs may be freely redistributed. They are based on the 'midifilelib'
public domain MIDI file utilities, available from

http://www.harmony-central.com/MIDI/midifilelib.tar.gz

This package is to be found on the web at

http://diana.ecs.soton.ac.uk/~jra/abcMIDI/

---------------------------------------------------------------------
Program Code

The file midifile.c and the header file midifile.h are almost unchanged from 
the midifilelib distribution. To see the program dependencies, examine the
Makefile.

Compilation

To compile the code, type

make all

This code has been tested on a SUN4 architecture. If the complete compilation
does not work, you can try compiling the individual programs separately :

make midi2abc
make abc2midi
make abc2abc
make mftext

----------------------------------------------------------------------
midi2abc - program to convert MIDI format files to abc notation. 

This program takes a MIDI format file and converts it to something as close
as possible to abc text format. The user then has to add text fields not
present in the MIDI header and possibly tidy up the abc note output.

Features :

* The key is chosen so as to minimize the number of accidentals.
* Note length can be set by specifiying the total number of bars or the 
tempo of the piece. Alternatively the note length can be read from the file.
However, by default it is deduced in a heuristic manner from the inter-note 
distances.  This means that you do not have to use the MIDI clock as a 
metronome when playing in a tune from a keyboard. 
* Barlines are automatically inserted. The user specifies the number of
notes in the anacrusis before the first barline and the time signature.
* The output has 4 bars per line.
* Enough accidental signs are put in the music to ensure that no pitch
errors occur if a barline is added or deleted.
* The program attempts to group notes sensibly in each bar.
* Triplets and broken rhythm (a>b) are supported.
* Chords are identified.
* Text information from the original MIDI file is included as comments.
* If a channel is specified, events on other channels are ignored.
* If a track is specified, events in other tracks are ignored.

What midi2abc does not do :

* Supply tune title, composer or any other field apart from X: , K:, Q:, M:
and L: - these must be added by hand afterwards.
* Deduce whether the tune is in a major or minor key.
* Split notes across a bar. The program instead assumes an error in note
sizing and extends the bar, producing a comment to tell you about the
extra-long bar.
* Support duplets, quadruplets, other esoteric features.
* Identify mid-tune key changes.
* Deduce repeats. The output is just the notes in the input file.
* Recover an abc tune as supplied to abc2midi.

  usage :
midi2abc <options>
         -a <notes in anacrusis>
         -m <time signature>
         -xm  extract time signature from file
         -xl  extract absolute note lengths from file
         -b <bars wanted in output>
         -Q <tempo in quarter-notes per minute>
         -t <track>
         -c <channel>
         -f <input file>
Only the -f option is compulsory. Use only one of -xl, -b and -Q.
If none of these is present, the program attempts to guess a 
suitable note length.

The output of midi2abc is printed to the screen. To save it to a file, use
the redirection operator.

e.g.

midi2abc -f file.mid > file.abc

If the MIDI file is computer-generated, you may be able to extract the time
signature from it using the -xm option. Otherwise you should specify it with
-m. Allowable time signatures are C, 4/4, 3/8, 2/4 and so on.

If the tune has an anacrusis, you should specify the number of notes in
it using the -a option. Unfortunately I cannot think of any way of deducing
this information from the file.

Please report any bugs to jra@ecs.soton.ac.uk

-------------------------------------------------------------------------

abc2midi  - converts abc file to midifile.
Usage : abc2midi <abc file> [reference number] [-c] [-n notes]
        [reference number] selects a tune
        -c selects checking only
        -n notes (specifies units of note storage to be allocated)


Features :

* you can pick out one tune to convert by giving its reference number

e.g. abc2midi mytunes.abc 5

This will produce a file mytunes5.mid. Otherwise all tunes in the file
are converted to MIDI files mytunes1.mid, mytunes2.mid and so on. The
number appended is the reference number givcen in the X: field for each tune.

* Broken rythms (>, <), chords, n-tuples, slurring, ties, staccatto notes,
repeats, in-tune tempo/length/meter changes are all supported.

* R:hornpipe or r:hornpipe is recognized and note timings are adjusted to
give a broken rythm (ab is converted to a>b).

* Most errors in the abc input will generate a suitable error message in
the output and the converter keeps going.

* Comments and text fields in the abc source are converted to text events
in the MIDI output

* If guitar chords are present, these are generated in the MIDI output.

* If there are mis-matched repeat signs in the abc, the program attempts to
  fix them. However, it will not attempt this if a multi-part tune 
  description has been used or if multiple voices are in use.

* There are some extensions to the abc syntax of the form

%%MIDI channel n

These control channel and program selection, transposing and various
other features of abc2midi. See the file abcguide.txt for more
details.

Limitations :

* Ties used to tie notes across a barline will cause an erroneous bar length
error.

* No field is inherited from above the X: field of the tune.

Please report any other bugs to jra@ecs.soton.ac.uk

-------------------------------------------------------------------------
abc2abc

Usage: abc2abc <filename> [-s] [-n] [-b] [-r] [-e] [-t X] -u
  -s for new spacing
  -n for new linebreaks
  -b to remove bar checking
  -r to remove repeat checking
  -e to remove all error reports
  -t X to transpose X semitones
  -u to update notation ([] for chords and () for slurs)

A simple abc checker/re-formatter/transposer. If the -n option is selected, 
error checking is turned off. The program attempts to linebreak at a ||  :|  
|: or :: .

If you want to check an abc tune, it is recommended that you use abc2midi 
with the -c option as this performs extra checks that abc2abc does not do.

The output of abc2abc is printed to the screen. To save it to a file, use
the redirection operator.

e.g.

abc2abc file.abc -t 2 > newfile.abc

Please report any bugs to jra@ecs.soton.ac.uk
-------------------------------------------------------------------------

mftext - MIDI file to text

This gives a verbose description of what is in a MIDI file. You may wish
to use it to check the output from abc2MIDI. It is part of the original
midifilelib distribution.

-------------------------------------------------------------------------
