chore: publish current ableton mcp ai workspace
This commit is contained in:
23
temp_socket_cmd.py
Normal file
23
temp_socket_cmd.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import socket
|
||||
import json
|
||||
|
||||
def send_cmd(cmd):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect(('127.0.0.1', 9877))
|
||||
s.sendall(json.dumps(cmd).encode() + b'\x00')
|
||||
data = b''
|
||||
while True:
|
||||
chunk = s.recv(8192)
|
||||
if not chunk:
|
||||
break
|
||||
if b'\x00' in chunk:
|
||||
data += chunk.replace(b'\x00', b'')
|
||||
break
|
||||
data += chunk
|
||||
s.close()
|
||||
return data.decode()
|
||||
|
||||
# Get tracks first
|
||||
result = send_cmd({'action': 'get_tracks'})
|
||||
print("=== TRACKS ===")
|
||||
print(result[:3000])
|
||||
Reference in New Issue
Block a user