Expand description
ABC’s tokens and the handler that reads them: music21’s abcFormat.
The text is cut into tokens one character at a time (Handler::tokenize),
each token is told what is in force where it stands – the default length,
the key, a tuplet, a tie – and then read (Handler::process). A
processed handler is cut into tunes, voices and measures by token index,
so a caller keeping tokens of its own can cut those the same way. The
order and the oddities are music21’s throughout.
Each step is one music21 exposes: a token starts as music21’s does, with
only its text, and its fields are filled by the step music21 calls
(pre_parse, parse, update_ratio), so a token can be read, changed and
read on between steps.
Structs§
- AbcMetadata
- A line of metadata,
T:Titleand the like: music21’sABCMetadata. Its tag and data are empty untilAbcMetadata::pre_parse. - AbcNote
- A note, a rest, or with
is_chorda chord: music21’sABCNoteandABCChord. Its context is filled byHandler::process, its pitch and length byAbcNote::parse. - AbcTuplet
- A tuplet’s opening,
(3or(p:q:r: music21’sABCTuplet. Its ratio is unknown untilAbcTuplet::update_ratio. - Bar
- A bar token: music21’s
ABCBar. Its fields are empty untilBar::parse. - Broken
Rhythm - A broken rhythm,
>to<<<: music21’sABCBrokenRhythmMarker. Its data is empty untilBrokenRhythm::pre_parse. - Comment
- A comment read by
comment_at. - Handler
- music21’s
ABCHandler: the tokens of a text and what reading them keeps. - Measure
Split - A measure of
Handler::split_by_measure’s, by token index. - Spanning
- A spanner as the handler makes one: what kind, and the notes it joins.
Enums§
- Closes
- What a closing mark closes.
- Merge
- One handler of
merge_plan’s. - Side
- Which side of a broken-rhythm mark a note stands on.
- Token
- One token of ABC: music21’s
ABCTokenand its subclasses.
Constants§
- BARS
- Every bar token and what music21 calls it, in the order music21 tries
them: music21’s
ABC_BARS. - DEFAULT_
VERSION - The ABC version a file is read as where it names none: music21’s
defaults.abcVersionDefault.
Functions§
- comment_
at - music21’s
processComment: the comment atpos, to the end of its line. - extract_
reference_ number - music21’s
ABCFile.extractReferenceNumber: the lines of one tune, and how many lines of the text stand before them. - linear_
context - music21’s
_getLinearContext: the items before, at, after and two afterindex. - measure_
boundaries - music21’s
_buildMeasureBoundaryIndices: the start and end of each measure from the places of its barlines, a span of one passed over. - merge_
plan - music21’s
mergeLeadingMetaData, given whether each bar’s handler holds notes: a handler of nothing but metadata is joined to the one after it, and a tune of one measure or none is one handler. - next_
line_ break - music21’s
_getNextLineBreak: where the next line break afterindexstands, or the end. - starts_
metadata - music21’s
startsMetadata: a capital letter, orw, then a colon, then something other than a barline. - strip_
comment - music21’s
ABCToken.stripComment: the text before any%. - version_
in %abc-(\d+)\.(\d+)\.?(\d+)?searched for: the first ABC version named.
Type Aliases§
- Context
- The items before, at, after and two after a place.