/* * have an envelope altering the tempo. * lower notes change at a slower rate--half notes. * higher frequencies can change on half or quarter notes... etc * have different categories of blobs--always look for a bass blob around the size of area/2, which changes very infrequently. * next version, trigger samples... */ import beads.*; import hypermedia.video.*; int N_CHANNELS = 3; AudioContext ac; OscillatorBank ob; int NOSCCHANNELS = 10; float[] ofreqs = new float[NOSCCHANNELS]; float[] ogains = new float[NOSCCHANNELS]; Envelope freqs[] = new Envelope[N_CHANNELS]; Gain gains[] = new Gain[N_CHANNELS]; WavePlayer wavePlayers[] = new WavePlayer[N_CHANNELS]; OpenCV opencv; float[] tempos = {30f, 45f, 60f}; void setup() { size( 640, 480 ); opencv = new OpenCV( this ); //opencv.movie("/Users/Luke/Desktop/IMG_0069.mov", width, height ); // load movie file opencv.capture(width,height); frameRate(30); setupSound(); } void setupSound() { ac = new AudioContext(); for(int i=0; i 0) { // /* set the oscillator bank */ // ogains = getRadialCoefficients(blobs[0], NOSCCHANNELS); // ob.setGains(ogains); // float[] newfreqs = new float[NOSCCHANNELS]; // for(int p=0; p 0) coefs[i] /= (float)ninbin[i]; // average each bin s += coefs[i]; // sum the bins } for(i=0; i