MusicNote[p]
returns a music note with the specified pitch p.
MusicNote[p,d]
returns a music note with the specified pitch p and duration d.
MusicNote[p, d,properties]
returns a music note with the specified property association properties.
MusicNote[music,p, d,properties]
returns a music note with properties inherited from another music note music.
MusicNote
MusicNote[p]
returns a music note with the specified pitch p.
MusicNote[p,d]
returns a music note with the specified pitch p and duration d.
MusicNote[p, d,properties]
returns a music note with the specified property association properties.
MusicNote[music,p, d,properties]
returns a music note with properties inherited from another music note music.
Details and Options
- MusicNote represents a single note defining properties are pitch and duration.
- MusicNote represents a musical note, whose defining characteristics are its pitch and its duration.
- The pitch p can be specified using:
-
pitch a MusicPitch object name a string represanting a named pitch (e.g. "C4") int an integer representing a MIDI pitch (middle C is 60) - The duration d can be specified using:
-
duration a MusicDuration object namedDuration a string representing a named duration (e.g. "Eighth") dur a number representing a musical duration beats a "Beats" Quantity - The association properties can contain the following keys:
-
"Duration" note duration "Pitch" note pitch "SoundVolume" volume at which the note is going to be played "Style" metadata about the note object "TieType" whether this note is tied to an adjacent note » - Possible "TieType" values are:
-
"NotTied" the current note is not tied "TiedAfter" the note is tied to the one after it "TiedBefore" the note is tied to the one before it "TiedBeforeAfter" the note is tied both to the one after and the one before it - Possible "Style" values include:
-
"Staccato" the playback duration is reduced to 0.5 of the original "Staccatissimo" the playback duration is reduced to 0.25 of the original "Trill" the playback alternates between the nominal pitch and the one above it » "Turn" figure consisting of the pitch above the nominal one, the nominal pitch, the pitch below and the nominal pitch again » "InvertedTurn" figure consisting of the pitch below the nominal one, the nominal pitch, the pitch above and the nominal pitch again » "Mordent" alternation between the nominal pitch, the pitch above and the nominal pitch again » "InvertedMordent" alternation between the nominal pitch, the pitch below and the nominal pitch again » - For a music note object obj, any of the above properties can be obtained using obj["prop"]. Use obj["PropertyAssociation"] to retrieve the values of all available properties.
Examples
open all close allBasic Examples (4)
Construct the music note with a specified pitch:
MusicNote["G"]Construct the music note with a specified pitch and duration:
MusicNote["G", 1 / 2]Construct the music note with properties specified in an Association:
MusicNote[<|"Pitch" -> MusicPitch@"D5", "Duration" -> 1 / 2|>]Construct the music note with default properties inherited from another MusicNote:
m = MusicNote["G"]MusicNote[m, 1 / 2]Scope (12)
m = MusicNote["C", 1 / 4];
m["Properties"]List all available properties with their values:
m["PropertyAssociation"]//DatasetIf both a pitch and a duration are specified in an unambiguous way, they can be passed to MusicNote in any order:
MusicNote[MusicPitch["G"], MusicDuration[1 / 2]]MusicNote[MusicDuration[1 / 2], MusicPitch["G"]]Specify the pitch using a number:
MusicNote[70]Specify the pitch using a string:
MusicNote["A#4"]Specify the pitch using a MusicPitch object:
MusicNote[MusicPitch[Association["Accidental" -> 1, "Octave" -> 4, "Key" -> "A", "Name" -> "ASharp"]]]Specify the duration using a number:
MusicNote[MusicPitch["G"], 1 / 2]Specify the duration using a "Beats" Quantity:
MusicNote[MusicPitch["G"], Quantity[2, "Beats"]]Specify the duration using a named duration:
MusicNote[MusicPitch["G"], "half"]Specify the duration using a MusicDuration object:
MusicNote[MusicPitch["G"], MusicDuration[Association["Duration" -> 1/2, "Name" -> "Half"]]]Construct the music note using properties extracted from the given SoundNote:
MusicNote[SoundNote[10]]Get and set the "Duration" property:
m = MusicNote["C5"];
m["Duration"]MusicNote[m, MusicDuration[1 / 2]]Get and set the "Pitch" property:
m = MusicNote["C"];
m["Pitch"]MusicNote[m, MusicPitch["G4"]]List supported values for the "TieType" property:
MusicNote["TieTypes"]Two notes tied together are equivalent to a single note with duration:
MusicMeasure@MusicNote["G", 1]MusicMeasure@{MusicNote["G", <|"Duration" -> 1 / 2, "TieType" -> "TiedAfter"|>], MusicNote["G", <|"Duration" -> 1 / 2, "TieType" -> "TiedBefore"|>]}Using ties allows for having longer notes that span multiple measures:
MusicVoice[MusicMeasure /@ {MusicNote["G", <|"Duration" -> 1, "TieType" -> "TiedAfter"|>], MusicNote["G", <|"Duration" -> 1, "TieType" -> "TiedBefore"|>]}]Notes that do not fit in a single measure are automatically split and tied:
voice = MusicVoice@MusicNote["G", 2]Cases[voice, _MusicNote, Infinity]List recognized values for the "Style" property:
MusicNote["Styles"]MusicMeasure@MusicNote[<|"Pitch" -> "G", "Duration" -> 1, "Style" -> "Trill"|>]MusicMeasure@Table[MusicNote[If[OddQ[i], "G", "A"], 1 / 32], {i, 32}]Create a note with a "Turn" style:
MusicMeasure@MusicNote[<|"Pitch" -> "G", "Duration" -> 1, "Style" -> "Turn"|>]This is equivalent to a sequence of "A", "G", "F" and "G" notes:
MusicMeasure@{MusicNote["A", 1 / 32], MusicNote["G", 1 / 32], MusicNote["F", 1 / 32], MusicNote["G"]}Create a note with a "InvertedTurn" style:
MusicMeasure@MusicNote[<|"Pitch" -> "G", "Duration" -> 1, "Style" -> "InvertedTurn"|>]This is equivalent to a sequence of "F", "G", "A" and "G" notes:
MusicMeasure@{MusicNote["F", 1 / 32], MusicNote["G", 1 / 32], MusicNote["A", 1 / 32], MusicNote["G"]}Create a note with a "Mordent" style:
MusicMeasure@MusicNote[<|"Pitch" -> "G", "Duration" -> 1, "Style" -> "Mordent"|>]This is equivalent to a sequence of "G", "A" and "G" notes:
MusicMeasure@{MusicNote["G", 1 / 32], MusicNote["A", 1 / 32], MusicNote["G"]}Create a note with a "InvertedMordent" style:
MusicMeasure@MusicNote[<|"Pitch" -> "G", "Duration" -> 1, "Style" -> "InvertedMordent"|>]This is equivalent to a sequence of "G", "F" and "G" notes:
MusicMeasure@{MusicNote["G", 1 / 32], MusicNote["F", 1 / 32], MusicNote["G"]}Options (1)
Properties & Relations (4)
If the specified pitch is None (i.e. a musical silence), then a MusicRest will be returned:
MusicNote[None]A MusicVoice may split and tie notes when partitioning an event list into MusicMeasure containers:
v = MusicVoice[{MusicNote["C", 1]}, MusicTimeSignature[2, 4]]notes = v["MeasureList", "NoteList"]MusicMeasurements[notes[[All, 1]], {"Duration", "TieType"}]The "NoteList" property of MusicMeasurements automatically resolves ties:
MusicMeasurements[v, "NoteList"]Convert a MusicNote object to Audio:
Audio@MusicNote["C", 1 / 2]Use MusicNote as a Sound primitive:
Sound[{MusicNote["C", 1 / 2]}]Related Guides
History
Text
Wolfram Research (2026), MusicNote, Wolfram Language function, https://reference.wolfram.com/language/ref/MusicNote.html.
CMS
Wolfram Language. 2026. "MusicNote." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MusicNote.html.
APA
Wolfram Language. (2026). MusicNote. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MusicNote.html
BibTeX
@misc{reference.wolfram_2026_musicnote, author="Wolfram Research", title="{MusicNote}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MusicNote.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_musicnote, organization={Wolfram Research}, title={MusicNote}, year={2026}, url={https://reference.wolfram.com/language/ref/MusicNote.html}, note=[Accessed: 12-June-2026]}