11
What to do for Project 2?

Minim.pdf

Embed Size (px)

Citation preview

Page 1: Minim.pdf

What to do for Project 2?

Page 2: Minim.pdf

Objectives

• Tie back to Processing

• Work with classes

• Present a creative challenge

• Work with a different programming language

Well three out of four objectives ain’t bad

Page 3: Minim.pdf

Many Processing Libraries

• Video

• Serial

• PDF Export

• OpenGL

• Arduino

• Minim Audio

• Many more

Page 4: Minim.pdf

Minim

• A Processing library that uses JavaSound API, Tritonus, and MP3SPI to provide an easy to use audio library.

• Features:– AudioPlayer: for playback of WAV, AIFF, AU, SND, & MP3 files.

– AudioMetaData: for metadata about a file, such as ID3 tags.

– AudioSignal: for writing your own sound synthesis

– AudioRecorder: for audio recording

– AudioEffect: for writing your own audio effects.

– FFT: for doing spectrum analysis.

– BeatDetect: for doing beat detection.

Page 5: Minim.pdf

A Sound Theory

• Mike Ruiz’s Sound Applets

• Minim FFT

Amplitude

Frequency

Page 6: Minim.pdf

Music Visualization using Minim

• Options:

– Use the wave form

– Use the FFT (on previous slide)

– Use BeatDectect Explained Here

Page 7: Minim.pdf

The BeatDetect Class (by Example)(SOUND_ENERGY mode)

import ddf.minim.*;

import ddf.minim.analysis.*;

Minim minim;

AudioPlayer song;

BeatDetect beat;

void setup() {

minim = new Minim(this);

song = minim.loadFile("TicketToRide.mp3");

song.play();

beat = new BeatDetect();

beat.setSensitivity(100);

}

void draw() {beat.detect(song.mix);if( beat.isOnset() ){

…}…

}

void stop() {song.close();minim.stop();super.stop();

}

Example Program

Page 8: Minim.pdf

The BeatDetect Class (by Example)(FREQ_ENERGY mode)

import ddf.minim.*;

import ddf.minim.analysis.*;

Minim minim;

AudioPlayer song;

BeatDetect beat;

BeatListener bl;

void setup() {

minim = new Minim(this);

song = minim.loadFile("TicketToRide.mp3",

32768);

song.play();

beat = new BeatDetect(song.bufferSize(), song.sampleRate());

beat.setSensitivity(200);

bl = new BeatListener(beat, song);

}

class BeatListener implements AudioListener {private BeatDetect beat;private AudioPlayer source;

…}

Example Program

Buffer size must be a power of 2

Page 9: Minim.pdf

A Little Insight into Beat Detection

• Use the drawGraph() method to see the energy levels.

• Example program

Page 10: Minim.pdf

Project 2

• Presented at the time of our final:

Tuesday, May 3 @11:30

• Project 2

• Seniors, please talk to me about the due date.

Page 11: Minim.pdf

Resources

• Main documentation

• Processing Page Examples

• Minim Code Log Examples

• Doorbell example by Daniel Shiffman

• Audio Processing Examples by Dan Ellis

• Vimeo video tutorial 4 and video tutorial 5

• OpenProcessing Examples

• Beatles Ukulele Project (a source of .mp3 files)