MusicVoice[{measure1,measure2,…}]
returns a musical voice that contains the MusicMeasure objects measurei.
MusicVoice[{event1,event2,…}]
returns a musical voice that contains the musical events eventi.
MusicVoice[{{event11,event12,…},{event21,event22,…}}]
returns a musical voice that contains the musical events eventij in the ith measure.
MusicVoice[events,ts,ks]
returns a musical voice with time signature ts and key signature ks.
MusicVoice[events,ts,ks,properties]
returns a musical voice with the specified property association properties.
MusicVoice[music,events,ts,ks,properties]
returns a musical voice with properties inherited from another voice music.
MusicVoice
MusicVoice[{measure1,measure2,…}]
returns a musical voice that contains the MusicMeasure objects measurei.
MusicVoice[{event1,event2,…}]
returns a musical voice that contains the musical events eventi.
MusicVoice[{{event11,event12,…},{event21,event22,…}}]
returns a musical voice that contains the musical events eventij in the ith measure.
MusicVoice[events,ts,ks]
returns a musical voice with time signature ts and key signature ks.
MusicVoice[events,ts,ks,properties]
returns a musical voice with the specified property association properties.
MusicVoice[music,events,ts,ks,properties]
returns a musical voice with properties inherited from another voice music.
Details and Options
- MusicVoice represents a single musical voice or part, defining an ordered sequence of measures.
- MusicVoice represents a single musical voice or part, defined by an ordered sequence of measures.
- If a list of musical events is passed as input, it will be automatically partitioned into measures according to the time signature specification.
- The association properties can contain the following keys:
-
"MeasureList" list of measures as MusicMeasure objects "Instrument" instrument used for playback "KeySignature" part key signature as MusicKeySignature "MusicTempo" tempo used for playback "TimeSignature" part time signature as MusicTimeSignature - For a music voice object obj, any of the above properties can be obtained using obj["prop"]. Use obj["PropertyAssociation"] to retrieve the values of all available properties.
- Each of the input MusicMeasure objects can have independent time and key signatures.
- The following options are supported:
-
MusicTempo tempo used for playback
Examples
open all close allBasic Examples (6)
Construct the music voice containing the specified measures:
MusicVoice[{MusicMeasure[{"C", "G", "E", "F"}], MusicMeasure[{MusicNote["C", 1]}]}]Construct the music voice containing the specified events:
MusicVoice[{"C", "G", "E", "F", MusicChord["CMajor", 1]}]Construct music voice from a list of events for each measure:
MusicVoice[{{"C", "G", "E"}, {"F", "C"}}]Construct the music voice with the specified time signature and key signature:
MusicVoice[{{"C", "G", "E"}, {"F", "C"}}, MusicTimeSignature[3, 4], MusicKeySignature[1]]Construct the music voice with properties specified in an Association:
MusicVoice[{"C", "G", "E", "F", "C"}, <|"TimeSignature" -> MusicTimeSignature[3, 4]|>]Construct the music voice with default properties inherited from another MusicVoice:
m = MusicVoice[<|"TimeSignature" -> MusicTimeSignature[3, 4]|>]MusicVoice[m, {"C", "G", "E", "F", "C"}, <|"KeySignature" -> MusicKeySignature[1]|>]Scope (6)
List all available properties:
v = MusicVoice[{MusicRest[], "G", "C"}];
v["Properties"]List all available properties and their values:
v["PropertyAssociation"]//DatasetWhen a list of events is specified, the events are automatically partitioned into measures:
MusicVoice[{"C", "G", "E", "F", MusicChord["CMajor", 1]}]
%["MeasureList"]If any of the events overlaps a measure boundary, it is split and the resulting events are tied:
MusicVoice[{MusicNote["C", 1 / 2], MusicNote["F", 1 / 4], MusicChord["CMajor", 5 / 4]}]
%["MeasureList", All, "NoteList"]Each measure in a voice can have a different time signature:
MusicVoice[{MusicMeasure[{"C", "G", "E"}, MusicTimeSignature[3, 4]], MusicMeasure[{"C", "G", "E", "F", "C"}, MusicTimeSignature[5, 4]]}]The time signature of the voice is always the same as the time signature of the first measure:
%["TimeSignature"]Each measure in a voice can have a different key signature:
MusicVoice[{MusicMeasure[{"C#", "G", "E"}, MusicKeySignature[2]], MusicMeasure[{"C", "G", "E", "F", "C"}, MusicKeySignature[0]]}]The time signature of the voice is always the same as the key signature of the first measure:
%["KeySignature"]Specify the instrument to be used for playback:
MusicVoice[{"C", "G", "E", "F", "C"}, <|"Instrument" -> "Violin"|>]MusicVoice[{"C", "G", "E", "F", "C"}, <|"Instrument" -> RandomChoice@ResourceData["Wolfram Language SoundNote Styles"]|>]Retrieve the "MeasureList" property:
voice = MusicVoice[{{"A", "G#", "E"}, {"F#", "E", "C#"}}];
voice["MeasureList"]Cases[voice, _MusicNote ? (Positive[#["Pitch"]["Accidental"]]&), Infinity]Retrieve the octave values of all note pitches in the voice:
Cases[voice, m_MusicNote :> m["Pitch"]["Octave"], Infinity]Transpose the "C♯" by 5 semitones:
ReplaceAll[voice, (p : MusicPitch["C#"]) :> p - MusicInterval[5]]Transpose all note pitches up by a fifth:
voice + MusicInterval["PerfectFifth"]Options (1)
MusicTempo (1)
Specify a tempo to use for playback:
m = MusicVoice[{"C", "G", "E", "F", "C"}, MusicTempo -> 88]Compute the voice duration as a quantity of seconds, using the specified tempo:
Duration[m]By default, the tempo for playback is set to 120 beats per minute:
Duration[MusicVoice[{"C", "G", "E", "F", "C"}]]Properties & Relations (2)
Use MusicMeasurements to compute properties of a measure:
MusicMeasurements[MusicVoice[{"C", "D", "G", "Eb"}], {"Ambitus", "EstimatedKey", "PitchClasses"}]Use MusicTransform to modify a measure:
MusicTransform[{"Transpose", 5}]@MusicVoice[{"C", "D", "G", "Eb"}]Related Guides
History
Text
Wolfram Research (2026), MusicVoice, Wolfram Language function, https://reference.wolfram.com/language/ref/MusicVoice.html.
CMS
Wolfram Language. 2026. "MusicVoice." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MusicVoice.html.
APA
Wolfram Language. (2026). MusicVoice. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MusicVoice.html
BibTeX
@misc{reference.wolfram_2026_musicvoice, author="Wolfram Research", title="{MusicVoice}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MusicVoice.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_musicvoice, organization={Wolfram Research}, title={MusicVoice}, year={2026}, url={https://reference.wolfram.com/language/ref/MusicVoice.html}, note=[Accessed: 13-June-2026]}