I saw the different answers to this kind of question but i didn't found any answer for my problem:
When I run this sketch it works but after a time it takes me this "error":
PImage img;
int x, y;
float r, g, b;
void setup(){
size(200,200);
img = loadImage("sunflower.jpg");
}
void draw(){
loadPixels();
img.loadPixels();
int loc = x + y*width;
r = red(img.pixels[loc]);
g = green(img.pixels[loc]);
b = blue(img.pixels[loc]);
pixels[loc] = color(r,g,b);
x++;
if (x>width){
y++;}
if (y>height){
y=0;
}
background(pixels[loc]);
}
I'm working on a project about the frequencies of sound and light.. and for the first step i found that i need to get the frequency information of an AudioPlayer:
how can i indicate to processing that what i want to have is the information (i guess, it are numbers), the values of the different sound frequencies of an specific loadFile?
Thanks a lot for any help about this topic!
Agustín
I'm trying to convert audio frequency into light frequency:
low sound frequency to low lighting frequency (Blue)
mid sound frequency to mid lighting frequency (Green)
high sound frequency to high lighting frequency (Red)
The void draw() that I want to make is very simple, because it is in concept, just "1 pixel" (rect(0,0,width, height), changing color with the size of the hole screen:
The thing is that i want to use a microphone Input to do the convertion of frequencies in real time... it is possible???
Anybody knows how can i do it into reality??
I've search at the examples library but all i found there is to transform frequency into waves... and it is not what i want...
At the hole project is to upload the finish process into an open and beta website; with the information of tutorials (how to install and simple use processing for this aplication, for people who doesn't know anything of programming... also in english and my mother language: spanish). But now... step by step...