Skip to main content

Module makenotation

Module makenotation 

Source
Expand description

Measures, ties, rests, voices, beams and stems worked out for a score that does not say them. Working out what a score leaves unsaid: music21’s stream.makeNotation.

What a reader of another format needs is here: cutting a line into measures, tying what runs past a barline, filling measures out with rests, putting overlapping notes in voices, moving notes onto a grid, beaming the notes of each measure by its meter and pointing the stems of each beamed group one way.

make_notation is the whole of it in music21’s order, for a score that says only what sounds: measures, accidentals, ties, tuplets completed and bracketed, beams. split_at_durations cuts a length no single note value writes into values that do.

Constants§

QUANTIZATION_DIVISORS
The divisions of a quarter music21 quantizes to unless told otherwise: sixteenths and triplet eighths.

Functions§

consolidate_completed_tuplets
Joins a run of tied notes, or of rests, that fills one tuplet exactly into one note of the tuplet’s whole length: music21’s consolidateCompletedTuplets with onlyIfTied, on one line. Whether anything was joined.
make_accidentals
Decides which accidentals are written, measure by measure: music21’s makeAccidentals on a part.
make_beams
Beams the notes of every measure of a part by the meter in force, and points the stems of each beamed group one way: music21’s makeBeams.
make_measures
Cuts a stream into measures by the meters it holds: music21’s makeMeasures.
make_measures_by
make_measures by meters given rather than found: music21’s makeMeasures with a meterStream. Each meter is given with the offset it takes over at; with none given the stream’s own are used.
make_notation
Works out what a score leaves unsaid, as music21’s makeNotation does, changing the stream in place.
make_ornamental_accidentals
Decides whether each accidental this note’s ornaments imply is shown, and writes it onto the ornament: music21’s makeOrnamentalAccidentals.
make_rests
Fills every measure of a part with rests up to its bar’s length, its voices too: music21’s makeRests with fillGaps=True and timeRangeFromBarDuration=True.
make_ties
Cuts every note that runs past its barline and ties the pieces, the second going to the start of the next measure: music21’s makeTies.
make_tuplet_brackets
Marks the first and last of each run of tuplets in a line of notes as where its bracket starts and stops: music21’s makeTupletBrackets.
make_voices
Puts a measure’s notes into voices where they overlap: music21’s makeVoices with fillGaps=False.
op_frac
Snaps an offset as music21’s opFrac does, to the nearest fraction with a denominator up to 65535, so that three triplets end on the beat. A negative offset is snapped as its size is.
quantize
Moves every offset and length in a stream onto the nearest place a quarter divides into: music21’s quantize, for the stream’s own elements.
realize_ornaments
Every ornament the stream carries played out, in a stream of its own: music21’s stream.makeNotation.realizeOrnaments.
set_stem_direction_for_beam_groups
Points the stems of each beamed group the way its first and last pitches lie about the middle line of the clef in force: music21’s setStemDirectionForBeamGroups.
split_at_durations
Cuts every note, chord and rest whose length no single written value writes into pieces that each are one, tied: music21’s splitAtDurations with recurse.
split_elements_to_complete_tuplets
Cuts the note or rest after an unfinished tuplet where that finishes it: music21’s splitElementsToCompleteTuplets, on one line.