chore: publish current ableton mcp ai workspace
This commit is contained in:
63
check_status.py
Normal file
63
check_status.py
Normal file
@@ -0,0 +1,63 @@
|
||||
import socket
|
||||
import json
|
||||
|
||||
def send_cmd(type_name, params=None, timeout=10):
|
||||
params = params or {}
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sock.settimeout(timeout)
|
||||
try:
|
||||
sock.connect(('127.0.0.1', 9877))
|
||||
msg = json.dumps({'type': type_name, 'params': params}) + '\n'
|
||||
sock.sendall(msg.encode())
|
||||
data = b''
|
||||
while True:
|
||||
try:
|
||||
chunk = sock.recv(16384)
|
||||
if not chunk:
|
||||
break
|
||||
data += chunk
|
||||
try:
|
||||
return json.loads(data.decode())
|
||||
except:
|
||||
continue
|
||||
except socket.timeout:
|
||||
break
|
||||
return json.loads(data.decode()) if data else None
|
||||
except Exception as e:
|
||||
return {'error': str(e)}
|
||||
finally:
|
||||
sock.close()
|
||||
|
||||
print('='*70)
|
||||
print('ESTADO ACTUAL DE ABLETON LIVE - POST GENERACION')
|
||||
print('='*70)
|
||||
|
||||
# Info de sesion
|
||||
session = send_cmd('get_session_info')
|
||||
if session and session.get('status') == 'success':
|
||||
r = session.get('result', {})
|
||||
print(f'\n[SESION]')
|
||||
print(f' BPM: {r.get('bpm', 'N/A')}')
|
||||
print(f' Signature: {r.get('signature', 'N/A')}')
|
||||
print(f' Tracks: {r.get('track_count', 'N/A')}')
|
||||
print(f' Scenes: {r.get('scene_count', 'N/A')}')
|
||||
print(f' Current Time: {r.get('current_song_time', 'N/A')}')
|
||||
else:
|
||||
print(f'\n[Sesion error: {session}]')
|
||||
|
||||
# Info de tracks
|
||||
print(f'\n[TRACKS EN ABLETON]')
|
||||
for i in range(8):
|
||||
track = send_cmd('get_track_info', {'track_index': i}, timeout=5)
|
||||
if track and track.get('status') == 'success':
|
||||
r = track.get('result', {})
|
||||
name = r.get('name', f'Track {i}')
|
||||
clips = r.get('clip_count', 0)
|
||||
is_midi = r.get('has_midi_input', False)
|
||||
if name or clips > 0:
|
||||
tipo = 'MIDI' if is_midi else 'Audio'
|
||||
print(f' {i}: {name} [{tipo}] - {clips} clips')
|
||||
|
||||
print('\n' + '='*70)
|
||||
print('[OK] Verificacion completada')
|
||||
print('='*70)
|
||||
Reference in New Issue
Block a user