writing a GUI in processing

When I first started looking into the Processing language it is quickly apparent that out of the box there is very little in the way of handling user input by way of GUIs. This has been rectified in a very nice way by the team who developed controlP5 this is in my opinion the easiest GUI library I’ve ever used enabling me to create sliders and knobs in a matter of minutes, having programmed very little in processing before. What I came up with is the start of the interface for my planned ardunio controlled synth system:

import controlP5.*;

ControlP5 controlP5;
int myColorBackground = color(0,0,0);

void setup() {
size(400,200);
controlP5 = new ControlP5(this);
controlP5.addSlider("Pitch",0,100,50,50,50,10,100);
controlP5.addSlider("LFO",0,100,50,150,50,10,100);
controlP5.addSlider("Duty Cycle",0,100,50,250,50,10,100);
controlP5.addKnob("Volume",0,11,5,330,70,40);
}

void draw() {
background(myColorBackground);
}