Class Midi.Tab

Reads and writes MIDI tablature.

The tablature format is based on drum tablature: bars are separated by horizontal pipe characters '|', with equal divisions within a bar specified by a rest ('-' dash character) or a note.
Note lengths can be continued into following divisions using the tilde '~' character.

Each tablature line must be prefix with a numerical MIDI pitch value or a 1-3 character tag, e.g. "SN" for snare drum.
In the case of a non-numeric prefix, note characters must be defined for MIDI pitch and velocity using the define method.

For tablature lines with a numeric prefix any character other than '-' or '~' will designate a note. A default value will be used for the note velocity unless a custom velocity has been defined for this character using the velocity method.

Constructors

Tab()

Properties

division measure division for rythm quantization.
linewrap character count limit for wrapping output lines.

Methods

define(string prefix, string strike, integer pitch, integer velocity) define a custom note character
sequence(string tab) read tablature and convert into a Midi.Sequence
string(Midi.Sequence sequence) convert a Midi.Sequence into MIDI tablature
velocity(string strike, integer velocity) defined a custom velocity for the given character.

Constructor Documentation


Tab()

Property Documentation


integer division

Measure division for rythm quantization.


integer linewrap

Character count limit for wrapping output lines.

Method Documentation


void define(string prefix, string strike, integer pitch, integer velocity)

Define a custom note character. Applies only to lines with a custom prefix.

Parameters


Midi.Sequence sequence(string tab)

Read tablature and convert into a Midi.Sequence

Parameters

Returns


string string(Midi.Sequence sequence)

Convert a Midi.Sequence into MIDI tablature.
The note starts and lengths will be quantized to the nearest value as given by the _division_ property.
Note velocities will also be quantized to the nearest note character if custom velocities have been defined.

Parameters

Returns


void velocity(string strike, integer velocity)

Defined a custom velocity for the given character.

Parameters



Creative Commons Logo This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.