Hi,
I read some older thread about mapping midiinput to variables in the forums and decided to try it myself, since i have a "korg nanoKontrol".
I want to controll the RGB values of a stroke with 3 different controllers on the "nanoKontrol".
Here is what i got so far:
I know the stroke() function belongs into the draw() function, because otherwise i can only draw while I change the controller.
I tried putting it in draw(), but then I can't access the value variable inside controllerChange().
How do I assign each RGB value a different channel number and its corresponding value? (So changing the first controller on the nanoKontrol will result in changing only the R value)
R= controllerChange(0, 2, int valueR)
G=controllerChange(0, 3, int valueG)
B=controllerChange(0, 4, int valueB)
Thanks!
rhklein
I read some older thread about mapping midiinput to variables in the forums and decided to try it myself, since i have a "korg nanoKontrol".
I want to controll the RGB values of a stroke with 3 different controllers on the "nanoKontrol".
Here is what i got so far:
import themidibus.*;
MidiBus myBus;
void setup() {
myBus = new MidiBus(this, 0, 2);
size(200, 200);
}
void draw() {
}
void controllerChange(int channel, int number, int value) {
int R = value*2;
int G = value*2;
int B = value*2;
if (mousePressed==true) {
stroke(R, G, B);
line(mouseX, mouseY, pmouseX, pmouseY);
}
}
I know the stroke() function belongs into the draw() function, because otherwise i can only draw while I change the controller.
I tried putting it in draw(), but then I can't access the value variable inside controllerChange().
How do I assign each RGB value a different channel number and its corresponding value? (So changing the first controller on the nanoKontrol will result in changing only the R value)
R= controllerChange(0, 2, int valueR)
G=controllerChange(0, 3, int valueG)
B=controllerChange(0, 4, int valueB)
Thanks!
rhklein
1