28
edits
Changes
āāDocumentation
== Title ==
== Description ==
*Interactive paradigm
*Technical Description
The flow in of information will go as follows: A song would begin to play and As the user would move and interact with moves the flashlight across the screen. Processing , it will then take change the MIDI note's parameters (amplitude and frequency) while the amount of movement in random ellipses play a melody on the designated quadrants bottom half of the screen . The ending result is an interactive MIDI sound dialogue between the user and send those numbers to Logic Prothe program. Logic Pro has an environment == Documentation ==*Code/** *MIDI Capture * by Leilani Martin * * Tracks the brightest pixel in a live video signal and plays a musical note at that is able to process numbers pixel, a live duet between a predetermined/random MIDI melody and use them as controls to different filters the drum notes controlled by the user. */ import processing.video.*;import arb.soundcipher.*; //soundcipher dataSoundCipher sc = new SoundCipher(this); //MIDI scale for square melodyint[] scale = {57, 60, 60, 62, 64, 67, 67, 69, 72};int rate = 7; Capture video;void setup() { size(640, 480); //160 // Uses the default video input, see the reference if this causes an error video = new Capture(this, width, height, 30); noStroke(); smooth(); frameRate(6); } //Handles Frame Ratevoid keyPressed(){ if (key == CODED){ if (keyCode == UP){ frameRate(rate * 2); } else if(keyCode == DOWN){ frameRate(rate - 1); } }} //Captures the video and parametersfinds the brightest pixelvoid draw() { if (video.available()) { video. The changes read(); image(video, 0, 0, width, height); // Draw the webcam video onto the screen int brightestX = 0; // X-coordinate of the brightest video pixel int brightestY = 0; // Y-coordinate of the brightest video pixel float brightestValue = 0; // Brightness of the brightest video pixel // Search for the brightest pixel: For each row of pixels in the parameters would then be transferred to video image and // for each pixel in the audio speakersyth row, and finally compute each pixel's index in the video video.loadPixels(); int index = 0; for (int y = 0; y < video.height; y++) { for (int x = 0; x < video.width; x++) { // Get the color stored in the pixel int pixelValue = video.pixels[index]; // Determine the brightness of the user can hear how their movements changed pixel float pixelBrightness = brightness(pixelValue); // If that value is brighter than any previous, then store the sound // brightness of that pixel, as well as its (x,y) location if (pixelBrightness > brightestValue) { brightestValue = pixelBrightness; brightestY = y; brightestX = x; } index++; } } //Capture to MIDI note (Drum sounds) ellipse(brightestX, brightestY, 25, 25); fill(random(0, 255), random(0, 255), random(0, 255)); stroke(random(0, 255)); strokeWeight(3); sc.instrument(sc.DRUM); sc.playNote(brightestY, brightestX, 3000); //Line dividing the songscreen line(0, 160, 700, 160); stroke(200); //Random ellipse melody if (random(1) < 0.8) { sc.instrument(2); sc.playNote(scale[(int)random(scale.length)], (int)random(80)+40, 0.2); stroke(color(random(256), random (256), random(256))); ellipse(random(0, 1000), random(300, 500), 100, 100); }}} *Screen Captures [[Image:shot1.png]] [[Image:shot2.png]] *Live Screen Capture Video Link-View Live video recording: http://s102.photobucket.com/albums/m110/alohahoopstar/?action=view¤t=ISUHD.flv