To continue the 3/8 example above, this could be shown with how many dotted crotchet beats there are per minute. Of course, other types of beat can be used for a tempo marking. You could follow the calculation above to find the length of each quaver beat, but would then need to double it to find the length of a crotchet beat, as a crotchet is twice the length of a quaver. So, this would probably have a tempo marking showing the number of eighth beats per minute. For instance, a time-signature of 3/8, tells you that there are 3 quaver (eighth) beats per bar. Note value, you need to do an extra calculation. However, if you wanted to find the length of a crotchet beat where the tempo marking shows the bpm of a This will usually be for time-signatures with crotchet beats (i.e. You can follow this simple rule to find the length of a crotchet whenever the tempo marking shows how many crotchet beats per minute there are. For instance, if a piece has a metronome marking of crotchet (quarter-note) = 120, each crotchet beat is 0.5 seconds long (60/120). To find the length in seconds of each beat for any given metronome marking in beats-per-minute (bpm), you would divide 60 (the number of seconds in a minute) by the bpm marking. In notation, measures are delimited on the staff by vertical lines. In music theory, duration is the time a note lasts for (often measured in beats) and "measure" is the (US English) name of a metrical division containing some number of beats (made of notes and/or rests) determined by the current time signature in operation. In your question you seem to be conflating the concepts "duration" and "measure". Values directly rather than just asking for the In the solution, also notice that I've accessed the Resulted in an empty iterator as there were noįlattens the hierarchy and so gives you direct access to the The object you got back from your call to
That hierarchy into just the leaf-type objects (notes and rests). music21 then provides the read-only property Most of the iterating read-only properties (includingĪrbitrarily descending it. music21 implements a hierarchical structure of containers including: The main thing you got caught out by was the behaviour of the Print "Note: %s%d %0.1f" % (n.pitch.name, n.pitch.octave, n.duration.quarterLength) Here's a version of your script that does what you want: