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 & HelpSyntax Questions › static/non-static
Page Index Toggle Pages: 1
static/non-static (Read 556 times)
static/non-static
Apr 24th, 2009, 9:49pm
 
ok, i'm trying to use the sliders on my korg nano control to put input into Processing.  i'm using [url]RWMidi http://ruinwesen.com/support-files/rwmidi/documentation/RWMidi.html  [/url]  i can get my keyboard to send notes, but i don't understand the syntax for getting the controller commands in.  i'm getting cannot make static reference to the non-static method if i uncomment the lines in void draw  

Code:
import rwmidi.*;

MidiInput keys;
MidiInput nano;


void setup() {
keys = RWMidi.getInputDevices()[4].createInput(this);
println(RWMidi.getInputDevices()[4].createInput(this));
nano = RWMidi.getInputDevices()[5].createInput(this);
println(RWMidi.getInputDevices()[5].createInput(this));
println(RWMidi.getInputDeviceNames());

}

void noteOnReceived(Note note) {
println("note on " + note.getPitch());
}


void draw() {

//int val=Controller.getCC();
// println(val);


}


i know it's something with classes, but i don't quite understand what.  I searched for the error, but got all Java results, which don't really make sense to me (I know that processing is java based).  do i do something similar to

Code:

void noteOnReceived(Note note) {
println("note on " + note.getPitch());
}


for the controller? if so, how?

thanks
Re: static/non-static
Reply #1 - Apr 24th, 2009, 9:56pm
 
got it:   Code:
void controllerChangeReceived(Controller controller){
println("change"+ controller.getCC());
}
Page Index Toggle Pages: 1