Search code examples
pythonmusic21

How to get the duration of a note as a number in music21?


In music21, if I want to get the duration of a note, I get an object, of the form 'music21.duration.Duration {number}'. I can't find anywhere how to get this {number} alone. Is there some other music21 property or method (not one's own) that provides such a value?


Solution

  • I found it. It's note.duration.quarterLength.