projects
/
minwii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Utilisation de la police "Arial Unicode.ttf" qui comporte le caractère « ♭ ».
[minwii.git]
/
src
/
app
/
musicxml.py
diff --git
a/src/app/musicxml.py
b/src/app/musicxml.py
index
ab6dbf9
..
ec3be4a
100755
(executable)
--- a/
src/app/musicxml.py
+++ b/
src/app/musicxml.py
@@
-53,6
+53,7
@@
class Part(object) :
self.notes = []
self.repeats = []
self.distinctNotes = []
self.notes = []
self.repeats = []
self.distinctNotes = []
+ self.quarterNoteDuration = 500
self._parseMusic()
self.verses = [[]]
self.chorus = []
self._parseMusic()
self.verses = [[]]
self.chorus = []
@@
-104,6
+105,15
@@
class Part(object) :
self.repeats.append(barline)
self.distinctNotes.sort(lambda a, b : cmp(a.midi, b.midi))
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 _findChorus(self):
@@
-138,7
+148,6
@@
class Part(object) :
def iterNotes(self, indefinitely=True) :
"exécution de la chanson avec l'alternance couplets / refrains"
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 :
if indefinitely == False :
iterable = self.verses
else :
@@
-235,7
+244,7
@@
class Tone(object) :
def name(self) :
name = '%s%d' % (self.step, self.octave)
if self.alter < 0 :
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)
else :
alterext = '#'
name = '%s%s' % (name, abs(self.alter) * alterext)
@@
-245,10
+254,10
@@
class Tone(object) :
def nom(self) :
name = FR_NOTES[self.step]
if self.alter < 0 :
def nom(self) :
name = FR_NOTES[self.step]
if self.alter < 0 :
- alterext =
'b
'
+ alterext =
u'♭
'
else :
else :
- alterext = '#'
- name = '%s%s' % (name, abs(self.alter) * alterext)
+ alterext =
u
'#'
+ name =
u
'%s%s' % (name, abs(self.alter) * alterext)
return name
return name