Hello
I saw a similar error reported here:
http://dev.processing.org/bugs/show_bug.cgi?id=458
for this error:
Invalid memory access of location 00000000 eip=9455b6c2
when running the following code (OS X Intel 10.5.5, processing 0152, mandolane, eclipse SDK 3.4.1, JRE 1.5.0_16-b06-284, version 1.5.0_16, jvm 1.5.0_16-133).
Wondered if anyone has seen anything like this when using proMIDI. I'd appreciate any suggestions.
Code:
package oglT;
/**
* openGL Test 001
*
*/
import processing.core.*;
import processing.opengl.*;
import promidi.*;
import java.util.*;
public class OpenGLTest extends PApplet {
private static final long serialVersionUID = 1L;
MidiIO midiIO;
public void setup()
{
size(1920, 1080, OPENGL); // HD
smooth();
background(20);
println("width " + width + " " + height);
// get an instance of midiIO
midiIO = MidiIO.getInstance(this);
// print a list of all devices
midiIO.printDevices();
// plug all methods to handle midievents
// note last 2 arguments are 0, 0 even though midi mon says ch1!
midiIO.plug(this,"ch1",0,0);
midiIO.plug(this,"ch2",0,1);
midiIO.plug(this,"ch3",0,2);
midiIO.plug(this,"ch4",0,3);
midiIO.plug(this,"ch5",0,4);
midiIO.plug(this,"ch6",0,5);
midiIO.plug(this,"ch7",0,6);
midiIO.plug(this,"ch8",0,7);
midiIO.plug(this,"ch9",0,8);
//midiIO.plug(this,"controllerIn",0,0);
//midiIO.plug(this,"programChange",0,0);
}
public void draw()
{
background(50, 50);
translate(width/2, height/2, 0);
scale((float) 2.0);
}
public float romm(float d) {
// TODO Auto-generated method stub
//declare a new instance of the Random class
Random aRandom = new Random();
float e = aRandom.nextFloat() * d + 0;
return e;
}
public void ch1(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 800.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
ellipse((vel)+f,(vel)+f/2,80,1);
}
public void ch2(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
ellipse((vel*2)+f,(vel*2)+f/2,20,20);
}
public void ch3(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
ellipse((vel*3)+f,(vel*3)+f/2,30,30);
}
public void ch4(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
ellipse((vel*4)+f,(vel*4)+f/2,40,40);
}
public void ch5(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
rect((vel+100)+f,(vel+500)+f/2,10,10);
}
public void ch6(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
rect((vel+600)+f,(vel+500)+f/2,20,20);
}
public void ch7(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
rect((vel+300)+f,(vel+500)+f/2,30,30);
}
public void ch8(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
rect((vel+400)+f,(vel+500)+f/2,30,30);
}
public void ch9(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
float f = romm((float) 600.1);
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
rect((vel+500)+f,(vel+500)+f/2,40,40);
}
}