Beautiful
Sometimes I come across something that I want to share:
Nuit Blanche from Spy Films on Vimeo.
There’s a making of video too.
Sometimes I come across something that I want to share:
Nuit Blanche from Spy Films on Vimeo.
There’s a making of video too.
// Anything to the right of these two slashes is
// A comment and will not be part of the code.
var xSize:int = 200;
// Add an event listener to the stage and name the function
stage.addEventListener(Event.ENTER_FRAME,onFrameLoop);
// Your function name must match the name after the comma
// in the parenthesis.
function onFrameLoop(evt:Event):void {
// These are all of the things that will happen in
// the function.
// This will rotate the instance of the rectangle
// colin according to mouse X and Y values.
colin.y = mouseY;
colin.x = 800 - mouseX;
// here’s an if statement
if (mouseX > xSize) {
trace(”rotating! ” + mouseX +” ” + colin.y);
//colin.rotation = mouseX;
colin.height = 29;
// here’s another option if that statement hasn’t been met
}
else if(mouseX < xSize) {
trace(”scaling!”);
colin.scaleY = mouseY;
}
// This will scale the instance of the rectangle
// colin according to the mouse X and Y values.
colin.scaleX = mouseY/20;
colin.scaleY = mouseX/20;
}
// Don’t forget to close the function with the
// brace (squiggly bracket) above!!!
Take your inputs and organize them in the following way:
Update: Here’s a fabulous explanation on the getSpectrum() class for Flash.
I’ve compiled a list of basic resources for you to play around with before class on Wednesday in case you haven’t found these already. If you’re working with Processing, remember to place your sound file inside of a folder called “data” inside of your sketch’s folder. If you’re using flash, remember that computeSpectrum only deals with two channel audio (for our purposes right now this is OK). I also placed some code at the end of this post that uses beat detect. You will be able to tell the difference between beat detect and Minim’s standard volume.get by the blue flashiness. Enjoy!
Processing with Ess
Showing the level from an FFT with color
Showing a level of volume across frequency using color
Processing with Minim
Getting volume data in time (without an FFT)
Flash
computeSpectrum reading (a variation of the example I used in class) a sound file
ComputeSpectrum Using an external actionScript file
Minim–BeatDetect Example
// Example By Colin Owens
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer song;
BeatDetect beat;
int multiplier = 10;
int count = 0;
int dotSize = 5;
void setup()
{
size(1024, 768);
minim = new Minim(this);
song = minim.loadFile("true.mp3");
song.play();
beat = new BeatDetect();
}
void draw()
{
background(0);
beat.detect(song.mix);
for(int i = 0; i < song.bufferSize() - 1; i++)
{
noStroke();
fill(210,180,20);
smooth();
ellipse(count*multiplier, height/3 + song.left.get(i)*250, dotSize, dotSize);
ellipse(count*multiplier, (height/3)*2 + song.right.get(i)*250, dotSize, dotSize);
if ( beat.isOnset() ) {
fill(20,180,210);
ellipse(count*multiplier, height/3 + song.left.get(i)*250, dotSize*10, dotSize*10);
ellipse(count*multiplier, (height/3)*2 + song.right.get(i)*250, dotSize*10, dotSize*10);
}
count++;
if (count >= width) {
count=0;
}
if (dotSize <= 0) {
dotSize=1;
multiplier = 10;
}
}
if(keyPressed) {
if (keyCode == LEFT) {
multiplier = multiplier -1;
dotSize = dotSize -1;
}
if (keyCode == RIGHT) {
multiplier = multiplier +1;
dotSize = dotSize +1;
}
}
}
void stop()
{
song.close();
super.stop();
}
Here are the links to my running playlists on youTube. These are not strict categories per se. Please feel free to email me your suggestions for the video jukebox as well. Enjoy:
Three new examples: loading internal and external files and using a slider.
Want to start flowing your data into processing, but can’t wait till next week?
I finished the code for our PDF Array reader and it’s very well commented.
all you have to do is plug in your data.
Colin
—>
Lesley has invested in some online training and although some of it looks old, if you look for the right version of the software, you’ll be in good hands.
I just had spent some time with the Flash CS3 basic tutorials and it looks quite useful.
Log into MyLesley and click on this link for the Flash Tutorial.
There’s even one here on WordPress, Illustrator and others (full list).
If you need help with any of this the Academic Computing people will help. Let me know what you think and the tutorials helped with your learning style.