doc++
impression « raw » des événements quelconques.
git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@151
fe552daf-6dbe-4428-90eb-
1537e0879342
self = sys.modules[__name__]
def log_NOTEON(e):
self = sys.modules[__name__]
def log_NOTEON(e):
+ return '%3d %3d %3d' % (e.chan, e.key, e.vel)
+ return '%3d %3d' % (e.chan, e.key)
def log_NOTEEND(e):
return ''
def log_NOTEEND(e):
return ''
(col.index, col.state, tone.midi, tone.name, e.syllabus)
def _log_col(e) :
(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
- etat
- index de colonne
- hauteur midi
log_COLDOWN = log_COLUP = log_COLOVER = _log_col
def log_default(e) :
log_COLDOWN = log_COLUP = log_COLOVER = _log_col
def log_default(e) :
return str(e)
pprinters = {}
return str(e)
pprinters = {}
FORMAT = "%(ticks)-10s %(eventName)-15s %(message)s"
def process(self, msg, kwargs) :
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]
extra = {}
extra['eventType'] = msg.type
extra['eventName'] = eventNames[msg.type]
self.WT = _WTFacade()
def run(self) :
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')
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']
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)
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
from os.path import realpath, sep, exists
from fluidsynth import Synth as FSynth
from log import console
+import pygame
+import events
class Synth(FSynth) :
"""
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)