hi!
i'm a beginner too(i started in december
but i have work a little bit , and tonight there is nothing to do except to help you on this sketch
i work with sound too and that's why i have ever use the promidi library.
So, i have try to do something (i think it's working )
i don't have write nothing for the comment (excuse for my bad english) but i have use some Object and Array of objects.it's more easy to use.
////this is the first page
import promidi.*;
MidiOut midiOut;
MidiIO midiIO;
int numEllipse=8;
int cc,giveInc;
int [] c = new int[numEllipse];
int [] x ={
320,461,520,461,320,179,120,179};
int [] y={
120,179,320,461,520,461,320,179};
int [] diam={
64,64,64,64,64,64,64,64};
int [] noteNum={
60,61,62,63,64,65,66,67};
int [] contNum={
70,71,72,73,74,75,75,76};
int [] value = new int[numEllipse];
Note [] sound = new Note[numEllipse];
Controller [] increment=new Controller[numEllipse];
SoundCircle[] circle=new SoundCircle[numEllipse];
void setup(){
size(640, 640);
smooth();
background(255);
noStroke();
//le MIDI
midiIO = MidiIO.getInstance(this);
println("<<<<<<<<<< Ports Midi >>>>>>>>>>");
midiIO.printDevices();
midiOut = midiIO.getMidiOut(0,3);
for(int i=0;i<numEllipse;i++){
sound[i]=new Note(noteNum[i],127,50);
increment[i]=new Controller(contNum[i],value[i]);
circle[i]=new SoundCircle(x[i],y[i],diam[i],increment[i],c[i]);
}
}
void draw() {
background(255);
for(int i=0;i<numEllipse;i++){
//circle[i].update();
circle[i].display();
value[i]=circle[i].giveInc;
if(mouseX!=pmouseX){
midiOut.sendController(circle[i].increment);
}
print(circle[0].giveInc+" "+circle[4].giveInc+" ");
}
}
////this is the second page
class SoundCircle{
int x,y,diam,c,giveInc;
Controller increment;
SoundCircle(int ix,int iy,int idiam,Controller iincrement,int ic){
x=ix;
y=iy;
diam=idiam;
increment=iincrement;
c=ic;
}
void display(){
c=int(dist(mouseX,mouseY,x,y));
cc=constrain(c,0,600);
fill(c);
giveInc = int(map(cc,0,600,0,127));
ellipse(x,y,diam,diam);
}
}
voilà !!
have a nice trip
say me if it's working
ciao