Skip to main content

Module musedata

Module musedata 

Source
Expand description

MuseData, the Center for Computer Assisted Research in the Humanities’ encoding: music21’s musedata and musedata.translate.

A MuseData file holds one part or several, each ended by a /END line, and a work is usually a file per part. from_musedata reads the files of a work into a score of a part each. Both of the encoding’s stages are read: stage 2, with its $ attribute records and its columns for beams, accidentals, notations and lyrics, and the older stage 1.

Modules§

base40
Walter Hewlett’s base-40 pitch numbers: music21’s musedata.base40.
base12_26
The base-12 and base-26 orders of Hewlett’s system, which music21’s musedata.base12_26 keeps as tables only: base 12 numbers the natural notes of the twelve semitones, base 26 every letter with one flat or sharp.

Structs§

Part
A part’s lines and the stage they are written in: music21’s MuseDataPart.
Record
One line of a measure: music21’s MuseDataRecord.
Slurs
The slurs of one part, as music21’s _SlurCollector builds them: the marks ( ) [ ] { } and z x start and stop slurs 1 to 4, a stop closing the open slur of its number. Notes and chords are counted in the order they are read.

Enums§

Case
Whether Part::letters_after reads the line as written.
Header
Whether from_musedata_parts reads the work’s title, number and movement into the score’s metadata.
Spaces
Whether Part::letters_after keeps the spaces it passes.
Stage
The stage of the encoding a part is written in: stage 2 has $ attribute records and columns stage 1 lacks.

Functions§

bar_object
music21’s MuseDataMeasure.getBarObject: the barline the measure’s record draws.
beams_of
music21’s _musedataBeamToBeams: the beams a record’s beam column writes, [ starting, ] stopping, = continuing and / and \\ partial to the right and left.
from_musedata
Reads the files of a MuseData work, in order, into a score, as music21’s converter.parse reads a work’s directory or a single file.
from_musedata_parts
Reads parts already split from their files, each the lines of one part as music21’s MuseDataPart.src holds them, into a score: music21’s museDataWorkToStreamScore, or with Header::Skipped its musedataPartToStreamPart for each.
has_notes
music21’s MuseDataMeasure.hasNotes: whether a record of the measure is a note, rest, cue or grace note.
has_voices
music21’s MuseDataMeasure.hasVoices: whether a record of the measure is a back.
is_musedata_file
music21’s MuseDataDirectory.isMusedataFile: whether a path names a MuseData file, by its name alone.
measure_object
MuseDataMeasure.getMeasureObject: a measure numbered as its record says, opening with its barline.
part_paths
music21’s MuseDataDirectory._prepareGroups: the paths of a work’s parts, MuseData files with a digit in the name, the score file left out where there are parts, sorted.
record_note
music21’s _musedataRecordListToNoteOrChord, over the lines of the records: a note, or a chord of several, at divisions to the quarter, with the dynamics the first record carries and the tie it leaves. previous is the tie of the note before, where there is a note before.
split_parts
music21’s MuseDataFile.readstr: the parts of one file, comments and @ lines left out, read the same with Windows line endings.