Work from university

Hello, I need help with a university job. It consists of recreating a work of art in processing. I need the figures in the work to be generated with voice recognition, in this case with pure data.
My proposal is for smaller squares to appear with shorter tones and larger squares to appear with longer voice tones.
However, I am open to other proposals. If anyone can help me I would really appreciate it.

ana
this is the work that i have to recreate

What have you done so far?
This gives the illusion that there are overlapping rectangles but if you look carefully, some of them are not complete rectangles. I believe you were trying to place rectangles randomly before?

What is important at the beginning is to define the requirements of your application.

Kf

1 Like

Does this video that I made and uploaded to YouTube work? ignore my explanation in Spanish, just look at the code. Sorry, I’m a little stressed :slight_smile:

Hi,

You can post your code on the forum by using the </> button when editing your message. (make sure to press Ctrl+T in the Processing IDE to auto format your code :wink: )

As @kfrajer said, the rectangles are not just solid rectangles, they have a paint texture. You should consider using image textures or some sort of mask… Also, they are overlapping so their alpha value is not at full 255.

For the voice recognition part, does it work? I see that you are receiving OSC messages in Processing.

Hi!! this is my advance

import oscP5. *;
boolean haySound = false;
boolean noHaySound = false;
booleanSoundStart = false;
booleanSound Term = false;
OscP5 osc;
floating amplifier = 0.0;
int counter;
polygon p;
float num;
void setup () {
osc = new OscP5 (east, 12345);
size (600,600);
fund (232,232,230);
p = new polygon ();
counter = 0;
num = 22;
}
void draw () {
yes (amplifier> 60) {
haySound = true;
} else if (amp <60) {
noHaySound = false;
}
if (noHaySound == true) {
haySound = false;
}
// if (mousePressed && counter <num) {
// if (mouseX <150) {
if (counter <num) {
if (haySound == true) {

if (amp> 60 && amp <70) {

   // padding (49,43,138);

//} else if (mouseX> 150 && mouseX <300) {
} else if (amp> 70 && amp <80 && haySound == true) {

   // padding (219,73,149);

//} else if (mouseX> 300 && mouseX <450) {
} else if (amp> 80 && amp <90 && haySound == true) {
;
// padding (24,26,26);
//} else if (mouseX> 450 && mouseX <600) {
} else if (amp> 90 && haySonido == true) {

  // padding (324,13,13);
   
 
}
 p. draw ();
 counter ++;
 println ("counter" + counter);
   println ("number" + num);

} else if (haySound == false) {

}
}
}
//}
voidEventE (OscMessage m) {

if (m.addrPattern (). equals ("/ amp")) {
amp = m.get (0) .floatValue ();
// println (“amp:” + amp);
}

}

class polygon {
// attributes
Mipaleta Palette;
background color;
float t, t1;
float x1, y1;
// builder
polygon(){
Mipaleta = new Paleta (“ana.jpg”);
x1 = random (width);
y1 = random (height);
t = random (50,100);
t1 = random (5,100);
background = Mipaleta.darUnColor ();

}
// methods
void draw () {
fill (background);
rect (random (0.600), random (0.600), t, t);

}

}

class Palette {

PImage image;

Palette (String filename) {
image = loadImage (filename);
}

color darUnColor () {
int x = int (random (image.width));
int y = int (random (image.height));
return image.get (x, y);
}

}

As for the colors it is true, I must use the same colors of the selected work but I will also place its texture, which is something I don’t do

Please format the code for readability. Encapsulate it with Ctrl shift + c

If you want to make rectangle size match the current frequency band you could just use the fft analyse function provided with processing to access the frequency values. If you are unsure how this is achieved you can search this forum for fft analysis I have posted a sketch which will produce a spectrogram.

1 Like