Alright I got it to work finally (yes!). Partly because I'm an idiot and had an epiphany today in my Digital Synthesis class but also because FL Studio handles the channels oddly.
Here's what I did to get processing to communicate through MIDI to FL Studio just so other people don't run into many problems.
1. Install MIDI Yoke, this is a great MIDI routing application, I recommend it.
2. In FL Studio go to Options -> MIDI Settings (F10). Under "Input" select "In From MIDI Yoke: 1" and click the box that says "Enable" so that is lights up. You can leave the Controller Type as "generic controller."
3. In Processing first import the MIDI Bus library and create a MidiBus variable. For the sake of this example I'll be naming mine "myBus" per the basic example. Then assign a bus to your "myBus" variable with the output set to "Out To MIDI Yoke: 1" like so:
Code: myBus = new MidiBus(this, "", "Out To MIDI Yoke: 1"); // Create a new MidiBus with no input device and MIDI Yoke as the output device.
4. Assign integers for "channel," "control number" and "velocity". I used "myChannel," "myNumber" and "myVolume." I have set myChannel to "0", myNumber to "7" and myVolume to "60."
5. In FL Studio go to the knob that you want Processing to influence, right-click and select "Link to controller..." Set the channel to whatever number you used for myChannel +1. Therefore I would set mine to "1" because I used "0." Set controller to the number you assigned to myNumber, I would used "7."
6. The last step is in Processing. Use a sendControllerChange command like so:
Code:myBus.sendControllerChange(myChannel, myNumber, myVolume);
7. Now test it out!
In my example below I have mapped the keys "+" and "-" to directly influence the volume of the knob. Keep in mind if you're not controlling volume you may want to rename your variables to something that makes more sense as to what you're attempting to change. Here's my code:
Code:import themidibus.*; //Import the library
MidiBus myBus; // The MidiBus
int myVolume = 60;
int myNumber = 7;
int myChannel = 0; // Channel is +1 in FL Studio. i.e., 0 = 1, 1 = 2, etc.,
int myPitch = 64;
void setup() {
size(400,400);
background(0);
MidiBus.list(); // ===List all available Midi devices on STDOUT. This will show each device's index and name.
myBus = new MidiBus(this, "", "Out To MIDI Yoke: 1"); // Create a new MidiBus with no input device and MIDI Yoke as the output device.
}
void draw() {
}
void keyPressed() {
if(key == '=') {
// up
myVolume = myVolume + 1;
fill(255, 0, 0);
ellipse(width/2, height/2, myVolume, myVolume);
myBus.sendControllerChange(myChannel, myNumber, myVolume);
} else if(key == '-') {
// down
myVolume = myVolume - 1;
fill(0, 255, 0);
ellipse(width/2, height/2, myVolume, myVolume);
myBus.sendControllerChange(myChannel, myNumber, myVolume);
}
}
Hopefully this helps anyone that's having trouble communicating with FL Studio. The tricky part was figuring out that FL Studio operates 1 channel above the MIDI Bus channel. I couldn't find anything directly related to this subject and I hope I'm not the only one attempting to do this