Skip to main content

Module metadata

Module metadata 

Source
Expand description

A score’s title, composer and the rest of what is said about it. A score’s metadata: music21’s metadata.Metadata.

music21 keeps metadata as named values, each name a unique name from a fixed vocabulary drawn from Dublin Core, the MARC relator terms and Humdrum’s reference records, or one a caller made up. A name may carry several values, and the names keep the order they were first given in, which is the order a MusicXML writer puts them out in.

A contributor is a value with a role: the composer, an arranger, a lyricist. Its unique name is its role where the role is in the vocabulary, and otherContributor where it is not.

Structs§

Metadata
A score’s metadata: named values in the order the names were first given.
MetadataMatch
What a Metadata::search found: the text that matched and the field it answers under. A contributor with a made-up role answers under that role, and one with no role at all under no field, which is music21’s (True, None).
MetadataValue
One value of a metadata name: its text and, for a contributor or a copyright, the role it was given.

Enums§

MetadataQuery
What a Metadata::search asks of one value’s text.

Constants§

OLD_MUSIC21_NAMES
The unique names music21 kept an older spelling of: its oldMusic21Abbrev and oldMusic21WorkId, both of which Metadata::search takes as a field name. Each row is the unique name, its Humdrum abbreviation and the work id it was written as before music21 v8.
STANDARD_PROPERTIES
music21’s STANDARD_PROPERTY_DESCRIPTIONS: each property’s unique name, its namespaced name, and whether it names a contributor.

Functions§

is_contributor_unique_name
Whether a unique name is one of the vocabulary’s contributor names: music21’s _isContributorUniqueName.
namespace_name
The namespaced name a unique name stands for, humdrum:OPC for localeOfComposition: music21’s uniqueNameToNamespaceName. A name outside the vocabulary has none.
unique_name_of
The unique name an attribute name stands for: the name itself, one of music21’s four grandfathered work ids, or one of its twenty Humdrum abbreviations. Nothing for a name outside the vocabulary.