rtmidi-python
rtmidi-python copied to clipboard
Controlling Ableton Live
This is not really an issue, but I don't know where I should post my question but here. I'm trying to control Ableton via the rtmidi_python library. At this point, I can send messages over bluetooth to the Slave, which receives them and sends them to Ableton. The problem is that a 'Play' command doesn't start Ableton on the other side. I can see that Ableton interpretes the command, but doesn't do anything.
When I hit play the 'Stop' button will be grayed out, but the track doesn't start and this will be printed
[242, 0, 0] [250] 0.0 When I stop the track I receive
[252] When I change my position, the slave changes the position of the track aswell, so I think the play command is not the right one. When I send a note_on message, it will be played by the Slave. I also tried to change the command to hex notation, but that doesn't seem to fix it.
Here is the midi part from the master:
midi_in = rtmidi.MidiIn() for port_name in midi_in.ports: print(port_name) selected_device = int(input('Select a device ')) midi_in.open_port(selected_device)
while recording: message, delta_time = midi_in.get_message() if message: data = json.dumps(message) sock.send(data) print(message, delta_time) And here is the slave:
midi_out = rtmidi.MidiOut() for port_name in midi_out.ports: print(port_name) midi_device = int(input('Select a device: '))
midi_out.open_port(midi_device) data = client_sock.recv(1024) while data != '': stream = client_sock.recv(1024) message = json.loads(stream.decode()) print(message) midi_out.send_message(message)
I'm also trying to get the Midi Beat Clock. How should I accomplish that?