X-Git-Url: https://svn.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/cf0a97e6fca3155000772d961bba89c215e1b457..848568d13d75f6f7b458ec464d5a5c836d0d8572:/src/app/synth.py

diff --git a/src/app/synth.py b/src/app/synth.py
index 1910643..469fd04 100755
--- a/src/app/synth.py
+++ b/src/app/synth.py
@@ -7,7 +7,7 @@ $URL$
 """
 from os.path import realpath, sep, exists
 from  fluidsynth import Synth as FSynth
-from log import console
+from log import console, envLogger, eventLogger
 import pygame
 import events
 
@@ -36,7 +36,7 @@ class Synth(FSynth) :
         self.fsid = self.sfload(sfPath)
         self._octaveAjusts = {}
         console.info('démarrage du synthétiseur')
-        console.info('soundfont : %s', sfPath)
+        envLogger.info('soundfont : %s', sfPath)
     
     def __del__(self) :
         console.info('arrêt du synthétiseur')
@@ -57,14 +57,22 @@ class Synth(FSynth) :
     def sfont_select(self, chan):
         FSynth.sfont_select(self, chan, self.fsid)
 
+
+    # on loggue les noteon / noteoff en utilisant les événements pygame
+    # mais ils ne sont pas postés -> on fait ça pour que le log de l'événement
+    # et l'exécution du noteon/off soit effectué au sein de la même itération
+    # de la boucle principale.
+    
     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)
+        eventLogger.info(evt)
+        #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)
+        eventLogger.info(evt)
+        #pygame.event.post(evt)