self.notes = []
self.repeats = []
self.distinctNotes = []
+ self.quarterNoteDuration = 500
self._parseMusic()
self.verses = [[]]
self.chorus = []
self.repeats.append(barline)
self.distinctNotes.sort(lambda a, b : cmp(a.midi, b.midi))
+ sounds = self.node.getElementsByTagName('sound')
+ tempo = 120
+ for sound in sounds :
+ if sound.hasAttribute('tempo') :
+ tempo = float(sound.getAttribute('tempo'))
+ break
+
+ self.quarterNoteDuration = int(round(60000/tempo))
+
def _findChorus(self):
def iterNotes(self, indefinitely=True) :
"exécution de la chanson avec l'alternance couplets / refrains"
- print 'indefinitely', indefinitely
if indefinitely == False :
iterable = self.verses
else :
def name(self) :
name = '%s%d' % (self.step, self.octave)
if self.alter < 0 :
- alterext = 'b'
+ alterext = '♭'
else :
alterext = '#'
name = '%s%s' % (name, abs(self.alter) * alterext)
def nom(self) :
name = FR_NOTES[self.step]
if self.alter < 0 :
- alterext = 'b'
+ alterext = u'♭'
else :
- alterext = '#'
- name = '%s%s' % (name, abs(self.alter) * alterext)
+ alterext = u'#'
+ name = u'%s%s' % (name, abs(self.alter) * alterext)
return name