X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/73afe12f27b72efbe72bfa4d8b1bf9c958f38a6e..f04df7410041506425a042a6397385de2e1abf53:/src/app/event_pprinters.py?ds=inline diff --git a/src/app/event_pprinters.py b/src/app/event_pprinters.py index 76e468c..e399583 100755 --- a/src/app/event_pprinters.py +++ b/src/app/event_pprinters.py @@ -10,15 +10,37 @@ from events import eventNames import sys self = sys.modules[__name__] -def log_COLDOWN(e) : - tone = e.column.tone - return '%s (%s)' % (tone.midi, tone.nom) +def log_NOTEON(e): + return '%3d %3d %3d' % (e.chan, e.key, e.vel) + +def log_NOTEOFF(e): + return '%3d %3d' % (e.chan, e.key) + +def log_NOTEEND(e): + return '' + +def log_COLSTATECHANGE(e): + col = e.column + tone = col.tone + return u'%2d %5s %3s %3s %s' % \ + (col.index, col.state, tone.midi, tone.name, e.syllabus) -def log_COLSTATECHANGE(e) : - return u'%5s %s' % (e.state, e.syllabus) +def _log_col(e) : + """ formate les événements de colonne COLDOWN, COLUP, COLOVER + - etat + - index de colonne + - hauteur midi + - nom de la note /A-G[#b]?/ + """ + col = e.column + tone = col.tone + pos = e.pos + return u'%2d %5s %3s %3s %r' % \ + (col.index, col.state, tone.midi, tone.name, pos) + +log_COLDOWN = log_COLUP = log_COLOVER = _log_col def log_default(e) : - return '' return str(e) pprinters = {}