add midi note

This commit is contained in:
remilia 2025-04-25 19:04:59 +08:00
parent e19026bfb8
commit 8fc003cfb3
2 changed files with 16 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class Beamformer(Node):
arg_msg: ImageArgMsg = Msg.decode_msg(r[:id2])
rf_frame_msg: RfFrameMsg = Msg.decode_msg(r[id2:])
mat = RfMat.from_rf_frame(rf_frame_msg.rf_frame, 'gpu')
logger.info(mat.frame_meta.blake2b)
# logger.info(mat.frame_meta.blake2b)
if mat is None:
continue
if arg_msg.v2 != last_v2 or arg_msg.f_rows != last_f_rows:

View File

@ -1,4 +1,5 @@
import logging
import time
from threading import Thread
from unittest import case
@ -43,6 +44,9 @@ class Midi(Node):
self.t_midi_event_loop = Thread(target=self.midi_event_loop)
self.t_midi_event_loop.start()
self.pp = self.c.ctx.socket(zmq.PUSH)
self.pp.connect('tcp://q1hyb.as:23456')
def midi_event_loop(self):
while self.do_loop:
midi_msg: Message = self.m_input.receive()
@ -121,8 +125,17 @@ class Midi(Node):
case 7:
self.arg.tgc = sorted((1, self.arg.tgc + msg.value, 127))[1]
case 'note_on':
self.sid += 1
self.send(SetSidMsg(self.sid))
match msg.note:
case 23:
self.pp.send_string('start')
case 15:
self.pp.send_string('stop')
case 7:
self.pp.send_string('single')
case 31:
self.pp.send_string('orig')
# self.sid += 1
# self.send(SetSidMsg(self.sid))
self.send(self.arg)
if self.c.sub in p: