Connecting Arduino to Processing – learn.sparkfun.com

Connecting Arduino to Processing – learn.sparkfun.com
from Tumblr http://ift.tt/2qSDs7s

Advertisements

Learning about Images and Pixels [Processing]

Original text source: http://ift.tt/2osdCcp

Learned about: Load pixel and update pixel functions, going from 2 dimension into linear otherwise called as array of pixels, how neighbor pixels work to sharpen an image or blur it, etc. [check notes]

Test:

Possible outcome: Experiment and Prototype with Meme Landscapes to visualize colour palette in an interactive way with constant movement

from Tumblr http://ift.tt/2osepu1

Learning about Images and Pixels [Processing]

Original text source: http://ift.tt/2osdCcp

Learned about: Load pixel and update pixel functions, going from 2 dimension into linear otherwise called as array of pixels, how neighbor pixels work to sharpen an image or blur it, etc. [check notes]

Test:

Possible outcome: Experiment and Prototype with Meme Landscapes to visualize colour palette in an interactive way with constant movement

from Tumblr http://ift.tt/2osepu1

Processing Test Waveform + Image

RAW CODE

import ddf.minim.*;

Minim minim;
AudioPlayer song;
PImage img;

void setup()
{
 size(1800, 450);
//SOUND
 minim = new Minim(this);

 // this loads mysong.wav from the data folder
 song = minim.loadFile(“soltaste.mp3”);
 song = minim.loadFile(“soltaste2.mp3”);
 song.play();
 //END OF SOUND
 img = loadImage(“banner.jpg”);
}

void draw()
{
 //THE SAME IN ONE LINE background(img);
 image(img, 0, 0);

 //DRAW A WAVEFORM
 stroke(255);
 // we draw the waveform by connecting neighbor values with a line
 // we multiply each of the values by 50
 // because the values in the buffers are normalized
 // this means that they have values between -1 and 1.
 // If we don’t scale them up our waveform
 // will look more or less like a straight line.
 for(int i = 0; i < song.bufferSize() – 1; i++)
 {
   line(i, 50 + song.left.get(i)*50, i+1, 50 + song.left.get(i+1)*50);
   line(i, 150 + song.right.get(i)*50, i+1, 150 + song.right.get(i+1)*50);
   }
   //END OF DRAW WAVEFORM
  stroke(0);  
  for(int i = 0; i < song.bufferSize() – 1; i++)
 {
   line(i, 50 + song.left.get(i)*50, i+10, 50 + song.left.get(i+1)*50);
   line(i, 150 + song.right.get(i)*50, i+10, 150 + song.right.get(i+1)*50);
   }
  for(int i = 0; i < song.bufferSize() – 1; i++)
  bezier(i+120, 150 + song.left.get(i)*120, i+120, 150 + song.left.get(i+1)*120, i+10, 50 + song.left.get(i)*50, i+10, 50 + song.left.get(i+1)*50);

}

I’m using sound library minim applying a specific image and adding a bezier with random numbers to create shapes. The general prototype idea is to draw waveform of Mexican sounds on top of Mexico City either as image of a map or video of the city moving across us along with the moving waveform. Or a collection of all sound waveforms (tamales, basura, camotes, etc.) in a map to see how it will look like all waveforms in physical space.
*Song used for prototype is Me Soltaste by Jesse & Joy

from Tumblr http://ift.tt/2nHD4cY

Video Tint Prototype in Processing

Learning to use video in Processing while adding basic tint colours

RAW code

/**
* Loop.
*
* Shows how to load and play a QuickTime movie file.  
*
*/

import processing.video.*;

Movie movie;

void setup() {
 size(640, 360);
 background(0);
 // Load and play the video in a loop
 //movie = new Movie(this, “dave.mp4”);
 movie = new Movie(this, “testkittib.mp4”);
 movie.loop();
}

void draw() {
 if (movie.available() == true) {
   movie.read();
 }
 //Escribe de arriba hacia abajo ergo si el de abajo es mas grande tapa los de arriba sobreescribe
 noTint(); //aplica usar color original o mejor no usar color
 image(movie, 0, 0, width, height); //tama;o video completo x1 en cero, y1 en cero, x2 el ancho, y2 el largo
 tint(0,255,0); //aplica el color a los de abajo si es el ultimo a todos videos de abajo en RGB    
 image(movie, 0, 0, width/2, height/2); //divides the video by half in esquina izquierda arriba x,y,x/2,y/2
 tint(255,0,0);
 image(movie, width/2, height/2, width/2, height/2); //esquina derecha abajo

}


from Tumblr http://ift.tt/2n3EPQD