self = sys.modules[__name__]
def log_NOTEON(e):
- return ''
+ return '%3d %3d %3d' % (e.chan, e.key, e.vel)
def log_NOTEOFF(e):
- return ''
+ return '%3d %3d' % (e.chan, e.key)
def log_NOTEEND(e):
return ''
(col.index, col.state, tone.midi, tone.name, e.syllabus)
def _log_col(e) :
- """ formate l'événement
+ """ formate les événements de colonne COLDOWN, COLUP, COLOVER
- etat
- index de colonne
- hauteur midi
log_COLDOWN = log_COLUP = log_COLOVER = _log_col
def log_default(e) :
- return ''
return str(e)
pprinters = {}
FORMAT = "%(ticks)-10s %(eventName)-15s %(message)s"
def process(self, msg, kwargs) :
- pp = pprinters.get(msg.type, lambda e: '')
+ pp = pprinters.get(msg.type, lambda e: str(e))
extra = {}
extra['eventType'] = msg.type
extra['eventName'] = eventNames[msg.type]
self.WT = _WTFacade()
def run(self) :
- "manage the screen sequence display"
+ "séquençage de l'affichage des écrans"
pygame.display.set_mode(self.screenResolution)
pygame.display.set_caption('MinWii')
playMode = PLAYING_MODES_DICT[playMode]
song = musicXml2Song(songFile)
bank, preset = instrumentDescription['bank'], instrumentDescription['preset']
- octave = instrumentDescription.get('octave', 0)
+ octave = instrumentDescription['octave']
self.synth.adjust_octave(0, octave)
self.synth.program_select(0, bank, preset)
playingScreen = SongPlayingScreen(self.synth, song, mode=playMode)
from os.path import realpath, sep, exists
from fluidsynth import Synth as FSynth
from log import console
+import pygame
+import events
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)