error handling, launcher ui, read-only mode, rm plot/smooth
This commit is contained in:
parent
cee4cb81b7
commit
4f31985930
59 changed files with 1299 additions and 781 deletions
|
|
@ -15,7 +15,7 @@ try:
|
|||
API = rtmidi.API_UNIX_JACK if 'jack' in argv else rtmidi.API_UNSPECIFIED
|
||||
if API is rtmidi.API_UNIX_JACK and rtmidi.API_UNIX_JACK not in rtmidi.get_compiled_api():
|
||||
API = rtmidi.API_UNSPECIFIED
|
||||
ipc_send('log', 'python-rtmidi was not compiled with jack midi support, falling back to default API')
|
||||
ipc_send('log', '(ERROR, MIDI) python-rtmidi was not compiled with jack midi support, falling back to default API')
|
||||
|
||||
JACK = API == rtmidi.API_UNIX_JACK
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ try:
|
|||
out_dev = rtmidi.MidiOut(API, 'OSC->MIDI probe')
|
||||
|
||||
except:
|
||||
ipc_send('log', 'ERROR: MIDI: python-rtmidi not found (or wrong version)\nRunning with python version %s' % version)
|
||||
ipc_send('log', '(ERROR, MIDI) python-rtmidi not found (or wrong version)\nRunning with python version %s' % version)
|
||||
ipc_send('log', '\nGet python-rtmidi at https://spotlightkid.github.io/python-rtmidi/')
|
||||
exit()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,17 @@ def list():
|
|||
|
||||
message = []
|
||||
|
||||
message.append('===========')
|
||||
message.append('MIDI Inputs')
|
||||
message.append('-1: Void (bypass)')
|
||||
message.append('(MIDI) Inputs')
|
||||
message.append(' -1: Void (bypass)')
|
||||
|
||||
for i in range(in_dev.get_port_count()):
|
||||
message.append('%i: %s' % (i, in_dev.get_port_name(i)))
|
||||
message.append(' %i: %s' % (i, in_dev.get_port_name(i)))
|
||||
|
||||
message.append('===========')
|
||||
message.append('MIDI Outputs')
|
||||
message.append('-1: Void (bypass)')
|
||||
message.append('(MIDI) Outputs')
|
||||
message.append(' -1: Void (bypass)')
|
||||
|
||||
for i in range(out_dev.get_port_count()):
|
||||
message.append('%i: %s' % (i, out_dev.get_port_name(i)))
|
||||
message.append(' %i: %s' % (i, out_dev.get_port_name(i)))
|
||||
|
||||
ipc_send('log', '\n'.join(message))
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ def create_callback(name):
|
|||
ipc_send('osc', osc)
|
||||
|
||||
if debug:
|
||||
ipc_send('log','MIDI received: %s From: midi:%s' % (midi_str(message), name))
|
||||
ipc_send('log','(MIDI) in: %s From: midi:%s' % (midi_str(message), name))
|
||||
|
||||
|
||||
def callback_error_wrapper(event, data):
|
||||
|
|
@ -107,7 +107,7 @@ def create_callback(name):
|
|||
try:
|
||||
receive_midi(event, data)
|
||||
except:
|
||||
ipc_send('log', 'ERROR: MIDI: %s' % traceback.format_exc())
|
||||
ipc_send('log', '(ERROR, MIDI) %s' % traceback.format_exc())
|
||||
|
||||
return callback_error_wrapper
|
||||
|
||||
|
|
@ -138,11 +138,11 @@ sysexRegex = re.compile(r'([^0-9A-Fa-f])\1(\1\1)*')
|
|||
def send_midi(name, event, *args):
|
||||
|
||||
if name not in outputs:
|
||||
ipc_send('log','ERROR: MIDI: unknown output (%s)' % name)
|
||||
ipc_send('log','(ERROR, MIDI) unknown output (%s)' % name)
|
||||
return
|
||||
|
||||
if event not in OSC_TO_MIDI:
|
||||
ipc_send('log','ERROR: MIDI: invalid address (%s)' % event)
|
||||
ipc_send('log','(ERROR, MIDI) invalid address (%s)' % event)
|
||||
return
|
||||
|
||||
m = None
|
||||
|
|
@ -190,7 +190,7 @@ def send_midi(name, event, *args):
|
|||
|
||||
if m is None:
|
||||
|
||||
ipc_send('log','ERROR: MIDI: could not convert osc to midi (%s %s)' % (event, " ".join([str(x) for x in args])))
|
||||
ipc_send('log','(ERROR, MIDI) could not convert osc to midi (%s %s)' % (event, " ".join([str(x) for x in args])))
|
||||
|
||||
else:
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ def send_midi(name, event, *args):
|
|||
|
||||
if debug:
|
||||
|
||||
ipc_send('log','MIDI sent: %s To: midi:%s' % (midi_str(m), name))
|
||||
ipc_send('log','(MIDI) out: %s To: midi:%s' % (midi_str(m), name))
|
||||
|
||||
|
||||
while True:
|
||||
|
|
@ -213,4 +213,4 @@ while True:
|
|||
msg[1] = msg[1].lower()
|
||||
send_midi(*msg)
|
||||
except:
|
||||
ipc_send('log', 'ERROR: MIDI: %s' % traceback.format_exc())
|
||||
ipc_send('log', '(ERROR, MIDI) %s' % traceback.format_exc())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue