~hecanjog/pippi

55d9d06f86805cd616992eb3134bbc7b11802975 — Erik Schoster a month ago 315e05b main
adjust python message logging
1 files changed, 5 insertions(+), 5 deletions(-)

M pippi/renderer.pyx
M pippi/renderer.pyx => pippi/renderer.pyx +5 -5
@@ 1210,7 1210,6 @@ def _run_forever(Instrument instrument,
    logger.info(f'PY: running forever... {script_path=} {instrument_name=}')

    while True:
        logger.info('PY MSG: waiting for a message...')
        try:
            msg = instrument.get_message()
        except InstrumentError as e:


@@ 1227,13 1226,13 @@ def _run_forever(Instrument instrument,
                break

        if msg.type == LPMSG_SHUTDOWN:
            logger.debug('PY MSG: shutdown')
            logger.info('PY MSG: shutdown')
            for _ in range(NUM_COMRADES):
                q.put(None)
            break

        elif msg.type == LPMSG_UPDATE:
            #logger.info('PY MSG: update')
            #logger.debug('PY MSG: update')
            instrument.handle_update_message(msg.msg.decode('utf-8'))

        elif msg.type == LPMSG_MIDI_FROM_DEVICE:


@@ 1244,15 1243,16 @@ def _run_forever(Instrument instrument,
            logger.debug('PY MSG: midi to device')

        elif msg.type == LPMSG_PLAY:
            logger.info('PY MSG: play params: %s' % msg.msg)
            logger.debug('PY MSG: PLAY w/params: %s' % msg.msg)
            q.put(msg.msg.decode('utf-8'))

        elif msg.type == LPMSG_TRIGGER:
            #logger.debug('PY MSG: trigger')
            logger.debug('PY MSG: TRIGGER w/params: %s' % msg.msg)
            if astrid_schedule_python_triggers(instrument) < 0:
                logger.error('Error trying to schedule python triggers...')

        elif msg.type == LPMSG_LOAD:
            # The instrument already reloads on each message relay
            pass

    logger.info('PY: python instrument shutting down...')