FreeJ scripting

Class AudioJack

Object
   |
   +--AudioJack

class AudioJack


The Audio Jack class collects audio and analizes it for use in parameters

This object collects audio from a Jack source, it can be used to change parameter values based on the audio input.
16 harmonics are provided using a fast fourier transform, returning values available for assignement to parameters.
Example: // create the audio collector // args: jack_port, samplesize, samplerate audio = new AudioJack("xine:out_l", 2048, 44100); // set an adequate resolution H=640; M=H/128; W=H/(H/80); set_resolution(W,H); // create a geometry layer to draw levels geo = new GeometryLayer(); geo.start(); add_layer(geo); // run the analisis on every frame and draw lines bang = new TriggerController(); bang.frame = function() { // this function must be called to refresh harmonics audio.fft(); for(c=0;c<16;c++) { hc = audio.get_harmonic(c); geo.vline( c*M, H, H-( hc )); } }

Defined in AudioCollector.js

Author: Dave Griffiths, Jaromil


Constructor Summary
AudioJack(<string> jack_port, <int> sample_size, <int> sample_rate)
            This constructor instantiates an AudioJack collector for Jack
 
Method Summary
 void fft()
           The Audio object processes the current input with an FFT (the cpu consuming part) to be ready to provide up-to-date harmonics values on request of get_harmonics.
 void get_harmonic(<int> harmonic)
           A call to get_harmonics returns up to 16 values for each harmonic detected on the audio, as the last time fft() was called.

Constructor Detail

AudioJack

AudioJack(<string> jack_port, <int> sample_size, <int> sample_rate)

Method Detail

fft

void fft()

get_harmonic

void get_harmonic(<int> harmonic)

FreeJ scripting

| FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.
Send inquiries & questions to dyne.org's hackers.
Documentation generated by JSDoc on Thu May 29 20:56:52 2008