X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/677d43acfb41f75b614b9cac0df9220906d95928..f3c7ce6115ca54c1bc5db03ce03a873ee379edcf:/src/songs/musicxmltosong.py 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]