WEEK_12_fab_academy_interface_and_application_programming_apr_4.

index_access








1 / The ADDLISTENER test :

Processing is kind of fun but I didn't really knew where to start. I started by using the ADDLISTENER. I wanted to play the tracks I like and see the waves. So I searched for the folder where the mp3 for the ADDLISTENER fonction were : on mac, you go to applications and you open the package (right click). Then you go to Contents > Resources > Java > Modes > Java > libraries > minim > example > AddListener > data. This "data" folder is where you can add your tracks. You add your tracks. Then, into the window of the Processing ADDLISTENER sketch, you must find the line with an mp3 file (font color is blue). It's alway "groove.mp3" by default. You erase the mp3 file between the quotes, and you paste the name of the track you want to play (it could look like this : "jay-z_on_to_the_next_[Ft. Swizz Beatz].mp3"). Note that the name as to be exactly the same in the data folder and on the sketch.

Hello Board Schematics 2

I wanted a bigger window, so I also changed the window's values to 960 x 540 (it looks like this : size(960, 540, P2D);). This is the size I use for the embeded video of this webpage. But when you change the size of the window you need to change the length of the minim (the line/wave). So I changed the width value after the mp3 file to 960 (these are pixels) to make it fit the window's width.

There is another tab right next to the ADDLISTENER tab. It's called WAVEFORM. You can modify the settings for the waveform in there. For example, if you change the value of this line : vertex(i, height/2 + left[i]*50); for this value vertex(i, height/2 + left[i]*10000); you will see bigger waves in the window.

You can change the color of the waveform too. You change the value. Try to change 255 for 34. The lines will turn grey instead of white.






2 / How to connect a board to Processing ?

We were provided a sketch to give a graphical interface to the input sensors we soldered on our boards (light board, temperature board, etc). In this case I have used my light board. The test was made at night. I have used a lighter as a light source. Blue means no light, red means light.

Processing blue square Processing red square

Same very simple idea. Blue means no light, red means light but instead of a square we can see a triangle.

Processing blue triangle Processing red triangle








2 / 2 / How to connect a board to Processing ?

Another experiment with the light board and a lighter. When the flame is on, the spectrum becomes more dense, tracing a smaller light in the middle of the "graph".

Processing ligne coloree







index_access