tclabc commands

abc delete

Delete the current symbol.

The current pointer is set to the next symbol.

abc dump

Return the current tune in abc notation.

abc get ?type?

When no type, return the current symbol type and its associated values.

The values depend on the symbol type:

bar
bar_type repeat_value bar_number
The bar_type value is defined in abcparse.h.
clef
clef_type line_number
The clef_type value is defined in abcparse.h. line_number is the line on which the clef indicates the main note (2 for treble).
EOT
(no associated value)
This symbol indicates the end of the voice.
extra
extra_type ?args?
The extra_type may be:
blen
Change the basic note length for the next symbols. args contains the length (see note).
info
Information. The args are the information content in ABC.
newline
Start a new line in the ABC file. There no args.
staves
Synchronize the staves. The args are the '%%staves' text.
vover
Switch to a voice overlay. There no args.
grace
(same as note)
key (key signature)
key_type
The key_type is indicated as the number of sharps when positive ('2' is 'D' with F and C sharps), or the number of flats when negative ('-2' is 'Bb' with B and E flats). '0' is natural C.
midi
command args
The command is the same as the '%%MIDI' ABC pseudo-comment with the following extensions:
channel
Assign one or many MIDI channels to the voice. args contains the channel numbers (range 1..32).
program
Assign a MIDI program to a channel.
args may be:
    program
    bank-program
    channel program
    channel bank-program
    channel bank program
bank and program are numbered from 0 to 127.
When ommitted, bank is 1, and channel is the first channel of the current voice.
mrest
nbars
nbars is the number of measures the rest lasts.
note
length pitch accidental ?pitch accidental? ...
The note length unit is the same as the MIDI one, that is, a whole note length is 1536.
The pitch gives the natural note and its octave (it is not the MIDI note frequency). The middle C value is 16, the upper 'c' is 24.
The accidentals are:
0
No accidental
1
sharp
2
natural
3
flat
4
double sharp
5
double flat
When the accidental has a microtone fraction, this value is added to accidental as
((numerator - 1) * 256 + (denominator - 1)) * 8.
pitch and accidental may be repeated in case of chord.
rest
length
The rest length is the same as the note length.
tempo
string1 note_length0 length1 length2 length3 tempo_value string2
time (time signature)
upper_value lower_value ?upper_value lower_value? ..
There may be up to 6 pairs of upper/lower values.
tuplet
p q r
If the type is present, it may be:
channel
Return the last symbol where the MIDI channels of the voice are defined. When empty, the voice channel is the voice number plus 1.
deco
Return the decorations on the current symbol (note, rest or bar).
flags
Return the symbol flags (not musical ones).
These ones are indicators in a bit array. They are extracted using the AND operator:
0x01
Put a space before the symbol in the ABC file (beam break).
0x02
Header symbol ('x:').
0x04
Embedded symbol ('[x:]').
0x08
Note/rest in a tuplet sequence.
0x10
Note/rest is the first one in a tuplet sequence.
0x20
Note/rest is the last one in a tuplet sequence.
0x40
Note has starting ties.
0x80
Note has ending ties.
0x100
Some slurs start at this note.
0x200
Some slurs end at this note.
gchord
Return the guitar chord indication of the current symbol.
header
Return the tune header, including the pseudo-comments.
lyrics
Return the lyric words associated with the note.
program
Return a list of symbols where MIDI programs are defined. This list is indexed by channel number. When the program of a channel is not defined, an empty value appears in the list.
slurs
Return the starting and ending slurs of the chord and of each note of the chord (four values if single note). The returned value is void when there is no slur at all.
The starting values are arrays of 2 bits:
- 0x01: slur going above the note,
- 0x02: slur going below the note,
- 0x03: automatic calculation of the slur direction.
staff
Return
'staff_number current_clef_sym current_key_sym current_time_sym'
ties
Return a boolean tie indication for each note of the chord (one value if single note). The returned value is void if there is no tie.
time
Return the starting time of the current symbol
This time contains two values separated by a dot. The left value is the MIDI time. The right value is a sequence number which distinguishes symbols appearing at the same time (clefs, bars...).
tune
Return the internal index of the current tune (first is 0)
voice
Return the voice number
words
Return the lyric words after the tune (without the W:).

abc go ?arg1? ?arg2?

Go to a symbol and return its address.

With no argument, this command returns the current symbol, else, arg1 may be:

a symbol address (when starting with 's')
Go to the indicated symbol.
next or prev
If arg2 is not present, go to the next or previous symbol of the current voice. This command loops on the current voice.
Else, if arg2 is 'time', go to the next symbol at the same or next time on any voice (arg1 must be 'next'). When there is no symbol, an empty struing is returned.
a voice number (when starting with a digit)
Go to the symbol of the indicated voice at the nearest goal time (which is set when going to a symbol).

abc insert args

Insert a new symbol after the current pointer.

The args is a single list of values in the same format as the one returned by get.

abc load abcfilename

Load an ABC file and select the first tune.

Any previous tune/file is discarded, even if it has been modified.

abc lyrics ?lyrics?

Get or set the lyric lines of the current voice.

There is one list element per line. The format of a line follows the ABC 'w:' format, but may also contain font changes as '[%%vocalfont font size]'.

abc midi type ?args?

Step by step recording facilities.

The type may be:

devin and devout
Return a list of MIDI devices suitable for input (devin) or output (devout). The first word of each item of the list may be used as the device of abc midiin/midiout commands
args is a device name. It is used for OSS only.
handle
Set or remove the proc to call when a symbol is created, either from the MIDI input or by a abc midi note.
args is the proc name. It has no argument.
When args is absent or empty, stepping recording is stopped.
note
Play a note and insert.
args is a list with 2 elements:
pitch
This is the MIDI pitch (60 for the middle C).
velocity
Velocity of the note, range 0..127. If 0, the note stops playing.
To insert a note, first start it with some velocity, then stop it. The note figure is computed from the default tempo.
The notes pitch 36 (C) and 37 (C#) insert a rest and a bar.

abc midiin ?device?

Return or define the MIDI input device.

MIDI input works with OSS and/or ALSA on Unix and on MS windows.

With OSS, device is an external MIDI device name as '/dev/midi00'.

With ALSA, device is the MIDI client and port in the same format as the option '-p' of aplayrecord, as '64:0'.

On MS Windows, device is a device number.

With the graphical interface (tkabc.tcl), edit the MIDI preferences and right click on the MIDI input field to get a list of possible devices.

abc midiload midifilename

Load a MIDI file and select the tune.

Any previous tune/file is discarded, even if it has been modified.

abc midiout ?device?

Return or define the MIDI output device.

MIDI output works with OSS and/or ALSA on Unix and on MS windows.

With OSS, device is the sequencer name possibly followed by ':' and a device number, as '/dev/sequencer:1'.

With ALSA, device is the MIDI client and port in the same format as the option '-p' of aplaymidi.

On MS Windows, device is a device number.

With the graphical interface (tkabc.tcl), edit the MIDI preferences and right click on the MIDI output field to get a list of possible devices.

abc new

Load an empty tune and select it.

Any previous tune/file is discarded, even if it has been modified.

abc play ?args?

Play notes.

When no argument, return if playing is permitted or not. Otherwise, arg1 may be:

mute ?0/1?
Get or set the voice mute state.
note
Play the current note.
stop
Stop playing.
tempo
Set the default tempo.
tune
Start playing from the current symbol.
velocity ?value?
Get or set the velocity/volume (0..127 - 0 = keyboard value / 80).
which
Return which symbol is being played or 'none'.

abc record

Start/stop recording from the MIDI input port.

When recording is started, the command returns 1.

When recording is stopped, the command returns 0 if there was no MIDI event. If there was some MIDI events, the command returns 2 after the events have been translated to ABC and inserted in the tune.

abc rewind

Go to the first symbol of the first voice, and return its address.

abc set ?type? args

When no type, change a symbol definition.

The args is a single list of values in the same format as the one returned by get.

When present, the type may be:

deco
Set the decorations of the current symbol (note, rest or bar).
flags
Set the symbol flags. Actually, only the space flag may be changed.
gchord
Set the guitar chord indication of the current symbol.
header
Set the tune header (see get header). The previous header is completely destroyed.
measure
Insert or delete measure bars so that all measures are full according to the time signature.
slurs
Set the starting and ending slurs of the chord and of each note of the chord (four values if single note). To remove all slurs, set an empty value.
ties
Set the boolean tie indications on each note of the chord (one value per head). To remove all ties, set an empty value.
words
Set the lyric words after the tune.

abc tune ?args?

With no argument, return the title of all the tunes which are in the current file, else, the argument may be:
delete
Remove the current tune from the file.
new
Add a new tune in the file.
a tune index
Select the tune. The index is the same as the index in the list return by abc tune (this is not the value of X:).

abc voice ?args?

With no argument, return the number of voices of the current tune, else, the argument may be:
get
Get the voice names. This command returns the name, full name and nick name of the voice as a list.
new
Add a new voice whose names as defined by the following argument (list).
set
Set the voice names as defined by the following argument (list).

Kemm diwezhań: 14 a viz Kerzu 2007