X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/820dda3f2152d653172c5caef86ddf33fb7abc0e..dc8216d3cd94fe2a5d89c6e8a4fae5de2f25bc9b:/src/app/synth.py diff --git a/src/app/synth.py b/src/app/synth.py index 9fb4a3e..71fa126 100755 --- a/src/app/synth.py +++ b/src/app/synth.py @@ -8,6 +8,8 @@ $URL$ from os.path import realpath, sep, exists from fluidsynth import Synth as FSynth from log import console +import pygame +import events class Synth(FSynth) : """ @@ -57,7 +59,11 @@ class Synth(FSynth) : def noteon(self, chan, key, vel): key = key + self._octaveAjusts.get(chan, 0) * 12 FSynth.noteon(self, chan, key, vel) + evt = pygame.event.Event(events.NOTEON, chan=chan, key=key, vel=vel) + pygame.event.post(evt) def noteoff(self, chan, key) : key = key + self._octaveAjusts.get(chan, 0) * 12 FSynth.noteoff(self, chan, key) + evt = pygame.event.Event(events.NOTEOFF, chan=chan, key=key) + pygame.event.post(evt)