MusicVoice
MusicVoice[{event1, event2, ...}]
MusicVoice[{measure1, measure2, ...}]
MusicVoice[content, properties]represents one sequential musical voice. Event lists are partitioned into MusicMeasure objects by the Wolfram Kernel.
MusicVoice[{
MusicNote["C4", 1/4],
MusicNote["D4", 1/4],
MusicNote["E4", 1/4],
MusicNote["G4", 1/4]
}]Container properties include "MeasureList", "TimeSignature", "KeySignature", "MusicTempo" and "Instrument".
Instruments
Assign an instrument through the property association:
MusicVoice[
{"C4", "D4", "E4", "G4"},
<|"Instrument" -> "Flute"|>
]The instrument is propagated to the generated SoundNote events and selected independently on the frontend.
Parallel voices
Put several voices in a MusicScore to play them in parallel:
MusicScore[{
MusicVoice[{"C4", "D4", "E4", "G4"}, <|"Instrument" -> "Flute"|>],
MusicVoice[{"C3", "G2"}, <|"Instrument" -> "Trumpet"|>]
}]The score preview assigns a distinct color to each concurrent voice.
See the Wolfram Language reference for the complete symbolic API.