I'm using Python along with Pygame which uses pyPortMidi for it's midi module, and I'm currently sending NoteOn and NoteOff messages through Midi Yoke to Ableton live, which works great. But I can't seem to figure out how I send CC messages..
Anyone?
The (working) class basically looks like this.
class MidiIO:
def __init__(self, device_id = None, inst=0):
pygame.midi.init()
pygame.fastevent.init()
if device_id is None:
self.output_id = pygame.midi.get_default_output_id()
else:
self.output_id = device_id
self._print_device_info()
port = self.output_id
print ("using output_id :%s:" % port)
self.midi_out = pygame.midi.Output(port, 0)
self.midi_out.set_instrument(inst)
self.pressed = False
def midiOut(self, btns, note=60, vel=100):
if btns == 1:
if not self.pressed:
self.midi_out.note_on(note, vel)
self.pressed = 1
elif btns == 0:
self.midi_out.note_off(note)
self.pressed = 0