playMode = PLAYING_MODES_DICT[playMode]
song = musicXml2Song(songFile)
bank, preset = instrumentDescription['bank'], instrumentDescription['preset']
+ octave = instrumentDescription.get('octave', 0)
+ synth.adjust_octave(0, octave)
synth.program_select(0, bank, preset)
playingScreen = SongPlayingScreen(synth, song, mode=playMode)
playingScreen.run()
self.start()
self.fsid = self.sfload(sfPath)
+ self._octaveAjusts = {}
+
+ def adjust_octave(self, chan, octave) :
+ '''
+ Abaisse ou élève les notes de n octave
+ '''
+ self._octaveAjusts[chan] = octave
def sfunload(self, update_midi_preset=0):
FSynth.sfunload(self, self.fsid, update_midi_preset=update_midi_preset)
def sfont_select(self, chan):
FSynth.sfont_select(self, chan, self.fsid)
-
+ def noteon(self, chan, key, vel):
+ key = key + self._octaveAjusts.get(chan, 0) * 12
+ FSynth.noteon(self, chan, key, vel)
+
+ def noteoff(self, chan, key) :
+ key = key + self._octaveAjusts.get(chan, 0) * 12
+ FSynth.noteoff(self, chan, key)
if __name__ == '__main__' :