/* This is the first part of building a 4-step Sequencer Synthesizer modeling the one found at : http://www.handmadeelectronicinstruments.com/store/product/four-step-sequencer-synthesizer/ In this step we build a non-interactive user interface. Andy Sarroff, 2/2014 */ PImage bgimg; PImage knob; PImage ledOn; PImage ledOff; PImage swOn; PImage swOff; void setup() { imageMode(CENTER); // --------- Load all images ---------- // The background will look like brushed aluminum // http://img.ehowcdn.com/default/ehow/images/a07/fd/m6/types-brushed-aluminum-sheets-1.1-800x800.jpg size(692, 346); bgimg = loadImage("aluminum.jpg"); bgimg.resize(bgimg.width*2, bgimg.height); // Image of aknob. The downloaded image was altered to convert the white // background with to a clear background. // http://578e7a9bafc08e847f59-b21544d490ba797ec9de9d17e947de3d.r81.cf1.rackcdn.com/lrs-18519e_7379.jpg knob = loadImage("knob_t.png"); knob.resize(knob.width/4, 0); // The LED image was altered to create a second LED that looks unlit // http://openclipart.org/image/300px/svg_to_png/88123/led_red_black.png ledOn = loadImage("led.png"); ledOn.resize(ledOn.width/10, 0); ledOff = loadImage("ledOff.png"); ledOff.resize(ledOff.width/10, 0); //The downloaded image was split into two images and the background was made // transparent // http://www.yourpowercentre.com.au/wp-content/uploads/2013/10/switch.jpg swOn = loadImage("swOn.png"); swOn.resize(swOn.width/3, 0); swOff = loadImage("swOff.png"); swOff.resize(swOff.width/3, 0); size(bgimg.width, bgimg.height); background(bgimg); } void draw() { background(bgimg); image(knob, width/8, knob.height/2); image(swOff, width/8+width/4, knob.height/2); image(knob, width/8+2*width/4, knob.height/2); image(knob, width/8+3*width/4, knob.height/2); for (int i=0; i<4; i++) { image(knob, width/8+i*width/4, height-knob.height/2); image(ledOff, width/8+i*width/4, height/2); } } // START NO NOTES // code used to capture screenshots void keyReleased() { boolean online = true; if (key == '`' && !online) save("sketch.png"); }