Monday, 26 May 2014

3 softpots connected to Ableton + MIDIBUS

import cc.arduino.*;
import processing.serial.*;
import nl.tue.id.oocsi.*;
import themidibus.*;

Arduino arduino;
OOCSI oocsi;
MidiBus busA;


int potPin=0;
int potPin1=1;
int potPin2=2;
int val;
int val1;
int val2;

void setup() {
 
  arduino = new Arduino(this, Arduino.list() [0], 57600);
  arduino.pinMode(potPin, Arduino.OUTPUT);
  arduino.pinMode(potPin1, Arduino.OUTPUT);
  arduino.pinMode(potPin2, Arduino.OUTPUT);
 
 
  MidiBus.list();
           
  busA = new MidiBus(this, "Output to Audio software", "Output to Audio software"); // Change these names to the name of the port, of your 1st sensor

 
}

void draw() {
val = arduino.analogRead(potPin)/8;
val1 = arduino.analogRead(potPin1)/8;
val2 = arduino.analogRead(potPin2)/8;


busA.sendControllerChange(0, 0, val); //Send a controllerChange to OutgoingA and OutgoingC through busA
busA.sendControllerChange(0, 1, val1); //Send a controllerChange to OutgoingB through busB
busA.sendControllerChange(0, 2, val2);


}

No comments:

Post a Comment