X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/58f8fcfb15531fc052f9cdd02543cafe93428698..2fc310bc386bcc49225c214a838e3eecc7dfdbb7:/src/songs/musicxmltosong.py?ds=inline diff --git a/src/songs/musicxmltosong.py b/src/songs/musicxmltosong.py index 39df188..ed7dddf 100755 --- a/src/songs/musicxmltosong.py +++ b/src/songs/musicxmltosong.py @@ -33,6 +33,10 @@ _marker = [] class Part(object) : + requiresExtendedScale = False + scale = [55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72] + quarterNoteLength = 400 + def __init__(self, node, autoDetectChorus=True) : self.node = node self.notes = [] @@ -109,10 +113,24 @@ class Part(object) : def pprint(self) : for note, verseIndex in self.iterNotes() : print note.nom, note.name, note.midi, note.duration, note.lyrics[verseIndex] + + + def assignNotesFromMidiNoteNumbers(self): + # TODO faire le mapping bande hauteur midi + for i in range(len(self.midiNoteNumbers)): + noteInExtendedScale = 0 + while self.midiNoteNumbers[i] > self.scale[noteInExtendedScale] and noteInExtendedScale < len(self.scale)-1: + noteInExtendedScale += 1 + if self.midiNoteNumbers[i]