We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › proMidi Constructor Controller ...
Page Index Toggle Pages: 1
proMidi Constructor Controller ... (Read 1063 times)
proMidi Constructor Controller ...
Dec 9th, 2008, 3:15pm
 
I´m running processing with the Ozone midi controller .
When i run the midiout example from the proMidi library the next message appears :

The constructor Controller (int, int, int) is undefined.

        at this point is the yellow line  

          new Controller(0,myNumber,int(xPos/6)+2)
          );

How can i fix it?

Here´s the example :



import processing.opengl.*;
import promidi.*;

MidiIO midiIO;
MidiOut midiOut;
Bowl[] bowl;

void setup(){
 size(128*5,128*5);
 background(0);
 smooth();

 //get an instance of MidiIO
 midiIO = MidiIO.getInstance(this);
 
 //print a list with all available devices
 midiIO.printDevices();
 
 //open an midiout using the first device and the first channel
 midiOut = midiIO.getMidiOut(0,0);

 bowl = new Bowl[30];
 for(int i = 0;i < bowl.length;i++){
   bowl[i] = new Bowl(i);
 }
 noStroke();
}

void draw(){
 background(0);
 for(int i = 0;i < bowl.length;i++){
   bowl[i].move();
   bowl[i].paint();
 }

}

class Bowl{
 float xSpeed;
 float ySpeed;
 float xPos;
 float yPos;
 Note note;
 color col;
 int myNumber;

 Bowl(int number){
   xSpeed = random(2,20);
   ySpeed = random(2,20);
   note = new Note(0,0,0);
   col = color(
     random(0,255),
     random(0,255),
     random(0,255)
   );
   myNumber = number;
 }

 void move(){
   xPos += xSpeed;
   yPos += ySpeed;
   midiOut.sendController(
     new Controller(0,myNumber,int(xPos/6)+2)
   );  // here´s the problem
   
   if(xPos > width || xPos < 0){
     xSpeed = -xSpeed;
     xPos += xSpeed;

     playNote();
   }
   if(yPos > width || yPos < 0){
     ySpeed = -ySpeed;
     yPos += ySpeed;
     playNote();
     midiOut.sendProgramChange(
       new ProgramChange(0,myNumber)
     );
   }
 }

 void playNote(){
   note = new Note(int(xPos/5f),int(yPos/10f)+60,int(random(1000)));
   midiOut.sendNote(note);
 }

 void paint(){
   fill(col);
   ellipse(xPos,yPos,20,20);
 }
}

Thanks ...
Re: proMidi Constructor Controller ...
Reply #1 - Dec 22nd, 2008, 4:36am
 
I'd like an answer to this also.  Should we contact the author of the library?
Re: proMidi Constructor Controller ...
Reply #2 - Dec 27th, 2008, 2:15pm
 
i am also have a similar problem
Re: proMidi Constructor Controller ...
Reply #3 - Apr 2nd, 2009, 4:00am
 
here is the solution,
http://processing.org/discourse/yabb2/?num=1221863743
Page Index Toggle Pages: 1