X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/58f8fcfb15531fc052f9cdd02543cafe93428698..f3c7ce6115ca54c1bc5db03ce03a873ee379edcf:/src/songs/musicxmltosong.py?ds=sidebyside 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]