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 = []
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]<self.scale[noteInExtendedScale]:
+ noteInExtendedScale -= 1
+ self.notes.append(noteInExtendedScale)
+
class Note(object) :
+ scale = [55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72]
+
def __init__(self, node, divisions, previous) :
self.node = node
self.step = _getNodeValue(node, 'pitch/step')
name = '%s%s' % (name, abs(self.alter) * alterext)
return name
+ @property
+ def column(self):
+ return self.scale.index(self.midi)
+
class Lyric(object) :