import rwmidi.*; MidiOutput output; int nota[] = new int[] { 0, 2, 3, 5, 7, 8, 10, 12 }; int prevPitch = 0; int apagarNota = 0; int apagarNota2 = 0; int pitchDelMouse =0; int pitchDelMouse2 =0; Vector imagenes = new Vector(); NuestraImagen img; int MAX; void setup() { size(800,600); noCursor(); background(0); for(int i=1; i<21; i++){ //crea el nombre String laImagenQueSeDibuja = "runo"+int(i) +".jpg"; //en base al nombre crea el objeto NuestraImagen nuevaImagen; //nuevaImagen va a ser una instancia de la clase NuestraImagen //esa imagen nueva que declaramos la creamos con el new //lo hacemos llamando al constructor (que tiene el mismo nombre que la clase) //le paso los parametros que me pide el constructor //en este caso un string con el nombre de la foto a cargar nuevaImagen = new NuestraImagen(laImagenQueSeDibuja); //el add recibe un objeto imagenes.add(nuevaImagen); } MidiOutputDevice devices[] = RWMidi.getOutputDevices(); output = RWMidi.getOutputDevices()[0].createOutput(); //ESTE FOR ES PARA QUE APAGUE AL PRINCIPIO CUALQUIER NOTA QUE QUEDE SONANDO for(int i=0; i<=127; i++){ notoutput(i); } } /////////////////////// //METODOS /* int pitchValue(int x, int y) { return (x + y) / 10 * 12 + 40; } */ void output(int lanota) { output.sendNoteOn(0, lanota, 100); } void output2(int lanota) { output.sendNoteOn(0, lanota, 100); } void notoutput(int lanota) { output.sendNoteOff(0, lanota, 100); } void notoutput2(int lanota) { output.sendNoteOff(0, lanota, 100); } void mousePressed(){ MAX = int (random(1,20)); for (int i =0; i= 1000){ imagen_i.x=0; imagen_i.y=random(0,400); } else { //a esa imagen 'pedirle" que se dibuje imagen_i.x+=1; //imagen_i.y-=10; imagen_i.dibujarImagen(); } } }