MusicDuration[dur]
returns the note duration with the specified duration dur.
MusicDuration[dur,mult]
returns the note duration with dur sounding in the space of dur*mult.
MusicDuration[dur,mult,properties]
returns the note duration with the specified property association properties.
MusicDuration[music,dur,properties]
returns the note duration with properties inherited from another note duration music.
MusicDuration[music,dur,mult,properties]
returns the note duration with properties inherited from another note duration music.
MusicDuration
MusicDuration[dur]
returns the note duration with the specified duration dur.
MusicDuration[dur,mult]
returns the note duration with dur sounding in the space of dur*mult.
MusicDuration[dur,mult,properties]
returns the note duration with the specified property association properties.
MusicDuration[music,dur,properties]
returns the note duration with properties inherited from another note duration music.
MusicDuration[music,dur,mult,properties]
returns the note duration with properties inherited from another note duration music.
Details
- MusicDuration is used to express the time occupied by musical events such as notes, chords and rests. It can be expressed as a note value or beats.
- MusicDuration is used to express the time occupied by musical events such as MusicNote, MusicRest and MusicChord.
- Possible values for the duration specification dur are:
-
d note value as a real number name named duration (e.g. "Quarter" or "Whole") beats Quantity of type "Beats" s Quantity of type "Seconds" note a MusicNote, MusicRest or MusicChord object - A real-valued duration corresponds to a fraction of a "Whole" note value defined as 1. As an example, a duration of 1/4 corresponds to a "Quarter" note value.
- The association properties can contain the following keys:
-
"BeatDuration" duration of a beat, related to MusicTimeSignature "Beats" nominal duration in beats "Duration" nominal duration as a fraction of a whole note "Multiplier" tuplet multiplier on the nominal duration "RealBeats" beats including tuplet multiplier "RealDuration" duration including tuplet multiplier - For a music duration object obj, any of the above properties can be obtained using obj["prop"]. Use obj["PropertyAssociation"] to retrieve the values of all available properties as an Association.
- A MusicDuration object can represent a duration in terms of note value or beats. The two representations are linked by the "BeatDuration" property, which indicates what note value a beat corresponds to. This can be useful in compound time signatures such as 6/8, where a beat typically corresponds to three eighth notes.
- MusicDuration[dur,mult] is typically used to express tuplet durations. For example, an eighth note triplet duration can be expressed as MusicDuration[1/8, 2/3].
- The "RealDuration" and "RealBeats" properties are computed as the "Duration" and "Beats" properties multiplied with the "Multiplier" property, respectively.
Examples
open all close allBasic Examples (4)
Construct the duration occupying 1/2 of a whole note, or a half note:
MusicDuration[1 / 2]Construct the duration occupying 1/8 of a whole note with a multiplier of 2/3, or an eighth note triplet:
MusicDuration[1 / 8, 2 / 3]Construct the duration with properties specified in an Association:
MusicDuration[<|"Beats" -> 1, "BeatDuration" -> 3 / 8|>]Construct the duration with default properties inherited from another MusicDuration object:
d = MusicDuration[1 / 8]MusicDuration[d, <|"BeatDuration" -> 3 / 8|>]Additionally, specify a new "Duration":
MusicDuration[d, 1 / 4, <|"BeatDuration" -> 3 / 8|>]Additionally, specify a new "Multiplier":
MusicDuration[d, 1 / 4, 2 / 3, <|"BeatDuration" -> 3 / 8|>]Scope (9)
List all available properties:
MusicDuration[1 / 8]["Properties"]List all available properties and their values:
MusicDuration[1 / 8]["PropertyAssociation"]//DatasetConstruct the music note duration of a specified named beat length:
MusicDuration["Eighth"]Construct the music note duration occupying one and a half beats:
MusicDuration[Quantity[1.5, "Beats"]]Construct the music note duration occupying a quantity of seconds, assuming a default tempo of 120 beats per minute:
MusicDuration[Quantity[1, "Seconds"]]Construct an eighth note duration with a multiplier of 2/3, or a eighth note triplet:
MusicDuration[1 / 8, 2 / 3]Construct the same duration using its name:
MusicDuration["eighth triplet"]Construct the music note duration from a specified MusicNote:
MusicNote["G", 1 / 8]MusicDuration[%]Construct the music note duration from other music events, MusicChord and MusicRest:
MusicRest[1 / 8]MusicDuration[%]MusicChord["C Major", 1 / 8]MusicDuration[%]MusicDuration[<|"Beats" -> 1|>]Use the "RealBeats" property to retrieve the beats value including a tuplet multiplier:
MusicDuration[%, 2 / 3]{%["Beats"], %["RealBeats"]}MusicDuration[<|"Duration" -> 1 / 4|>]Use the "RealDuration" property to retrieve the duration value including a tuplet multiplier:
MusicDuration[%, <|"Multiplier" -> 2 / 3|>]{%["Duration"], %["RealDuration"]}Retrieve and set the "BeatDuration" property:
d = MusicDuration[1 / 4];
{d["BeatDuration"], d["Beats"]}d = MusicDuration[d, <|"BeatDuration" -> 3 / 8|>];
{d["BeatDuration"], d["Beats"]}Related Guides
History
Text
Wolfram Research (2026), MusicDuration, Wolfram Language function, https://reference.wolfram.com/language/ref/MusicDuration.html.
CMS
Wolfram Language. 2026. "MusicDuration." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MusicDuration.html.
APA
Wolfram Language. (2026). MusicDuration. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MusicDuration.html
BibTeX
@misc{reference.wolfram_2026_musicduration, author="Wolfram Research", title="{MusicDuration}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/MusicDuration.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_musicduration, organization={Wolfram Research}, title={MusicDuration}, year={2026}, url={https://reference.wolfram.com/language/ref/MusicDuration.html}, note=[Accessed: 12-June-2026]}