$URL$
"""
import fluidsynth
-from musicxmltosong import musicXml2Song
+from app.musicxml import musicXml2Song
from time import sleep
import sys
from optparse import OptionParser
def play(self) :
fs = self.fs
for note, verseIndex in self.part.iterNotes(indefinitely=False) :
- print note, note.lyrics[verseIndex]
+ try :
+ print note, note.lyrics[verseIndex]
+ except IndexError :
+ print note, '?'
fs.noteon(0, note.midi, 64)
duration = note.duration * self.quarterNoteDuration / 1000
sleep(duration)
op.add_option("-i", "--part-index", dest="partIndex"
, default = 0
, help = "Index de la partie qui contient le champ.")
+
+ op.add_option("-c", '--no-chorus', dest='autoDetectChorus'
+ , action="store_false"
+ , default = True
+ , help = "désactive la détection du refrain")
+
op.add_option("-q", "--quarter-note-duration", dest="quarterNoteDuration"
, type="int", default=400
, help="Durée de la noire [default] (en millisecondes)"
)
+
op.add_option("-b", "--bank", dest="bank"
, type="int", default="0"
, help="midi bank [default]")
+
op.add_option("-p", "--preset", dest="preset"
, type="int", default="0"
, help="midi preset [default]")
if len(args) != 1 :
raise SystemExit(op.format_help())
- song = musicXml2Song(args[0], partIndex=options.partIndex)
+ song = musicXml2Song(args[0],
+ partIndex=options.partIndex,
+ autoDetectChorus=options.autoDetectChorus)
sp = SongPlayer(song,
'/Users/pinbe/dev/minwii/fluid-soundfont-3.1/FluidR3_GM.sf2',
quarterNoteDuration=options.quarterNoteDuration,