MusicScore[{voice1,voice2,…}]
returns a musical score that contains the MusicVoice objects voicei.
MusicScore[{event1,event2,…}]
returns a musical score that contains the musical events eventi.
MusicScore[{{event11,event12,…},{event21,event22,…}}]
returns a musical score that contains the musical events eventij in the ith voice.
MusicScore[events,ts,ks]
returns a musical score with time signature ts and key signature ks.
MusicScore[events,ts,ks,properties]
returns a musical score with the specified property association properties.
MusicScore[music,events,ts,ks,properties]
returns a musical score with properties inherited from another measure music.
MusicScore
MusicScore[{voice1,voice2,…}]
returns a musical score that contains the MusicVoice objects voicei.
MusicScore[{event1,event2,…}]
returns a musical score that contains the musical events eventi.
MusicScore[{{event11,event12,…},{event21,event22,…}}]
returns a musical score that contains the musical events eventij in the ith voice.
MusicScore[events,ts,ks]
returns a musical score with time signature ts and key signature ks.
MusicScore[events,ts,ks,properties]
returns a musical score with the specified property association properties.
MusicScore[music,events,ts,ks,properties]
returns a musical score with properties inherited from another measure music.
Details and Options
- MusicScore is function for creating, representing and manipulating musical scores with multiple voices and instruments, enabling music composition and analysis.
- MusicScore represents a musical score, which contains parallel sequences of events, such as notes and chords, in separate voices.
- The association properties can contain the following keys:
-
"VoiceList" list of voices as MusicVoice objects "KeySignature" part key signature as MusicKeySignature "MusicTempo" tempo used for playback "TimeSignature" part time signature as MusicTimeSignature - For a music score object obj, any of the above properties can be obtained using obj["prop"]. Use obj["PropertyAssociation"] to retrieve the values of all available properties.
- The following options are supported:
-
MusicTempo tempo used for playback - If a flat list of events in passed to MusicScore, it is assumed to belong to a single voice, and it is automatically partitioned into measures.
- All of the voices in a MusicScore object are played in parallel.
Examples
open all close allBasic Examples (6)
Construct a score from a list of voices:
MusicScore[{MusicVoice[{"A", "G", "E"}], MusicVoice[{"F", "E", "C"}]}]Construct a score from a list of events:
MusicScore[{"A", "G", "E"}]Construct a score from a list of events for each voice:
MusicScore[{{"A", "G", "E"}, {"F", "E", "C"}}]Construct the music score with the specified time signature and key signature:
MusicScore[{{"A", "G", "E"}, {"F", "E", "C"}}, MusicTimeSignature[3, 4], MusicKeySignature[-1]]Construct a score with properties specified in an Association:
MusicScore[{"A", "G", "E"}, <|"TimeSignature" -> MusicTimeSignature[3, 4]|>]Construct a score with default properties inherited from another MusicScore:
m = MusicScore[<|"TimeSignature" -> MusicTimeSignature[3, 4]|>];MusicScore[m, {"A", "G", "E"}, <|"KeySignature" -> MusicKeySignature[1]|>]Scope (5)
List all available properties:
score = MusicScore[{MusicRest[], "G", "C"}];
score["Properties"]List all available properties and their values:
score["PropertyAssociation"]//DatasetSpecify the instrument to be used for playback in each voice:
MusicScore[{MusicVoice[{"A", "G", "E"}, <|"Instrument" -> "Violin"|>], MusicVoice[{"F", "E", "C"}, <|"Instrument" -> "Piano"|>]}]MusicScore[{MusicVoice[{"A", "G", "E"}, <|"Instrument" -> RandomChoice@ResourceData["Wolfram Language SoundNote Styles"]|>], MusicVoice[{"F", "E", "C"}, <|"Instrument" -> RandomChoice@ResourceData["Wolfram Language SoundNote Styles"]|>]}]Get and set the "KeySignature" property:
d = MusicScore[{"A", "G", "C"}];
d["KeySignature"]MusicScore[d, MusicKeySignature["G"]]The time signature of a score defaults to 4/4:
MusicScore[{MusicNote["C", 1]}]
%["TimeSignature"]If the total duration of the events is shorter than the duration of a measure, a rest is inserted at the end:
MusicScore[{MusicNote["C", 1 / 2]}]
Cases[%, KeyValuePattern["NoteList" -> n_] :> n, Infinity]If the total duration of the events is longer than the duration of a measure, the events are split and tied accordingly:
MusicScore[{MusicNote["C", 7 / 4]}]
Cases[%, KeyValuePattern["NoteList" -> n_] :> n, Infinity]Retrieve the "VoiceList" property:
score = MusicScore[{{"A", "G#", "E"}, {"F#", "E", "C#"}}];
score["VoiceList"]Cases[score, _MusicNote ? (Positive[#["Pitch"]["Accidental"]]&), Infinity]Retrieve the octave values of all note pitches in the score:
Cases[score, m_MusicNote :> m["Pitch"]["Octave"], Infinity]Transpose the "C♯" by 5 semitones:
ReplaceAll[score, (p : MusicPitch["C#"]) :> p - MusicInterval[5]]Transpose all note pitches up by a fifth:
score + MusicInterval["PerfectFifth"]Options (1)
Properties & Relations (2)
Use MusicMeasurements to compute properties of a score:
MusicMeasurements[MusicScore[{"C", "D", "G", "Eb"}], {"Ambitus", "EstimatedKey", "PitchClasses"}]Use MusicTransform to modify a score:
MusicTransform[{"Transpose", 5}]@MusicScore[{"C", "D", "G", "Eb"}]Related Guides
History
Text
Wolfram Research (2026), MusicScore, Wolfram Language function, https://reference.wolfram.com/language/ref/MusicScore.html.
CMS
Wolfram Language. 2026. "MusicScore." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MusicScore.html.
APA
Wolfram Language. (2026). MusicScore. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MusicScore.html
BibTeX
@misc{reference.wolfram_2026_musicscore, author="Wolfram Research", title="{MusicScore}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MusicScore.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_musicscore, organization={Wolfram Research}, title={MusicScore}, year={2026}, url={https://reference.wolfram.com/language/ref/MusicScore.html}, note=[Accessed: 13-June-2026]}