+ super(PlayingScreen, self).__init__(distinctNotes)
+
+ #cracra code
+ soundFont = '/Users/pinbe/dev/minwii/fluid-soundfont-3.1/FluidR3_GM.sf2'
+ bank = preset = 0
+
+ self.fs = fs = fluidsynth.Synth()
+ fs.start()
+ self.fsid = fsid = fs.sfload(soundFont)
+ fs.program_select(0, fsid, bank, preset)
+
+ def __del__(self) :
+ self.fs.delete()
+
+ @event_handler(events.NOTEON)
+ def noteon(self, evt) :
+ tone = evt.tone
+ self.fs.noteon(0, tone.midi, 64)
+
+ @event_handler(events.NOTEOFF)
+ def noteoff(self, evt) :
+ tone = evt.tone
+ self.fs.noteoff(0, tone.midi)
+