MidiIn midiIn; // Draws to Processing and Postscript simultaneously // by replacing calls to fill(), line() etc. by // custom functions that carry out operations in both. boolean fileOpen=false; SimplePostscript ps; int filenum=0; //storyabout@empal.com int vine_total_ori = 5; int vine_total = vine_total_ori; int vine_max = 1000000; vine [] vine_array = new vine [vine_max]; void setup(){ String filename="curl_and_ps_" +filenum +".ps"; print(filename +"\n"); ps=SimplePostscript.open(filename, 0,0, width,height); // Make a new MidiInputObject and open it midiIn = new MidiIn(); midiIn.showAvailableInputs(); midiIn.openInput(1); size(400,700); background(0); vine_gen_ori(); } void loop(){ for(int i=0;i1 && !mousePressed){ vine_array[i].grow(); } } //println(midiIn.getNote(0)); framerate(midiIn.getController(0,74)); int init = midiIn.getNote(0); if(init > 71 && midiIn.triggered(0)){ ps.close(); fileOpen=false; String filename="curl_and_ps_" +filenum +".ps"; print(filename +"\n"); ps=SimplePostscript.open(filename, 0,0, width,height); filenum++; fileOpen=true; vine_total = vine_total_ori; vine_gen_ori(); background(midiIn.getController(0,7),midiIn.getController(0,91),midiIn.getController(0,93)); } } void vine_gen_ori(){ for(int i=0;i