0

I've been struggling to obtain full control of Synesthesia (VJ program) with rtmidi (or any other midi scripting package) in python.

My main goal is to develop a midi controller in python which can turn potmeters in the VJ program on and off (I can do that already) and control faders contiounosly (thats my problem).

Actually what I really do is that I have a hand recognition algorithm (deep learning based) with which I want to make a midi controller out of my hand gestures.

What I could do already:

import rtmidi

midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()
if available_ports:
    midiout.open_port(1)
else:
    midiout.open_virtual_port("My virtual output")


# do some deep learning stuff->

#if hand recognized ->
note_on = [0x90, 60, 100]

# else

note_off = [0x80, 60, 0]


Please help I am really stucked.

Thx.

teoML
  • 784
  • 4
  • 13

1 Answers1

0

Ok, it was fast, I actually could solve it:)

control fader contiounosly:

>>> for k in range(100):
...     fader = [0xB0, 10, k]
...     midiout.send_message(fader)
...     midiout.send_message(fader)
...     time.sleep(0.01)
...

This can be also very useful, just paste command to above function:

https://ccrma.stanford.edu/~craig/articles/linuxmidi/misc/essenmidi.html