projects
/
minwii.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
découpage des fichiers de log par chansons jouées.
[minwii.git]
/
src
/
app
/
synth.py
diff --git
a/src/app/synth.py
b/src/app/synth.py
index
9fb4a3e
..
eb19235
100755
(executable)
--- a/
src/app/synth.py
+++ b/
src/app/synth.py
@@
-7,7
+7,9
@@
$URL$
"""
from os.path import realpath, sep, exists
from fluidsynth import Synth as FSynth
"""
from os.path import realpath, sep, exists
from fluidsynth import Synth as FSynth
-from log import console
+from log import console, envLogger
+import pygame
+import events
class Synth(FSynth) :
"""
class Synth(FSynth) :
"""
@@
-33,10
+35,11
@@
class Synth(FSynth) :
self.start()
self.fsid = self.sfload(sfPath)
self._octaveAjusts = {}
self.start()
self.fsid = self.sfload(sfPath)
self._octaveAjusts = {}
- console.info('démarrage du synthétiseur\nsoundfont : %s', sfPath)
+ console.info('démarrage du synthétiseur')
+ envLogger.info('soundfont : %s', sfPath)
def __del__(self) :
def __del__(self) :
- console.info('arrêt du synthétiseur
.
')
+ console.info('arrêt du synthétiseur')
self.delete()
def adjust_octave(self, chan, octave) :
self.delete()
def adjust_octave(self, chan, octave) :
@@
-57,7
+60,11
@@
class Synth(FSynth) :
def noteon(self, chan, key, vel):
key = key + self._octaveAjusts.get(chan, 0) * 12
FSynth.noteon(self, chan, key, vel)
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)
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)