MusicPlot[music]
plots the pitches contained in music.
MusicPlot
MusicPlot[music]
plots the pitches contained in music.
Details and Options
- MusicPlot returns a single graphic showing the piano roll corresponding to the notes in music.
- The music input can be any of the following:
-
MusicMeasure a MusicMeasure object MusicVoice a MusicVoice object MusicScore a MusicScore object - MusicPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
Axes True whether to draw axes GridLines {Automatic,None} grid lines to draw PlotLayout Automatic plot layout for multiple voices PlotStyle Automatic the styles in which objects are to be drawn Ticks {"Beats",Automatic} axes ticks - In the PlotRange options, the horizontal specification is interpreted as a number of measures and the y specification as a pitch.
- PlotRange supports the following special settings:
-
m {{0,m},Automatic} plot m measures {m1,m2} {{m1,m2},Automatic} plot the events from measure m1 to measure m2 - The horizontal specification can also be a "Beats" quantity (e.g. Quantity[4,"Beats"]).
- The pitch specification can also be a MusicPitch object.
- ColorData["DefaultPlotColors"] gives the default sequence of colors used by PlotStyle.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes True whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines {Automatic,None} grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PlotLabel None an overall label for the plot PlotLayout Automatic plot layout for multiple voices PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotStyle Automatic the styles in which objects are to be drawn PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks {"Beats",Automatic} axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open all close allBasic Examples (2)
MusicPlot[MusicMeasure[{"C", "G", "A", "C"}]]MusicPlot[MusicVoice[{"C", "G", "A", "C"}]]MusicPlot[MusicScore[{"C", "G", "A", "C"}]]Plot a musical score with multiple voices:
MusicPlot[MusicScore[{{"C", "G", "A", "C"}, {"E5", "G5", "D5", "C5"}}]]Scope (3)
Plot a voice with multiple measures:
MusicPlot[MusicVoice[Association["MeasureList" ->
{MusicMeasure[Association["NoteList" ->
{MusicNote[Association["Pitch" -> MusicPitch[Association["Accidental" -> 0, "Key" -> "C"]],
"Duration" -> MusicDuration[Association["BeatDuration ... ]},
"TimeSignature" -> MusicTimeSignature[Association["Numerator" -> 4, "Denominator" -> 4,
"BeatLength" -> 1]]]]}, "TimeSignature" -> MusicTimeSignature[
Association["Numerator" -> 4, "Denominator" -> 4, "BeatLength" -> 1]]]]]Plot a voice with multiple measures with different time signatures:
MusicPlot[MusicVoice[Association["MeasureList" ->
{MusicMeasure[Association["NoteList" ->
{MusicNote[Association["Pitch" -> MusicPitch[Association["Accidental" -> 0, "Key" -> "C"]],
"Duration" -> MusicDuration[Association["BeatDuration ... " -> 3/8, "Beats" -> 1]]]]},
"TimeSignature" -> MusicTimeSignature[Association["Numerator" -> 6, "Denominator" -> 8]]]]},
"TimeSignature" -> MusicTimeSignature[Association["Numerator" -> 4, "Denominator" -> 4,
"BeatLength" -> 1]]]]]Plot a score with multiple measures with different time signatures:
MusicPlot[MusicScore[<|"VoiceList" ->
{MusicVoice[<|"MeasureList" ->
{MusicMeasure[<|"NoteList" -> {MusicNote[<|"Pitch" -> MusicPitch[<|"Accidental" -> 0,
"Key" -> "C"|>], "Duration" -> MusicDuration[<|"BeatDuration" -> 1/4,
... enominator" -> 8|>]|>]},
"TimeSignature" -> MusicTimeSignature[<|"Numerator" -> 4, "Denominator" -> 4,
"BeatLength" -> 1|>]|>]}, "TimeSignature" ->
MusicTimeSignature[<|"Numerator" -> 4, "Denominator" -> 4, "BeatLength" -> 1|>]|>]]Options (5)
PlotRange (2)
Specify the horizontal plot range as a number of measures:
s = Import["ExampleData/scale.mid", "MusicScore"];
MusicPlot[s]MusicPlot[s, PlotRange -> 2]MusicPlot[s, PlotRange -> {0, 2}]MusicPlot[s, PlotRange -> Quantity[3, "Beats"]]Specify the vertical plot range using MIDI pitch numbers:
s = Import["ExampleData/scale.mid", "MusicScore"];
MusicPlot[s, PlotRange -> {Automatic, {50, 80}}]Use MusicPitch objects:
MusicPlot[s, PlotRange -> {Automatic, {MusicPitch["G3"], MusicPitch["G5"]}}]PlotLayout (1)
Specify the layout for plotting multiple voices:
MusicPlot[MusicScore[{{"C", "G", "A", "C"}, {"E5", "G5", "D5", "C5"}}], PlotLayout -> Automatic]Plot the voices in a column arrangement:
MusicPlot[MusicScore[{{"C", "G", "A", "C"}, {"E5", "G5", "D5", "C5"}}], PlotLayout -> "Column"]PlotStyle (1)
Specify the color used to display events:
MusicPlot[MusicScore[{"C", "G", "A", "C"}], PlotStyle -> StandardRed]If there are multiple voices, specify a color for each voice:
MusicPlot[MusicScore[{{"C", "G", "A", "C"}, {"E5", "G5", "D5", "C5"}}], PlotStyle -> {StandardRed, StandardBlue}]Related Guides
History
Text
Wolfram Research (2026), MusicPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/MusicPlot.html.
CMS
Wolfram Language. 2026. "MusicPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MusicPlot.html.
APA
Wolfram Language. (2026). MusicPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MusicPlot.html
BibTeX
@misc{reference.wolfram_2026_musicplot, author="Wolfram Research", title="{MusicPlot}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MusicPlot.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_musicplot, organization={Wolfram Research}, title={MusicPlot}, year={2026}, url={https://reference.wolfram.com/language/ref/MusicPlot.html}, note=[Accessed: 13-June-2026]}