November 16 2007, TclAbcEditor provides allows you to replace a tune in a music collection in one abc file.
The program allows you to display an abc file in standard music notation, send it to your printer and play the tune in any tempo or key on your audio card on your computer. Furthermore if you have the music score of a tune that you like, you can create your own abc file using any text editor (or the one included in this program), and hear how it sounds like when it is played on your computer.
There is already a database of several thousands of folk tunes notated in the abc format that is freely available from web sites. There is also lots of software, either freeware or shareware, for playing these files on your computer or printing it in music notation. Some of these programs are command driven. Thus to produce a postscript file, from an abc file you would type a command like "abc2ps sample.abc 1-3 -P -X -O out.ps" which would produce a file called out.ps. You would then display the program on the screen by typing "c:/program files/ghostgum/gsview/gsview32 out.ps".
Runabc.tcl is a script that acts as a front end and user interface to these command driven programs. It allows you to to perform actions by pointing and clicking with your mouse rather than typing long commands. It is written in a language called Tcl/Tk that has been ported to many different platforms. Thus you can run this script on a PC running Windows 95/98/00/ME/XP or NT 4/00, or on a Macintosh or a Unix workstation as long as Tcl/Tk version 8.4 or higher has been installed on this machine. Runabc.tcl no longer works properly with older versions like Tcl/Tk 8.3. To tell which version you are running, type in the command info tclversion while you are in the wish or tclsh command console.)
As this script is merely a front end, you need to install the other programs abc2midi, abc2ps, yaps, a midi player, and a postscript file viewer on your system. Sources for this software are indicated on the page describing the installation.
As the installation of all the package components is not a trivial matter, (see install.html for more details), the intention of this page is to give you an idea of what the program does and how it operates. Note the appearance of the windows shown here may differ depend on operating system you are running Tcl/Tk and its settings. Also note that this guide may not always be up to date with the minor improvements in this program.
On Windows, you may put runabc.tcl and runabc.ico, in any folder. I usually put it in a folder called something like abc and add the various other executables that are needed like abc2midi.exe, abc2ps, etc into the same folder. For Unix, you have the same flexibility however the folder must have execution/read/write access for all users. Runabc will create a tmp directory and it will also create or modify the file runabc.ini in the same directory. For multiuser systems, it is recommended that each user has his private copy of runabc.tcl somewhere in his home directory since that is where the runabc.ini file will be stored. You start runabc.tcl on Windows by clicking on the file runabc.tcl. Assuming Tcl/Tk is installed on your system, the Tcl/Tk interpreter will start and automatically run runabc.tcl. On other systems such as Unix, Linux and etc. it may be necessary to start runabc.tcl using a command line such as "wish runabc.tcl".
The main screen to runabc.tcl consists of a series of buttons and a list of tunes contained in an a specific abc file.
If you are running the program for the first time, you should first click the Options menubutton. This is the button showing a wrench. The following menu will be displayed. shown below.
In order to be able to display postscript files on your screen, you will need to specify the path to a postscript viewer program besides the label ghostview. For Linux I use gv, for Windows I use gview32.exe. Sites where you download these viewers are indicated in the install.html web page. The postscript viewer program is called automatically when ever you click on the Display button. This is the button showing an icon of a printer.
REM execute gsview32.exe with the -e option "C:\Program Files\Ghostgum\gsview\gsview32.exe" -e Out.ps REM convert Out.ps to out.pdf using gswin32.exe "C:\Program Files\gs\gs8.53\bin\gswin32.exe" -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -q -sOutputFile=out.pdf Out.psYou would now specify the path to gsview.bat in the ghostview entry box. Note you may need to edit gsview.bat if gsview32.exe and gswin32.exe are not in the same locations on your system.
Though the script has its own editor for creating and editing abc files (with many special features), you may prefer to use your own editor (like vi, emacs, notepad...) for everyday work. You specify the path to the editor in the adjoining entry box.
When you edit a particular tune included in a compilation of tunes in a abc file, runabc extracts this particular tune and saves it to a abc file with a name derived from the title into a specified directory. The name of the directory is specified in the entry box besides work folder. You should specify the name of a folder to keep everything organized. If the folder does not exist, it will be created automatically. It is necessary to do things this way to remain compatible with the other editors.
Abcmatch is a program for performing searches on abc databases on your hard drive. You will need it when you use the find utility on the menu screen.
Now return to the Options menu button and configure the options for the midi player (Options/player 1).
You have the choice of specifying two midi players with their options. If you only have one midi player available then ignore player 2 configuration menu item. The selected midi player is chosen from the abc2midi options (second row of buttons).
This configuration page is used to specify the path name to the midi player, any required run time options and the protocol for passing the midi files to the midi player. All midi players handle single files. Others can accommodate a list of midi files, while some will even accept a folder of midi files. The manner of passing the midi file(s) to the player is specified by the protocol. You may use any of the three protocols even if you are only passing one midi file to the player, provided the player supports this method. If you are passing a folder then the folder name should be given in the options entry box and the 'folder' radio button should be selected. It is necessary to do this manually since some midi players require the folder name to be preceded by a flag. Note that in some operating systems there may be a limit in the length of the string containing the list of midi files.
When you click the Play selection button (shows a picture of a speaker), runabc creates a file called X.tmp containing the selected abc tunes and puts it in a tmp folder in the same folder from which runabc.tcl is invoked. (If you wish to use a different subdirectory name instead of tmp, you should edit the contents of the midi_dir parameter in the runabc.ini file.) Prior to running abc2midi, any midi files beginning with the letter X are removed from the tmp directory. Then abc2midi is executed with the file X.tmp and it creates a new set of midi files. These midi files are sent to a designated midi player using one of three protocols. You are allowed to designate up to two possible midi players which have their own option entry box and protocol. A convenient way for viewing the X.tmp file is to click the edit/view X.tmp menu item. Line numbers are added so it is easy to review the error messages from abc2midi. A sample of such file is shown here.
Go to the menu item Options/font and select the font size and weight ideal for your display.
The font size, is very useful for adjusting the size of all windows and buttons to match the resolution settings of your screen. The program uses two different fonts, one for all the buttons and controls and the other to display the table of contents and the editor. Any font is suitable for the former, but you should use an equally spaced font (eg fixed) for the table of contents and editor. You enter the names of the fonts in the entry box followed by a carriage return. For tcl/tk 8.4 and higher a spinbox at the bottom allows you to browse through the fonts available on your system. Samples characters of the font "abcdefg" are shown at the bottom right. For tcl/tk 8.3 and lower, you can get the list of available fonts by typing "font families" while running the Tcl/Tk interpreter (usually called wish). On my system (Windows 98) the list includes Courier, Arial, Century, Comic and many others.
If the font that you choose results in an unreadable screen when you run the script runabc.tcl, you can press the button labeled Reset. Alternatively, you can edit the runabc.ini file and changing the entries for font_family. In the worst case you can delete the entire line and tcl/tk and runabc will try to restore it to something reasonable. If the font you choose does not exist, Tcl/Tk chooses a standard font.
The abc standard uses a blank line to separate abc tunes in a compilation of tunes in a file. Unfortunately, different computer platforms use different end of line conventions, (eg. carriage/return linefeed, carriage/return, or linefeed) which get in the way of this convention. On unix, there are programs called dos2unix, unix2dos, mac2unix, etc. which convert a text file to the appropriate convention. If runabc has difficulty detecting the blank line or sees blank lines every where, it is suggested that you tell runabc to ignore this convention by ticking the check box ignore blank lines. Since each tune is supposed to start with an X: reference number, runabc will use this as an indication to separate tunes. Runabc requires that every tune has an X: reference number, T: title, and K: key signature.
If you are running on Windows, operating system, you will see the button Register abc files. Clicking this button will display the following window which will allow you to associate abc files with runabc.
Normally it is only necessary to create this association once. The association remains permanent (unless changed by another abc application). If you later decide to move runabc to a new directory, then it is necessary to reestablish the association the same way. If at sometime you wish to destroy or change this association, you can do this by going to 'Folder Options' which is accessed from the file manager under the menu item view or toolbar or somthing else (depending on which version of Windows you are running -- 95,98,ME,etc.); then select 'File Types' find ABC, select it and take the appropriate action (eg remove).
When you double click on abc file, windows starts up runabc and loads up the selected abc file. However, the current directory is the same directory where the abc file was found. This poses a problem, since the runabc.ini and tmp directory is normally in the same directory as where runabc was installed. To fix this problem, this function also stores the path name to the runabc install directory in the registry. Runabc determines whether runabc.tcl or runabc.exe are found in the current directory. If they are not found, then runabc looks in the registry to find out where they are located and changes the current directory to this location. Now it is possible to load and store the correct runabc.ini file.
Note if you use runabc.exe or runabc.kit, you should associate the abc files with runabc.exe or runabc.kit.
If you want a similar feature on other operating systems,
it will be necessary for you to set it up yourself. You can put
a link a runabc link in your ~/bin directory (i.e. in your home
directory), so that it points to the location of runabc.tcl.
For example, you would create the link by typing.
ln -s ~/abc/runabc.tcl runabc
Now you can start up runabc from any current directory.
Furthermore, if you enter
runabc sample.abc
where sample.abc is some abc file in your current directory, then
runabc will start up with this file preloaded. However, in order
for this to work properly, you also need to create a new environment
variable called RUNABCPATH which points to the folder where
runabc.tcl is stored. On my system, I added the following to my .bashrc file.
export RUNABCPATH=~/abc/
If this is not done, runabc will not cd to the directory where
runabc.tcl was installed and will not find the runabc.ini file.
At this point you are ready to start using the program. Click the file button at the top left, and use the file browser to select the desired abc file. Alternatively, you may enter the full file pathname in the entry box and press 'return'. (The return key can be used to remove the focus, i.e. flashing cursor from many of the entry boxes you will see.) A list of all the tunes in that file should appear below. (If no index appears on the screen, it may be necessary to convert abc text file to unix, dos format or whatever is appropriate for your machine using utilities like dos2unix, see readme file for more discussion.) If you do not have those utilities, you may be able to accomplish this using the edit/copy to file command on the runabc console and create a new copy of the tunes in the abc file. This is discussed later.
Select a tune, using the mouse pointer. If you right click a particular tune, a short summary will pop up in a separate window. Then click the play button, to hear it on your speakers or the display button to view the tune in musical notation. You can select several tunes by dragging the mouse pointer, or clicking with the shift key (or control key) depressed. When you click the play or display button, all the selected tunes will be converted to midi files or a postscript file.
Other bindings:
the arrow, page up/down, home, end keys allow you to scroll up and
down the table of contents. The cntl-slash and cntl-backslash allow
you to select or deselect all titles in the table of contents;
the cntl-home activates and selects the first title; and the cntl-end
activates and selects the last title. In addition the p key or
When you right click any tune in the table of contents list box, a short
descriptor of the tune will appear in a separate and resizeable window.
If you want the entire tune shown then set 'summary_enabled' to 2.
If you click the Play selection button (which has a speaker
icon), the program will convert the specific tunes to a midi files,
store them in a specific directory (by default tmp in your current
directory) and then attempt to play these midi files using the midi
player that you had designated in the configuration
property sheet. Any error or warning messages reported by abc2midi can
be viewed by clicking the button labeled Console. (The Console
button appears as a rectangular box with a blue bar at the top.)
Note abc2midi is more stringent than abc2ps in the use of
the P: field. The P: field has sometimes been used to put additional
annotation rather than designate the parts and how they are repeated.
The error and warning messages produced by abc2midi and yaps may
appear in blue print. If you click on one of those messages, runabc
will display the input file (X.tmp) in a separate window and the line
associated with this error message will be highlighted with a grey
background. Do not attempt to edit the contents of this window since
you cannot save the results.
If you click the button labeled Display, the program will create
a postscript file (Out.ps) of the abc file by calling the program abc2ps
or whatever with the appropriate parameters and then display this file by
running ghostview. A sample view of the postscript file is shown below.
Again you can view any messages reported by abc2ps by clicking on the
button labeled console. Abc2ps depends on the X: reference number to find
the selected tune so be sure there are no duplicate numbers or the wrong
tune could be selected. Note abc2ps and its variant may not handle all
forms of line/end conventions even though runabc, yaps and abc2midi can
handle them.
Runabc has many advanced features to control how the midi file
or postscript file is created. You get to these features by clicking
the menu button abc2midi or abc2ps (may also be labeled yaps or abcm2ps).
When you are creating and playing the midi file, the Play options
menu button provides options for changing the tempo, transposition, assignment
of voices to melody and accompaniment, turning off chordal/bass
accompaniment, turning off the melody line. (This button shows a picture
of a hammer and a pin, standing vertically.) Most of this information
is rarely included in the midi file, so it is necessary to automatically
insert it before sending it to abc2midi.
Prior to calling abc2midi, runabc creates a copy of the tunes you wish
to play with this added information in the file called X.tmp which is
stored in the tmp subdirectory. Abc2midi then processes the file X.tmp
producing the desired midi files. You can view, but not edit the X.tmp
file using the menu button edit/view X.tmp. (The edit button
shows an icon of a pencil writing on a sheet of paper.)
This is often useful, since the error messages reported by abc2midi
(viewed when the console button is clicked), refer to lines in the X.tmp
file. Line numbers are automatically inserted by the runabc viewer for
your convenience.
If you wish to change the tempo or choice of instruments in the
midi file, you should click the button labeled Play options
and select tempo/pitch. A new property sheet will appear as shown
below. On line help appropriate to this sheet is available if you now
click the help button.
Most abc files do not have any tempo or midi program indications, so
it does not matter whether this program ignores or uses these
indications. This also provides complete freedom to
change the tempo or instrumentation. However, there are a few abc
files (in particular the multivoice files generated by midi2abc)
which preserve these indications. If you wish to ignore these
indications, check the appropriate boxes in this property page.
The tempo slider allows you to control the tempo in quarter
notes per minute. The transpose slider allows you to transpose all
channels up or down by a number of semitones. If you move the
transpose slider, remember to restore it back to zero. Its position
is stored in the runabc.ini file until you change it.
If you have specified an alternate midi player in the configuration
property page, you can select the desired midi player to use here.
Note: for these changes to take effect, the play mode must be aborted and
the play button must be clicked again.
By default all MIDI tracks are mapped to the acoustic piano. If you
wish abc2midi to map the melody track to another instrument, you should
select Play options/melody and the following sheet will be
exposed.
If you click on the button labeled Recorder in the figure, a cascaded
menu will allow you to choose a different instrument from a set
of 128 General Midi instruments.
A volume slider on the next line adjusts the volume level of the melody.
Abc2midi requires 3 numbers to specify the volume level. They are
the velocity of the note on the on the first beat, the velocity
of the note on the offbeat, and the velocity of all the remaining
notes. The velocity for the first beat should be higher than
than the offbeat and similarly the velocity of the offbeat should
be higher than the other notes. You can edit these in the adjoining
entry boxes, or you can adjust them automatically with the volume
slider. The volume levels in each entry box should not exceed 127.
The gracedivider is a new feature which replaces the old
%%MIDI grace a/b (still available in abc2midi but no longer
supported by runabc). In the old method, you would specify would
part of the note could be used for expressing a grace and this
ratio would remain fixed. Unfortunately, the length of each grace
note is now dependent on the complexity of the grace group and
the note to which it was applied. In the new method, the grace
note always has a fixed duration, eg (1/64 th note) irrespective
of where it occurs. The time is still taken from the following
note but the ratio of grace notes to the following note is now
variable. If the following note is too short to handle the grace,
then the grace is ignored. You specify the duration of the grace
notes using the new %%MIDI gracedivider b command. Runabc supports
this new command by allowing you to specify the b value. This
value specifies the divider applied to the standard note length
as specified by the L: field command. For example, for L:1/8 and
b=4, all the grace notes would be 1/32nd notes. (Note that
in order for this feature to work correctly the version of
abc2midi must be 1.44 or higher.)
Broken rhythm ratio adjusts the times for > and < indications
in the music body (eg. B > c). The default is 2 to 1, meaning
the notes are played as B4/3 c2/3 even though it is printed as
B3/2 c1/2. If you want it to be played as written then you should
set the ratio to 3.
The parameter beat divider is used for determining
which notes are to be considered as strong (off beat). If the time
signature is x/y then each note is assigned a position 0,1,2,...x-1
depending on its position in the bar. If its position k, is an exact
multiple of n, then that note is considered strong and is assigned a level
of b. If you need finer control, you should insert the
%%MIDI beatstring string into your abc file. This is documented
in the abcguide.txt which comes with the abcmidi distribution.
The default button restores all these parameters to factory
settings.
The pattern of the chordal/bass accompaniment is determined
by the time signature of the music. You have the option of choosing
another pattern by selecting the gchord menu button.
Be sure to check the checkbox my gchord or else abc2midi will use
its default pattern. Clicking the gchord button will drop
a cascaded menu. The gchord pattern is specified using the codes,
f (bass fundamental), c (chord) and z (rest). A number after the
codes f,c and z specifies the duration. For example the default
gchord string or 3/4 time is fzczcz. The duration of the gchord
string is always normalized to one measure so that f4c2 and f2c
denote the same thing.
Besides the f,c,z codes, no codes g,h,i,j,G,H,I and J were recently
introduced for handling broken codes or arpeggios. These codes address
the individual notes in the chord starting from the lowest note
in the code. The lowest note is not necessarily the root if the
chord is an inversion. For example for the C major chord, the
ghord string ghih would play the sequence CEGE for every bar.
The code GHIJ would play the same notes but at a lower octave.
If your abc file uses different voices (V:1, V:2, ...) then you should
select Play options/voices to control the assignment of
the voices to the different MIDI instruments, volume levels and
panning parameter. If the tune has already assigned instruments
to the voices and you have not requested to override all MIDI
indications (in the abc2midi options/tempo-pitch page), then these
changes will not be effective.
The panning parameter is useful if you have two
speakers. You can shift the voice towards the left or right speaker.
If you wish to turn a voice off, simply set the volume level to zero.
Be sure to return the level back to normal when you are done, since
all settings are saved when you exit from runabc. These options were
found to be useful when you are trying to track errors in one of the
voices or you are playing a long with the computer using your musical
instrument.
Similarly, you can also configure the appearance of the postscript
file by changing the parameters passed to the program abc2ps or yaps.
To do this, you should click on the button either labeled abc2ps options
or yaps options depending on which postscript converter you had indicated
in config/executables window. A dialog box with entry
boxes appears as shown below. (If abc2ps is your selected converter, then
a different property page will appear.)
For the many other postscript file creators, you can select the
other radio button in the config/abc executables menu page.
When you click on the other ps button, the following configuration
page would be displayed.
You specify the path name to the executable and the program options
in the two entry boxes provided. You may specify as many options as
you wish, but you should ensure that the program produces an output
file called Out.ps. The input abc file name will be automatically
provided by runabc. Unless you are running an old version of runabc
(prior to 3.95 April 9 2003) you should no longer specify the selector
parameter -e $xsel. Runabc now copies all the selected tunes to
a separate file (usually X.tmp) in the tmp folder and the postscript
creator processes this file. This avoids several problems (eg.
duplicate X: reference numbers).
When you click the display button, runabc calls
this converter with these options producing an Out.ps file which
is then sent to a postscript viewer such as Ghostview. If there
are any problems, you should click the Console button in
order to see any of the error messages.
Abc2abc is one of the programs which comes with the abcmidi
package and provides many useful formating and conversion functions.
As its name implies, both the input and output are abc files.
(If you do not redirect the output to a file, the output will be
printed on your command window.) Abc2abc is commonly used to
transpose an abc file to a different key signature; however, it
provides many other formatting functions. The documentation in
the readme.txt file is quite concise and for the benefit of
some runabc users, I shall provide a more detailed description
below.
The abc2abc interface reflects nearly all the run time
options which are listed when you run the program with no options.
Thus if you tick the checkbox halve note lengths, abc2abc would
be run with the parameter -v. The execution string is displayed
at the bottom of the main window after you click the button
labeled abc2abc near the bottom. If you had selected,
the radio button output to editor, then the abc2abc would
be written in a file edit.abc and displayed in TclAbcEditor
which will be described in the following section.
If you selected the radio button output to clipboard the
results would be placed in a clipboard where it can be accessed
by most textbased editors. (For example, cntl-v will access the
clipboard on the Windows operating system.)
To illustrate the effect of various abc2abc options, consider
the following simple example adapted from
http://www.leeds.ac.uk/music/Info/RRTuneBk/tunebook.html
Ticking the box new spacing will result in the
following output which would produce a cleaner output
when converted to a postscript file.
The option use [] for chords and slurs is an
ancient remnant when abc files indicated chords
with +ACE+ instead of [ACE]. Presently, it is fairly
difficult to find abc files using the old convention.
Abc2abc would convert the old convention to the new
standard if this option is selected.
Running abc2abc with the option double note length
produces the following output.
Some musical instruments automatically transpose the music a certain
interval. For example, when clarinet plays a piece written in C major,
the music comes out in Bb. Ticking the transpose button and entering
a number -1 in the semitones entry box produces the following output.
The placement of linebreaks affects the clarity of the abc
file and the appearance postscript converted file. Ticking
the linebreaks every n bars allows you to place linebreaks
at regular intervals. For example if n is set to 3 the output
would look like
The last option extract only voice is applicable to multivoiced
abc files. It will produce an abc file with only the selected voice.
Abc2abc can perform several operations at a time if more than one
option has been selected. It has not been tested with all combinations
of options, so it is recommended that the user keep things simple.
The program performs only one pass through the abc file and the
source code has become quite complex in some places. Other useful
formatting features such as diatonic transposition has been
introduced into the runabc builtin editor which is described
in the next section.
The editor requires Tcl/Tk version 8.4. It will not run
properly with older versions of Tcl/Tk. If you
are not sure which version it uses, you can run the
sanity check by pressing going to the config/sanity check
menu item. Alternatively you can press the alt-s key on the keyboard
as soon as runabc starts and look at the runabc.out
text file. (Be sure that the runabc window is in focus,
or else the program will not pick up the alt-s key.)
Syntax highlighting is done in real time while you are editing
the text; however, if for some reason the highlighting appears incorrect,
you can restore the correct colours by clicking the clean/retag button.
The choice of colours for syntax highlighting can be changed by
editing the variables edit_body_colour, edit_field_colour etc in
the runabc.ini file. You can find out the names of the various colours
by running one of the listboxes demos which comes in the Tk Widget
Demonstration package in the Tcl/Tk distribution.)
The editor does not copy the global headers which appear at the
beginning of a abc file; however, if you do require them you can
import them using the file menu command 'insert global header'.
The undo button or the
Before running any editors, you should designate your
favourite editor in the Options/abc executables menu page.
If you have not done this, then this editor will remain your default.
However even if you have designated a different editor, you can still start
this editor from the menu item Edit menu/TclAbcEditor.
Secondly, you should specify a directory name in the
work folder entry box where your work will be stored.
Don't worry if the directory does not exist. It will be created
automatically if it is not found. The directory is relative
to where you are running runabc. Thirdly, you should ensure
that a fixed spacing font (the same one used in the TOC) is chosen.
This is the default unless, you have reconfigured this in
the Options/font.
Assuming that you are editing a particular tune in a file containing
many tunes, then runabc will copy this tune to a separate file,
with a file name derived from the title of the tune. The file will
be placed in your working folder which you should have designated
in the Options/abc executables property sheet. Then this
file will be opened by either your own editor or by TclAbcEditor
depending on whether you choose edit selection or
TclAbcEditor. If you choose the menu item,
edit file, then the active file containing all the tunes would
be opened by the editor. Note that if you decide to do it this way,
you should have runabc reread this file (by reopening the same file),
after you have done the save so that its table of contents is resynced.
Otherwise, runabc may behave strangely and play the wrong tune that
you selected. Also note, this method is not as safe as no backup
is made unless your particular editor does this automatically.
TclAbcEditor, uses the Tcl/Tk Text Widget standard
bindings described here. These bindings are also listed in the
runabc context help.
In order to save the results, you must go to the file/save or
file/save as menu item. On Unix systems, you may hear a bell
during a file write operation; however, I did not manage to get the bell
working on Microsoft Windows Tcl/Tk. If you have modified the file
and did not perform a save, the editor will ask you whether you
wish to save the file prior to exiting.
If you are editing a particular tune in a file containing a
collection of tunes, you can replace that tune in the collection
using the menu item file / replace tune in collection .
The program will also create a backup file of this collection,
however it is recommended that you have an independent backup.
If you are creating a new tune using the menu item Edit menu/new tune,
will automatically create a file edit.abc for a lack
of a better name. This file will have a template (X:.. T: etc.)
for you to fill in. Note that you should do a save as
to specify the desired file name, or else you may remain with
a file called edit.abc which will be overwritten or deleted many times.
At this point, I shall describe the many special features of this
editor. Most of these features all called up from the menu items clean,
play and tools; however, other features such as the
guitar chord toolbox and grace notes toolbox appear on the right.
The program assigns an initial width of 60 columns for the editor.
If you need more space, you can move the toolbox out of the way
or you can expand the window. If you always want it to start with
more than 60 columns, you can change the value associated with
the variable edit_initial_width in the file runabc.ini to something
a little larger.
Other features are accessible from the cascaded menus at the top
of the window. Many of the menus contain an individual help
button that provides information relevant to these functions.
Many of these features are not applied to the entire file you are
editing but to only the selected area. You select an area by sweeping
the mouse pointer while holding the left button down. (Other methods
are described in the online help.)
A lot of abc tunes contain a single voice without any harmony.
This sounds rather plain when it is converted to a MIDI file.
The addition of guitar chords (contained in double quotes)
greatly enhances the quality of the reproduction. Abc2midi
will generate a chordal/bass accompaniment that helps the
listener to quickly establish the key of the music and
the beat of the tune. The guitar toolbox on the right helps
you to choose and place guitar chords.
There are general rules for adding guitar chords. If the
music is in a major key signature, eg. you should stay with
the major chords which are I, IV and V. For C major they would
translate to G, C and D. For minor key signatures which
includes modes like Dorian and Phrygian, you should also
include the minor chords II, III, VI, VII. You are also free
to use the IV and V when appropriate. The editor automatically
figures out the chords appropriate for the key signature
and places the list in the guitar chords labeled frame
on the left.
To place a chord, position the edit window cursor at the appropriate
spot in the music, and then click one of the chord menu buttons. If
the cursor precedes an existing guitar chord, you can replace
it with another chord the same way. Usually a guitar chord
should be specified for each bar, but if it has not changed
in the previous bars, it may be left out.
If the key signature has changed, you may get the recommended
chords for the new key signature by clicking the refresh button.
To change the chord type and inversion type for a specific chord,
first indicate which chord you wish to modify by selecting it from
the list in the guitar chords frame, here Bb Cm Dm etc.
When you select it, the chord will still be placed in the
position of the insert cursor in your edit window but the
corresponding radio button will also be ticked. Now press
the types menu button and select the type of chord you
want. (There is some duplication in this list.) For example,
if F is your active chord and you selected 7, then F would be
changed to F7. If this is the chord you want then just click
F7 and the guitar chord F7 will replace F at your current
cursor position assuming you had not moved the cursor.
If you also want the first inversion, then click inversion
to change F7 to F7/A. This chord type and inversion type will remain
fixed for that chord until you close the edit window or click
the refresh button.
Below the inversion button is a list of suggested chords
that should follow based on the chordal progression. You do not
have to follow this progression, however the music may sound strange
if you do not.
The grace toolbox which occurs below the guitar toolbox, is used
for inserting various grace notes prior to
a specific note in the file. Position, the cursor just before the
note you want to grace (eg. A) and then select one of the grace sequences.
For example if you click trill, {ABAB} will be inserted just
before the note. If you change your mind and want slide, you can
click that button and the grace note sequence will be changed. This
only works if you have not moved the edit cursor and it is positioned
just before the start of the trill. The sequence labeled cut
is more formally known as appoggiatura. The sequence labeled strike
is musically known as acciacccatura. Other sequences are mordent and
reverse mordent, slide and trill.
The button labeled cfg is used for configuring the grace
note labels and sequences; however, their labels should be seven
or less letters. To make a change, place the cursor in one of the
entry boxes shown below and type in the new name or sequence followed
with a carriage return. These changes will remain the next time
you start runabc. To return to the initial settings, click the
reset button.
The grace note sequence is indicated by a series of small positive
or negative numbers. They indicate the relative pitch offset between
the grace note and the note to which it is being applied.
The cascaded menu item clean contains numerous functions.
The retag item will retag the field commands and body of
the file in different colours. Otherwise any new items that you
have added will remain in black. erase all does what it says.
You end up with a blank buffer.
You can remove all redundant guitar chords. (A guitar chord is
redundant to abc2midi if it has not changed in the previous bar.)
You can remove all guitar chords or anything else included in
double quotes from the designated portion of the file.
You can remove all grace notes or anything else included in curly
braces from the designated part of the file.
Other functions such as remove inline voice fields,
remove backslash continuations and remove tab chars
are also self explanatory. These functions are handy when you
are extracting a single voice from a multivoice file using the
edit/extract part menu function.
There are special tools for transposing all the notes in certain
section of the edit window.
You can replace each note in selected group of notes with the
chords. For example the notes FAA FAd can be converted
to [FD][AF][AF] [FD][AF][dB] by selecting tools/chords/third.
The above operation can be reversed using the tool replace chords.
For example if your selected region includes
This tool is useful for formatting the music into separate
voices. For example you can change,
The function align bars will cause the editor to
insert spaces before the bar lines so that they line up vertically.
This is done without changing the way the tune would be converted
to a postscript or midi file. The image below shows part of a
tune before the alignment.
For many folk dances, drum accompaniment may be more appropriate.
The MIDI standard assigns one of the channels (usually 10) to
be used for drum accompaniment. This means that any MIDI notes
indicated in this channel is interpreted as a drum hit.
There is a choice of more than 45 percussion instruments
which is indicated using the byte normally reserved for the
pitch. Since many percussion instruments such as cymbols,
triangle, tambourine, ... do not have a pitch associated
with the sound this does not pose any problem.
The abcguide.txt indicates how to set up the drum pattern
using several of the %%MIDI extensions of abc2midi. The editor
assists you with a special tool box for incorporating the
drum accompaniment tools/drum. This tools allows you
to create a drum pattern and patch it your abc tune. A simple
pattern is indicated here.
There are two scrolled listboxes that are used to map the
individual drum hits (eg d2) to particular drum patches. The left
box shows the current mapping for each drum hit.
To change, the mapping select a particular drum
hit in the left listbox and then click on a desired patch
shown in the right list box. The mapping should change immediately.
The beige label immediately above the list box shows the
last selected patch. Whenever you click the enter button, all the drum
hits will be changed to that patch.
The play button will allow you to listen to the particular
drumstring. It will create and play a midi file with 8 bars of
this drumstring. The paste button will paste the drumstring in
your file being edited in the abcedit window.
The %%MIDI drum command will be pasted at the position of the insert
cursor. (Don't forget to insert the %%MIDI drumon command in the
body of the music.)
You can see some sample dances where it is used in the
collection of international and Israeli dances that I have
transcribed. I have also included the abc files drumdemo.abc
and drumpat.abc, that you may wish to listen to. The latter
file is helpful for learning to associate the sounds of the
MIDI percussion instruments with their names.
There is a separate display button for converting the entire
contents in the editor to a common music notation postscript file
and displaying it on the computer.
The edit button now gives you a choice of editing the entire
abc file or just the selected tune. If you edit only a selected
tune then it will be copied into a file called edit.abc in the
same directory as runabc.tcl. This file will then be renamed to
another file based on the title of the first tune in your selection.
The renamed file will be placed in a work folder created by runabc,
called workfold. In event there is another file with the same name,
in the work folder, it will be replaced. You may use the save-as button
to save the tune under a different file name, but under no
condition overwrite the original file containing the
collection since only the contents of the edit window are copied.
When you do any editing, it is strongly recommended that you keep
backups somewhere else just in case the unexpected occurs. Further
notes about the edit button may be found in the runabc.txt file
included in the runabc.zip distribution.
The play and display commands always rereads the original abc
file, so you must save your changes to the disk file to hear
the edited results. I always prefer editing a single tune files
and update the compilation abc file using cut and paste or
something similar when I am finished editing. I prefer to use
the editor with which I am most familiar rather than the Tcl/Tk
text widget. In any case, other people may have different styles.
Also be aware that if you are editing a compilation or
deleting, adding or renumbering a tune, the table of contents
window (title index) will need to be updated by rereading the
same file. Otherwise, the play, display and edit selected tune
may go to the wrong tune.
The edit/new option will create a template edit.abc file.
Copy and renumber will do the same as above but it will
renumber the selected tunes increasing sequentially from a selected
number.
Append will append the selected tunes to an existing file,
preserving the original numbering.
Append and renumber will do the same but renumber the
selected tunes.
The copy combine parts function is specificly designed to
reformat Laura Conrads renaissance music in her allparts.abc files.
Each part is written as a separate tune rather than a separate
voice. Therefore it is not possible to create a midi file with
all parts playing simultaneously. This function combines all
the parts into one tune, giving each part a separate voice.
Duplicate titles, and lyrics are removed. When using this function,
you must first select (highlight) all the tunes that you wish
to combine. Like other copy functions, you will prompted for
the name of an output file.
Caution: do not try to copy over the source file already
displayed in the table of contents.
The function 'separate tunes' splits a multitune abc file
into separate files each containing one tune and puts the files
into a directory with the same name as the input file (without
the abc extension). You should select all the tunes that you
want to extract in the TOC before using this function. To select
all tunes press cntl-/ (i.e. control-slash).
For multivoiced files, the first few bars of each voice will be
copied. The function handles inline voice commands eg \[V:2\]\
but they should be placed at the beginning of the line.
If you want to produce incipits for any a selection of tunes,
first copy the selected tunes to a separate abc file using
runabc edit/copy command and then load that file into the TOC.
The Extras button shows a picture of a wheel with teeth.
If you are like me, you probably have a collection of several
hundred abcfiles. Finding a specific tune can be quite laborious.
If you have placed all your abcfiles into a specific folder, there
is now a tool which makes it much easier to find a specific file
or tune. When you click the button labeled 'find', a new tool will
be displayed on your screen.
If this is the first time you are running this tool, it is
necessary to enter the path name of the folder where all the abc files
are located. This folder can contain sub-folders with more abc files.
Now you are all set up. Just enter a word or two in the title in the
search string entry box and then press carriage return or click the
button labeled search. The program will search every abc file it
finds for the specific word, and display the title of tunes in the
listbox. (In this case, we were searching for any tunes with the word
maggot.) If you have a big directory and some large files, please allow
some time for the program to perform the search. You may abort the
search anytime if you are getting too many hits.
To access any tune in the list box, just click that entry and
the table of contents of that file will be displayed. Furthermore, the
table of contents will be scrolled to the position where the file is
visible.
The tool does not distinguish between upper and lower case letters;
however, you should avoid punctuation marks and special characters
as they mean something special to the string matching algorithm.
The string you enter is interpreted as a regular Tcl expression using
the regexp. As a result you can make fairly complex searches. For
example,
There is also another tool that allows you to search for abc tunes
based on the content in the body. The matching tool does not do a
straight string search but removes extraneous information such as
guitar chords, grace notes, decorations and compensates for different
key signatures. You can perform exact matches or approximate matches.
Furthermore it is not restricted to the first few bars of the tune. It
will find a match anywhere in the tune. To use this tool, you enter
one or more bars from the tune in the body entry box using abc notation.
Also specify the meter, note length and key signature in the entry boxes
M: L: and K:. Then press the match button. If you are using TclAbcEditor,
then you can copy this information by clicking on the transfer
button. The play button allows you to listen to this template. The
output of the search will be displayed in a scrolled text window as
shown below.
The purpose of this function is to allow you to go from a
full score (i.e. music for all instruments encoded in separate
voices) to the sheet music of one part (one instrument).
Musicians do not like turning pages while performing and
would prefer if all the music fits on one or two pages on
their music stand; so they would prefer to have the music
for just their part. If there is a long series of rests where
they are not playing, it is preferable that they are grouped
together into one long rest. Sometimes their instrument
automatically transposes the music to another key, so they
would like the sheet music to be transposed accordingly.
In contrast when the music is being notated, it is preferable
to have all the parts together and interleaved.
The multivoice extraction function attempts to address
this problem. First there is the problem of extracting and
possibly transposing one of the voices. This is not trivial
if the voices are interleaved. Next there is the problem of
combining a sequence of bar rests. They would be indicated
for each bar so that the music interleaves properly.
For historic reasons there are two conventions for indicating
multirests. The old notation required by abc2ps uses something
like "15"z8 where the number 15 indicates 15 consecutive bars
and z8 is the length of a rest covering one bar. The newer notation
would indicate this as Z15, where the upper case Z implies a
full bar rest. Abc2midi, abcm2ps, yaps and other applications
only understand the new notation.
Now here is a description of how this is done. First you
indicate which voice number and any transposition in the first
two entry boxes. Tranposition is indicated by an integer specifying
the number of semitones to shift the music. Positive numbers shift
the pitch upwards. Negative numbers shift downwards. Zero implies
no transposition. If you tick the checkbox condense rests, then
a line of music written as:
The extraction, transposition and rest condensation are all done
by the external application abc2abc. In fact, when you perform
the action the exec command appears appears at the bottom of
the window for your information.
You can save a tune as a midi file using the edit/save midi file(s)
menu item. Runabc will prompt you for the name (path name) of the midi file.
It is not necessary for you to enter a mid extension, but if you include
it the program will not insert another one. If you wish to make many
midi files at once, just select the tunes in the TOC and use the same
function. Recall that the
The midi files will be named automatically in one of two ways depending
on the radio buttons selection. The midi file name can be derived from
the tune's title or else it can be derived from its xref number in the
file. If you derive it from the title, the maximum number of characters
in the tail part of the file name is by default 8 letters. So the midi
file derived from the tune "April Waltz" would be called April_Wa.mid.
You can change this default by replacing the value in the adjacent entry
box. Note that if there are several tunes with the same title, that
the same midi file may be overwritten several times.
Alternatively, you can choose to derive the midi file name from
its xref number. The names of the midi files will be based on the
name of the open abc file (in the TOC) and the X reference numbers.
Thus if your active file is waltz.abc and you selected tunes 5 and
8, the file names will be waltz5.mid and waltz8.mid. You can choose
a different root name by replacing the string in the adjacent entry
box.
When you click the continue button, the program will proceed
to create the midi files. All the files will be put into a separate
folder that you will select. If the folder does not exist, you will
can enter its name in the entry box and the folder will be automatically
created.
Besides abc, there are probably 50 or so music notation formats in common
use. Many of them are proprietary to a commercial product
and there are few applications for converting one format to another.
Fortunately all music notation programs usually have provision to
export the music in MIDI format. This provides a means of converting
the music into abc format. Therefore, a lot of effort has been
made in providing a good tool for converting a MIDI file into an
abc file. Runabc provides three main tools for handling and viewing
MIDI files. They are midi2abc, midishow and mftext which are all
accessible through the extras menu. They shall be described in
detail.
To get to the midi2abc interface, select the meu item
extras/midi2abc. The following graphical interface will
be displayed.
To use it, you first need to select the input midi file using the browse
button. You also need to designate the name of an output abc
file that will be created. Now click on the
lower left hand button midi2abc which will execute
the midi2abc.exe program. Once this program is executed,
the specified abc file will be created and the play abc
will be enabled. You may also click the top console button,
to view the messages returned by midi2abc which are sometimes
useful. See the sample below.
The button at the bottom, play orig will allow
you to hear the original MIDI file. If you click on the
button play abc, abc2midi will be convert the output
abc file back to a MIDI file and send it to a
media player program. If you click the next button labeled
display at the bottom right of the window, the output
abc file will be converted to a postscript file and the postscript
viewer will display the results. If you wish to edit the
file you will have to change the active file in the top
entry box to the output abc file before selecting the editor.
Pressing the top play button may produce different results since
runabc may change the tempo or introduce other %%MIDI instructions
to control the voice assignments which were selected by the
user.
For most of the midi files posted on the web you
should run midi2abc with the default parameters.
These defaults can be restored by
clicking the button labeled defaults.
Here is an easy example, you can try. Go to the web site
http://www.contemplator.com/tunebook/
and find a MIDI file you like. Download this MIDI file
and select this file as the input midi file.
Click the midi2abc button and play and display the
resulting abc file.
Now if you set this output abc file as you active
file (in the top file entry box), you can
do many more things with the result. Using the edit/extract part
function you can extract a single voice from the multipart
score and display it. Now suppose, you wish to play along
with the MIDI file on your own musical instrument but you
wish to slow it down. The tempo is already indicated in the
output abc file, but you can still override it if you go to
the Play options/tempo/pitch menu item. Tick the
override tempo indications checkbox and it will play
with whatever tempo you set. Suppose now you want to turn off
some of the instruments. Select Play options/voices
and adjust the audio levels of the different voices. Ignore,
the program selections as they will not override the current
indications in the abc file unless you have indicated that
in the Play options/tempo/pitch window. Note
after you have finished experimenting, you should remember to
restore these settings to their nominal values before you quit
or else all abc files will sound funny.
For some MIDI files especially the raw output of
a MIDI keyboard it may be necessary to run midi2abc
with different parameters. Though the output abc file
converts back to a reasonable MIDI file, it may
produce a PostScript file that is difficult to read.
For those files it may be necessary to adjust some of the
run time parameters in order to improve these results.
This is explained below but first you need to understand
how a midi file is encoded.
A midi file contains a list of events which are mainly note-on and
note-off commands. A note-on/off command indicates the relative time
from the previous command in units of midi pulses, the particular
midi channel, the pitch in midi units and the loudness or velocity.
There is a direct mapping between midi pitch units and the keys
of a musical instrument so extracting the musical notes is generally
simple. The mapping between note duration in midi pulses and note
type (quarter note, half note, etc.) may be less straight forward
in some cases.
All midi files contain an indication of the number of midi pulses
per quarter note, but this may not be relevant for some midi files.
If the midi file was created using music notation software, then
this indication is probably reliable. On the other hand, if the
midi file was recorded directly from a performer playing a musical
instrument, there is no guarantee that the player will maintain
this mapping exactly or approximately. The duration of a midi pulse
in seconds is specified by a tempo command in the midi file. Most
midi files have only one tempo command, but some may have many.
There are two types of MIDI files in current practice. The earlier
types of file recorded are the MIDI files in one track, where
the musical instruments are distinguished by the channel numbers.
Newer MIDI files are multitrack, where each instrument is recorded
in a separate track. Midi2abc is designed to work on the latter
format but it can handle the earlier type to a limited extent.
In order to create an abc file, midi2abc needs to convert the
note durations specified in MIDI pulses to abc units, where
called quantum units. By default midi2abc assumes a quantum
unit equal to half of the L: unit length which typically is
either 1/8 or 1/16 depending on the time signature encoded in
the MIDI file. Thus for L:1/8, the quantum unit is a 1/16 th
note and midi2abc quantizes all notes to these units. Notes
that are shorter than that (after rounding) are typically
ignored. The conversion factor from MIDI pulses to quantum
units is xunits, which may be determined in one of several
ways depending upon the run time parameters of midi2abc.
By default, midi2abc determines xunits from the header information
in the midi file (PPQN or pulses per quarter note).
However, midi2abc allows you to specify xunits as a run time parameter,
or determine xunits from other information such as the tempo
or desired number of measures to output. Furthermore, midi2abc
has the capability of estimating xunits statistically by attempting to
minimizing the quantization error. (For most music the note
durations should be approximately integer multiples of some
number of MIDI pulses.)
The first menu button on the abc2midi property sheet, labeled unit
length, enables you to select how to determine the unit length.
When the program starts up, the method used is "from midi file".
If you change this setting to "from entry box", then you must enter
a number in the adjoining entry box specifying this length. It
is not recommended that you use this method unless you know a
priori this conversion or you are doing some fine tuning. For your
information, the unit length used by the program is printed out
on the summary every time you click the midi2abc button or execute
midi2abc.
If you specify "by minimization quantization error", then midi2abc
will use its own algorithm for estimating the unit length. The answer
is usually correct, but sometimes it is out by exactly a factor of
two or so. If you specify "from tempo in entry box", then the adjacent
entry box should contain the estimated number of beats per minute.
The program will attempt to use this information to figure out the
number of midi pulses in a quarter note and then unit length in order
to get this beat. The program assumes the last tempo indication in
the file so if the file has more than one tempo indication, this
method is not going to work. Finally if you specify "from expected
bars in entry box", then you should enter the number of bars or
measures you expect in the output abc file. This assumes a constant
time signature throughout the file. If the output music notation
results is full of tied notes, the program is probably using the
wrong unit length.
A lot of music does not begin with a full bar, but may start
with one or more leading notes. This is called anacrusis. If
For some MIDI files it may be necessary to either specify the
anacrusis in quantum units, or else tell midi2abc to estimate
the anacrusis using one of two algorithms. (One algorithm,
attempts to minimize the tied notes across bar lines. The other
algorithm searches for strong beats based on the velocity (or
loudness) of the MIDI notes. If all the bar lines are off
by a couple of beats, you can adjust that using the anacrusis
control.
For some reason, many MIDI files do not specify a key signature.
This does not affect how the MIDI file is played by the synthesizer,
since all the sharps and flats have already been notated in the
MIDI file; however, there may be lots of accidentals when you
convert the file to abc format. If the key signature is encoded
in the MIDI file, midi2abc will use this information in creating
the abc file but if it is missing midi2abc will attempt to guess
the key signature by minimizing the number of accidentals. Sometimes
the key signature indicated in the MIDI file is incorrect and you
may wish to use a different one. The next menu button, key signature,
provides you with several options. There is a similar menu
button for time signature.
Finally, if the MIDI file contains several instruments encoded
in different MIDI channels (0 to 15), you have the option of
extracting only a single channel. By default all channels are
extracted and the different lines of music (voices) are separated
by the track number. Nearly all the recent MIDI files are multitrack
format (MIDI format 1)
Certain percussion instruments are represented in the MIDI file
by notes of very short durations. These will be ignored by midi2abc
unless you tick the box, save short rests. In that case,
all these short notes will be assigned a duration of one quantum
unit.
To improve the articulation of notes, some MIDI music contains
short time gaps between every note. This would appear as many
rests sprinkled between each note in the abc file. The parameter
minimum rest allows you to specify the minimum sized
rest that can appear in the abc file. Rests smaller than that
will be absorbed by the preceding note.
If you know the music is not full of triplets and broken notes,
then you may wish to tick the check box no triplets .
The music in MIDI files are generally more complex than you
typically find in abc files. Furthermore, midi2abc cannot
distinguish grace notes from real notes and a trill will
expand to a long series of notes. Therefore the output of
midi2abc may is usually very complicated and it is recommended
that you limit the output to one measure (or bar) per line.
(Some software may have difficulty handling lines longer than
128 characters.) Midi2abc will place a backslash continuation
at the end the line so that most abc to postscript converters
will not print one bar per staff. The entry boxes in this
interface allow you to specify both the number of bars per
output line, and the number of bars to continue.
Enter small numbers in the entry box bars per line and
bars per staff.
Midi2abc outputs the tracks in separate blocks for each voice.
This is quite difficult to edit or read. If you tick the check
box voice interleave, runabc will run its own script to
produce an output in voice interleaved format. This script currently
is rather restrictive and only handles the midi2abc output.
New parameters were recently introduced in midi2abc that
provide more control on the size of the quantum unit. As
mentioned in the beginning of this discussion, midi2abc splits
a L: unit length into two parts called quantum units. Now
you may specify the number of parts provided it is a power of
2 and not too large. Midi2abc automatically chooses the L: unit
length (either 1/8 or 1/16), but now you also have the option
of choosing your own unit length provided the denominator is
a power of 2. Increasing the quantization precision by raising
parts/unit will provide a more accurate representation
however this can introduced strange tied notes like 1/4 tied
to 3/64 notes which will be hard to sight read. It is recommended
that you stick to the default of 2. By convention L:denominator=0
indicates allows midi2abc to choose its own L:unit length.
For some raw MIDI files, in particular keyboard music, all the
notes are placed in a single track. There are many nonhomophonic chords --
chords containing notes that do not share a common onset time or stop
time. In other words they are polyphonic. Representation of
such chords is rather awkward in abc notation producing an
awkward notation which is difficult to edit.
The option bar splits attempts to avoid polyphonic chords
by splitting a bar into separate lines using the '&' symbol. The
output is somewhat easier to edit and looks like this.
This output is somewhat of an improvement but leaves much to
be desired. The option voice splits goes a further step and
splits the entire voice into separate voices. The output looks
like
Midishow is a MIDI navigation tool built into runabc.
It displays the MIDI file in piano roll format in a scrolled
Tcl/Tk canvas. Using the scroll and zoom controls, you can
select any particular segment of the MIDI file and convert
this section into an abc file using midi2abc. Other functions
allow you to examine the characteristics of the MIDI file
or part of the MIDI file and determine how it was created.
To use this tool, you must have the latest version of midi2abc
and a new program midicopy which comes with the abcmidi
distribution. If the MIDI file is very big (say over 100
kbytes) and your computer is slow (say 600Mhz), there may be a
long pause before Midishow responds. Runabc will appear to be
frozen for that time. Just be patient and the results should
appear in about a minute.
Midishow is called from the Extras menu. Assuming you
have selected a midi file in the mid2abc window (described
above), midishow will generate a new window like the following
example.
While the music is playing, you may see a vertical red marker
attempt to follow along with the music. Unfortunately, the
music is played by a separate application which does not
communicate with runabc so there may be a loss of synchronization
between the movement of the cursor and the music. If the moving
marker is annoying, you can turn off this feature by removing
the tick mark from the config/follow while playing checkbox.
Pressing any key on the keyboard while the piano window is in
focus will stop the moving cursor for the current instance.
For finer control, you can select a particular portion of the
MIDI file by sweeping the mouse cursor while holding the left
mouse button down. The selected area will be highlighted in
a light yellow stipple. (Double clicking anywhere in the
piano window will remove the highlighted region.) The abcfile
button, and right mouse button will now act on only the
the highlighted area.
You may configure the program to separate the MIDI file
by either tracks or channels.
The action menu button brings up a menu of selected
actions that you can apply to the displayed region of the
MIDI file. If you select specific channels or tracks using
the check buttons at the bottom of the window, then only
those tracks/channels will be processed. If no tracks or
channels have been selected, then all the channels and tracks
will be processed. For example, you can create an
using midi2abc for the specific time region and tracks.
The midi2abc configuration parameters can be customized using
the extras/midi2abc window.
If you select action/velocity distribution, the program will
analyze the velocity (loudness) indications in the MIDI file
and display a graph of its distribution in a separate window.
The vertical scale is in units of probability.
If you select action/velocity map, the program will display
the velocity of the notes versus beats corresponding to the
midishow display. Each note is a horizontal arrow, but its
elevation now corresponds to its velocity instead of its pitch.
If the music contains many chords of the same velocity,
many of the notes will appear on top of each other. You
can select particular tracks or channels using the selection
menu in the midishow window. If you scroll or zoom, in the
midishow window you should update the plot by calling this
action item again.
If you select action/pitch distribution, you get two graphs.
The first plot is the distribution of all pitches in the
the exposed region of the MIDI file. This plot gives you
an idea of the range of notes.
The beat graph is a useful but complicated representation to describe.
It plots the position of the onset time of a note in a beat versus
its beat number for all the selected notes. If you look at the mftext
output displayed by runabc, note onset times are represented by beat
number, where a beat is usually a quarter note. This is more informative,
than displaying the MIDI pulse number. The relationship between MIDI
pulses and quarter notes is given by the PPQN parameter (pulses per
quarter note) which appears in the header of the MIDI file. If the
MIDI file was produced by a music notation program, the onset times
of the notes follow musical standards at occur at exact fractions
of a beat. So the beat numbers of a note are generally numbers like,
10.250, 12.000, 13.50 etc. rather than 10.158, 12.012, 13.683 etc.
The beat graph plots the fraction of a beat versus the beat number
so for previous onset times the points (10, 0.250), (12, 0.000) and
(13.0 0.500) would be plotted. The following plot is an example
of a beat graph for a MIDI file produced by a music notation program.
Creating a MIDI file using a music notation program is very slow.
MIDI files are also created in real time while the musician is
playing a MIDI keyboard. Often the musician plays the music a little
fast or a little slow so that all the beats are a little shorter
or longer than the nominal value indicated by the PPQN. The
following figure shows the beat graph for such a file.
You may also see a beat graph which looks like this.
The beat graph is not my original idea, but was first introduced
by Van Belle Werner (http://bio6.itek.norut.no/werner/Papers/bpm04/).
I adapted it to a MIDI file.
Midishow indicates quarter note beat positions with vertical
lines based on the ppqn variable in the MIDI file. (To avoid
cluttering the screen they are decimated until you zoom into
a specific area.) For some MIDI files, the ppqn has an incorrect
as discussed above. You can temporarily change the ppqn and the
spacing of the quarter beat indications by going to the
config/ppqn adjustment menu item on the top left.
The following window should pop
up.
To illustrate the usefulness of this feature, you need to download
Scarlatti's Sonatas from John Sankey's MIDI site.
You can also use the beatgraph output to infer the ppqn.
If the lines are going up, you need to increase the ppqn. (The
lines become flat when ppqn is 536. You need to request a new
beatgraph output whenever you change the ppqn.)
As a convenience, the actions create abc file, play abc
and display abc will migrate your ppqn parameters to
the midi2abc options whenever the ppqn window is displayed.
If you are preparing a paper, you may need a copy of the
displayed piano roll as a PostScript file. Click the button
action/Create PostScript file to produce a file called piano.ps.
The analysis of chords is a challenging problem in musicology.
Another action feature unique chords (which may be of questionable
value) creates a textual histogram of all chords in the exposed portion
of the MIDI file. This is presented as a table in a separate window
illustrated below.
Clicking extras/mftext will display a window similar
to above showing a textual representation of a MIDI file. In
order for this to work you need the latest version of midi2abc
(2.80 or higher). The output is somewhat similar to mftext.
Time is indicated in beat units. The channel number is usually
indicated after the MIDI command.
The checkbuttons on the bottom allow you to elide specified
tracks or specified MIDI commands. For example in the above sample,
all the MIDI commands in track 2 were hidden. This is useful
when you are viewing a fairly complex MIDI file. If you are
eliding a mixture of tracks and MIDI commands, tcl/tk may get
confused and not elide some of the commands correctly. I do
not know how to fix this problem.
Whenever you exit from runabc.tcl by clicking on the x on the
top right corner of the window (assuming Windows 95/NT), the program
creates or updates a file called runabc.ini. This is an ascii file
containing all of your settings allowing the program to resume the
next time you run it.
Return to top level to download
runabc.zip and read the install.html page.
Abc2midi Options
Tempo/pitch
melody
The melody checkbutton should always be left checked unless you
want to play minus one style (The computer plays the accompaniment
and you play the melody on your favourite instrument. Be sure that
the bass/chords checkbox is checked and the tune has guitar chords
or you will hear nothing when you click the Play button.)
bass/chord
Similarly you can select any instruments for the chordal and bass
accompaniment by selecting the menu items Play options/chord
or /bass. A sample sheet is shown below.
drone
.
voice
.
Abc2ps, Abcm2ps, Yaps Configuration
Jcabc2ps, Jaabc2ps, Abctab2ps and other abc2ps clones
Edit/Abc2abc interface
The user's interface to abc2abc is hidden away in the Edit menu
menu button. Selecting this item causes runabc to display the
following frame in its main window.
X:17
T:Quick Step 71st. Regt.
M:6/8
L:1/8
K:D
dfdecA|dfagfe|dfdecA|dedd3:|
AFABGB|cBcded|AFABGB|cBcd3:|
If the no error report checkbox is not ticked,
abc2abc will produce the following output
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/8
K:D
dfdecA|dfagfe|dfdecA|dedd3
%Warning : No repeat expected, found :|
:|
AFABGB|cBcded|AFABGB|cBcd3
%Warning : No repeat expected, found :|
:|
Unless you are trying to clean up any errors or minor
inconsistencies, you would normally have that checkbox
ticked so all warnings and error messages are suppressed.
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/8
K:D
dfd ecA|dfa gfe|dfd ecA|ded d3:|
AFA BGB|cBc ded|AFA BGB|cBc d3:|
Spaces were placed between beats.
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/16
K:D
d2f2d2 e2c2A2|d2f2a2 g2f2e2|d2f2d2 e2c2A2|d2e2d2 d6:|
A2F2A2 B2G2B2|c2B2c2 d2e2d2|A2F2A2 B2G2B2|c2B2c2 d6:|
The standard unit length specified by the L: field has been
halved to 1/16 and all the notes have been doubled in length.
Effectively, there has been no change; however, this feature
is sometimes handy when you are transcribing a new tune.
The option halve note length does the opposite as
illustrated below.
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/4
K:D
d/2f/2d/2 e/2c/2A/2|d/2f/2a/2 g/2f/2e/2|d/2f/2d/2 e/2c/2A/2|d/2e/2d/2 d3/2:|
A/2F/2A/2 B/2G/2B/2|c/2B/2c/2 d/2e/2d/2|A/2F/2A/2 B/2G/2B/2|c/2B/2c/2 d3/2:|
The option force key to none will produce the following output
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/8
K:none
d^fd e^cA|d^fa gfe|d^fd e^cA|ded d3:|
A^FA BGB|^cBc ded|A^FA BGB|^cBc d3:|
The key signature is K:none and additional sharps were added to preserve
the original music. You can force the key signature to any one of 11
possibilities if you click on the menu item currently labeled none.
This feature becomes useful for some jazz music which has so many
accidentals that it is hard to assign any particular key signature.
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/8
K:Db
dfd ecA|dfa gfe|dfd ecA|ded d3:|
AFA BGB|cBc ded|AFA BGB|cBc d3:|
All the notes were shifted down one semitone and the key signature
was changed to Db to be consistent. Note it is important to tick
the adjoining checkbox for performing the transposition or else
no action will be taken.
X: 17
T:Quick Step 71st. Regt.
Z:rrobinson/Aird1.abc
M:6/8
L:1/8
K:D
dfd ecA|dfa gfe|dfd ecA|
ded d3:|AFA BGB|cBc ded|
AFA BGB|cBc d3:|
Edit/TclAbcEditor
Introduction
As a text editor, this is not the best. I prefer to use
a different editor most of the time. However, in order
to provide special editing features such as reformatting,
transposing, introducing grace notes or guitar chords,
and various clean up features, it was necessary to design
my own editor. The play button is one of the most useful features
that allows you to play any selected section of abc tune.
This is useful when you are trying out different chords or trying
to identify a bar that does not sound right.
Text Widget standard binding.
In addition you there are customized bindings listed here:
Guitar chords and grace notes
Other formatting and editing tools
[A2D2][AD][BE] [c2F2][d2G2] | [cF][BE][cF][A-D-] [A4D4]
you can replace it with either
A2AB c2d2 | cBcA A4
or
D2DE F2G2 | FEFD D4
using this tool. The tool handles chords containing up to 4 notes.
The notes in the chord are sorted by pitch and you select which
note (eg. highest pitch) that should replace the chord.
to
This is illustrated below for the following abc file.
X: 6
T: Bela Rada
R:
O: Srbija
B:
D:
Z: John Chambers
The body of the music was duplicated by highlighting, grabbing
it into the clipboard using the cntl-c, and dumping it using the cntl-v
(or cntl-y in unix) command. V: fields were added to separate the
copies so that the edit window now looks like
X: 6
T: Bela Rada
R:
O: Srbija
B:
D:
Z: John Chambers
V:1 body was selected and the "tools/replace chords/with
top note" was used to replace each chord with the top note.
Guitar chords were removed from the second voice using "clean/remove
all guitar chords". Finally the chords in the second voice were
replaced by the second highest note using "tools/x replace
chords/with 2nd note". The resulting edit window now appears
as follows.
X: 6
T: Bela Rada
R:
O: Srbija
B:
D:
Z: John Chambers
The tool x replace chords differs from replace chords in the
manner that it treats notes that are not embedded in chords. Instead
of repeating the note, it is replaced with an invisible rest.
Thus
G2 [A2c2]
would be replaced with
x2 A2
The tool solfege vocalization appends the solfege do/re/me.. symbols
to the notes as a lyric line. For example if the following lines
were highlighted for a tune in the key of Em,
A2 A3 c BA|B2 G3 B AG|A2 D2 ddcA|B8|!
A2 A3 c BA|B2 B2 c2 BA|G2 G2 AAGF|E8:|!
The function would replace these lines with
A2 A3 c BA|B2 G3 B AG|A2 D2 ddcA|B8|!
w: re re fa me re | me do me re do | re so so so fa re | me |
A2 A3 c BA|B2 B2 c2 BA|G2 G2 AAGF|E8:|!
w: re re fa me re | me me fa me re | do do re re do ti | la |
The vocalizations use the moveable-do system (as opposed to
fixed-do). For the key of E minor, the relative major is G major
so G is represented by do. The purpose of this function is to
assist in learning music sight reading. The function figures
out the key signature by searching backwards for the first
K: field indication. (If the music contains key modulations,
it is recommended that you highlight only the part of the music
in the same key.) The program attempts to ignore guitar chords,
decorations, field commands etc. but it is not perfect. For
example something like ... A:| is mistaken for a field command
and ignored, so the output may require minor editing. The
program also ignores all accidentals since I have not learnt
how to treat them.
%%MIDI drum dzdd 36 40 40
The drum tool appears as follows:
Edit menu/Copy
The function will copy the selected tunes in the table
of contents to a designated abc file. If the file does
not already exist, it will create a new file; otherwise,
it will destroy the existing file and overwrite it with
the selected tunes. The X: numbers will be preserved.
Edit menu/Incipits
Extras/Find Title
mary | john
will return any title containing the word mary or john
fairies$
will return any title ending with the word fairies
^some
will return any title starting with the word some
Extras/Find Bar
Multivoice extraction functions
z4|z4|z4|z4|z4|AB CD|BC AA|
would appear either like:
"5"z4|AB CD|BC AA|
or
Z5| AB CD| BC AA|
depending on which radio button you have selected. If you select
auto, then runabc will make its selection depending on which
postscript converter you have chosen (abc2ps or other).
The buttons marked "Display", "Save to file" or "To editor",
performs the appropriate action. If you select "Display", the
part will be extracted, converted to a Postscript file and
displayed using gsview or whatever. If you select "Save to file",
you will be asked for a abc file name for saving the part.
If you select "To editor", the part will appear in the TclAbcEditor.
Creating Midi Files
Midi to Abc
It is quite difficult to find multivoiced abc files on the Web.
Furthermore the genre of the abc files are fairly limited.
Fortunately, you can make your own multivoiced abc files from
the many MIDI files on the internet. In most cases the midi2abc
tool does this completely automatically; however, a few MIDI
files provide a challenge.
F/2E/2[FF,-] [GF,]A/2-[A/2-F/2] [A/2E/2]F/2[B/2-D/2][B/2-E/2]| \
[B/2-C/2][B/2D/2]B,/2D/2 [G/2C/2][F/2D/2][G/2-B,/2][G/2C/2] [A/2-A,/2][A/2B,/2][B/2-G,/2][B/2-F/2] [B/2E/2]D/2[c/2-E/2][c/2-F/2]| \
[c/2-D/2][c/2E/2][A/2-F,/2][A/2F/2] [d/2-E/2][d/2D/2]
If the abc to postscript converter is able to handle this file,
it produces an almost unreadable output similar to below.
F/2E/2F GA3/2x/2D/2E/2 C/2D/2B,/2D/2 & \
xF,2x/2F/2 E/2F/2B2x | \
[G/2C/2][F/2D/2]B,/2C/2 A,/2B,/2B3/2x/2E/2F/2 D/2E/2F,/2F/2 & \
xG AG,/2F/2 E/2D/2c2A |
E/2 & d
V: split2A
%%MIDI program 24
F/2E/2F GA3/2x/2D/2E/2 C/2D/2B,/2D/2| \
[G/2C/2][F/2D/2]B,/2C/2 A,/2B,/2B3/2x/2E/2F/2 D/2E/2F,/2F/2| \
E/2D/2
V:split2B
xF,2x/2F/2 E/2F/2B2x| \
xG AG,/2F/2 E/2D/2c2A| \
Midishow - Piano Roll Representation
The main purpose of this application is to allow you to
produce an abc file or display the music notation of part
of a MIDI file. MIDI files are generally a lot more
complicated and longer than abc files. There may be repeats
and key signature changes that are not expressed explicitly
in the MIDI file. Converting the entire MIDI file into an
abc file may produce a big mess requiring much editing. In
some cases the output file may not be accepted by other
applications and cause it to crash.
http://www.sankey.ws/harpsichord.html
These MIDI files are difficult to convert to music notation for several
reasons. The ppqn indication is frequently incorrect and there is
no time signature meta commands. (In addition each note class is
in a different MIDI channel to allow pitchbending to the desired
temperament.) If you run midishow on one of these files (eg. K019.MID
which is in 2/4 time) you will find that the quarter note lines do
not line up with the notes since the file assumes a ppqn of 192.
Mftext - Textual Representation of a MIDI file
Quiting
seymour.shlien@crc.ca.