histogram[interval] = 1
previousNote = note
return histogram
+
+ @property
+ def duration(self) :
+ 'Durée de référence du morceau en milisecondes'
+ it = self.iterNotes()
+ duration = 0
+ for note, verseIndex in it :
+ duration = duration + note.duration
+ duration = duration * self.quarterNoteDuration # en milisecondes
+ return duration
+
def pprint(self) :
for note, verseIndex in self.iterNotes(indefinitely=False) :
printNotes=options.printNotes)
from pprint import pprint
pprint(song.intervalsHistogram)
+ print song.duration
if __name__ == '__main__' :