Skip to content

Commit

Permalink
Fix glitching when websocket connected
Browse files Browse the repository at this point in the history
  • Loading branch information
euwbah committed Aug 9, 2021
1 parent 51711bb commit d4ef3eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 5 additions & 3 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ def tune_and_send_note(note, vel, cc74):
# if a note overrides another active note in the same input channel,
# stop that note. Prevents ghosts that hang around.
if existing := tracker.check_existing(channel):
print(f'max channel used: sent {existing.edosteps_from_a4} off')
self.send_note_off(existing.channel_sent, existing.midi_note_sent, 0)
ws_server.send_note_off(existing.edosteps_from_a4, 0)

def do_later():
time.sleep(0.001)
if CONFIGS.SLIDE_MODE == SlideMode.FIXED:
self.send_cc(channel, 74, CONFIGS.SLIDE_FIXED_N)
self.send_cc(channel, 74, CONFIGS.SLIDE_FIXED_N)

if CONFIGS.SLIDE_MODE == SlideMode.FIXED:
threading.Thread(target=do_later).start()

threading.Thread(target=do_later).start()
tracker.register_on(note, vel, channel, send_note, send_ch, edosteps_from_a4)

ws_server.send_note_on(edosteps_from_a4, vel)
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def intable(s):


if __name__ == '__main__':
print('microtonal seaboard retuner v0.4.5c')
print('microtonal seaboard retuner v0.4.5d')

has_read_configs = configs.read_configs()

Expand Down
1 change: 0 additions & 1 deletion ws_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ async def handler(websocket, path):

while True:
message = await message_queue['async'].get()
print(f'queue got {message}')
await websocket.send(message)


Expand Down

0 comments on commit d4ef3eb

Please sign in to comment.