Hello everyone, I’m new here. I tried to find something similar to my question here in forums, and I found some topics which helped me get my head around learning processing.org. However, as this is my first endeavour into processing, I am struggling with pretty much everything. I’ve got a book from MIT and I’m going through it though, but it does not answer some questions I have…
I’m planning to do a live “video” installation as one of my project at the university. The main idea is to get the signal from the microphone, “translate it” into numbers (dB? Hz?), and then write some triggers like: fe. if x dB then display word1, if y dB then display word2, if z then display word3, etc. So the higher “the noise/input number”, the bigger the number, different word on the screen. I need around 50 different words for particular sound levels, it’s just like a interactive noise level scale ;).
I’ve got a part which gets the signal in and displays is as a wave, that is the part of the code I found here in forums (link:
http://forum.processing.org/topic/beginner-user-minim-questions ).
- import ddf.minim.*;
- Minim minim;
- AudioInput in;
- int x = 30;
- PFont fontA;
- void setup()
- {
- size(1000, 750, P2D);
- textMode(SCREEN);
- minim = new Minim(this);
- minim.debugOn();
- // get a stereo line-in: sample buffer length of 2048
- // default sample rate is 44100, default bit depth is 16
- in = minim.getLineIn(Minim.STEREO, 1000);
- // Load the font. Fonts must be placed within the data
- // directory of your sketch. Use Tools > Create Font
- // to create a distributable bitmap font.
- // For vector fonts, use the createFont() function.
- fontA = loadFont("Dialog-48.vlw");
- // Set the font and its size (in units of pixels)
- textFont(fontA, 56);
- }
- void draw()
- {
- background(0);
- stroke(255,0,0);
- // Use fill() to change the value or color of the text
- // fill(0);
- text("SILENCE IS VOID", 15, 475);
- // draw the waveforms
- // the values returned by left.get() and right.get() will be between -1 and 1,
- // so we need to scale them up to see the waveform
- for(int i = 0; i < in.bufferSize() - 1; i++)
- {
- line(i, 450 + in.left.get(i)*50, i+1, 450 + in.left.get(i+1)*200);
- }
- }
- void stop()
- {
- // always close Minim audio classes when you are done with them
- in.close();
- minim.stop();
- super.stop();
- }
1. Get the “sound” into numbers (the way it’s done in puredata)
2. Link particular words to particular “number scales”
3. change the x and y positions of certain words according to the sound level input (that is more like a future question)
I’m also very sorry about not using programming terms, as I am very new to the whole thing. Thank you guys!
1