When I click a button I want the sound to start in ableton and my parameters to change, but what processing does is constantly send noteOn's to ableton, what means that the clip constantly starts over, giving it some sort of noise.
What I want is that it sends a noteOn when I click, I keep my finger pressed on the mouse, the sound stays, and when I move the mouse the knob changes. when I release, the sound must stop.
import rwmidi.*;
MidiOutput output;
void setup() {
size(128*5, 128*5);
output = RWMidi.getOutputDevices()[2].createOutput();
}
void draw() {
if ( mousePressed == true ) {
int ret = output.sendNoteOn(0, 1, 120);
int ret2 = output.sendController(0, 1, mouseY/5);
}
if ( mousePressed == false ) {
int ret3 = output.sendNoteOff(0, 1, 120);
int ret2 = output.sendNoteOff(1, 2, 120);
}
1