how to measure the musical length of a stream in music21?

45 views Asked by At

i want to measure the musical lenght of a music21 stream. the stream is a short midi file exported from my DAW.

sequence = converter.parse('In MIDI/input.mid')
measures = sequence.getElementsByClass(stream.Measure)
num_measures = len(measures)
print(f"The Stream has {num_measures} measures.")

will output

The Stream has 0 measures.

What am i doing wrong?

0

There are 0 answers