Commit 9ae2ff82 authored by kimon-satan's avatar kimon-satan

updated API

parent e82f42d8
...@@ -7,15 +7,21 @@ This the audio context. You must always have one to produce sound with maxiLib ...@@ -7,15 +7,21 @@ This the audio context. You must always have one to produce sound with maxiLib
##### .init() ##### ##### .init() #####
initialise the audio engine initialise the audio engine
##### .outputIsArray( isArray, numChannels) #####
for multi channel sound
- isArray = true or false
- numChannels = 2, 4, or 8
##### .loadSample(sampleUrl, maxiSample) ##### ##### .loadSample(sampleUrl, maxiSample) #####
load a sample into a maxiSample object load a sample into a maxiSample object
#### properties #### #### properties ####
##### .play ##### ##### .play #####
the function which is the play loop the function which is the play loop
##### .output ##### ##### .output #####
the current value of the audio output the current value of the audio output
<br><br> <br><br>
...@@ -26,23 +32,23 @@ Stores and plays an audio sample ...@@ -26,23 +32,23 @@ Stores and plays an audio sample
#### methods #### #### methods ####
##### .play() ##### ##### .play() #####
plays the sample at normal speed plays the sample at normal speed
##### .play(playRate) ##### ##### .play(playRate) #####
plays the sample at the specified play rate plays the sample at the specified play rate
##### .playOnce() ##### ##### .playOnce() #####
plays the sample once at normal speed plays the sample once at normal speed
##### .playOnce(playRate) ##### ##### .playOnce(playRate) #####
plays the sample once at specified play rate plays the sample once at specified play rate
##### .trigger() ##### ##### .trigger() #####
set the playhead to zero (use in conjunction with playOnce) set the playhead to zero (use in conjunction with playOnce)
##### .isReady() ##### ##### .isReady() #####
returns true if sample is loaded returns true if sample is loaded
<br><br> <br><br>
...@@ -56,22 +62,22 @@ plays a sample at different rates leaving pitch unchanged ...@@ -56,22 +62,22 @@ plays a sample at different rates leaving pitch unchanged
sets the sample play for timestretch to use sets the sample play for timestretch to use
##### .play(rate, grainLength, overlaps, startPos) ##### ##### .play(rate, grainLength, overlaps, startPos) #####
- rate (eg. 0.5 = half speed) - rate (eg. 0.5 = half speed)
- grainLength (a time in seconds) - grainLength (a time in seconds)
- overlaps (normally 2 is good) - overlaps (normally 2 is good)
- startPos (where to start playing in the sample - in seconds) - startPos (where to start playing in the sample - in seconds)
##### .setPosition(startPos) ##### ##### .setPosition(startPos) #####
useful for resetting a sound useful for resetting a sound
##### .getPosition() ##### ##### .getPosition() #####
returns position in ??? returns position in ???
##### .getNormalisedPosition() ##### ##### .getNormalisedPosition() #####
Useful for ending sample play back Useful for ending sample play back
...@@ -87,22 +93,22 @@ plays a sample at different pitches leaving the speed unchanged ...@@ -87,22 +93,22 @@ plays a sample at different pitches leaving the speed unchanged
sets the sample play for pitchShift to use sets the sample play for pitchShift to use
##### .play(pitch, grainLength, overlaps, startPos) ##### ##### .play(pitch, grainLength, overlaps, startPos) #####
- pitch (eg. 0.5 = half pitch) - pitch (eg. 0.5 = half pitch)
- grainLength (a time in seconds) - grainLength (a time in seconds)
- overlaps (normally 2 is good) - overlaps (normally 2 is good)
- startPos (where to start playing in the sample - in seconds) - startPos (where to start playing in the sample - in seconds)
##### .setPosition(startPos) ##### ##### .setPosition(startPos) #####
useful for resetting a sound useful for resetting a sound
##### .getPosition() ##### ##### .getPosition() #####
returns position in ??? returns position in ???
##### .getNormalisedPosition() ##### ##### .getNormalisedPosition() #####
Useful for ending sample play back Useful for ending sample play back
...@@ -119,7 +125,7 @@ plays a sample with independent control of pitch and speed ...@@ -119,7 +125,7 @@ plays a sample with independent control of pitch and speed
sets the sample play for timestretch to use sets the sample play for timestretch to use
##### .play(pitch, rate, grainLength, overlaps, startPos) ##### ##### .play(pitch, rate, grainLength, overlaps, startPos) #####
- pitch (eg. 0.5 = half pitch) - pitch (eg. 0.5 = half pitch)
- rate (eg. 0.5 = half speed) - rate (eg. 0.5 = half speed)
...@@ -127,15 +133,15 @@ sets the sample play for timestretch to use ...@@ -127,15 +133,15 @@ sets the sample play for timestretch to use
- overlaps (normally 2 is good) - overlaps (normally 2 is good)
- startPos (where to start playing in the sample - in seconds) - startPos (where to start playing in the sample - in seconds)
##### .getPosition() ##### ##### .getPosition() #####
returns position in ??? returns position in ???
##### .getNormalisedPosition() ##### ##### .getNormalisedPosition() #####
Useful for ending sample play back Useful for ending sample play back
##### .setPosition(startPos) ##### ##### .setPosition(startPos) #####
useful for resetting a sound useful for resetting a sound
...@@ -213,6 +219,65 @@ An adsr envelope. ...@@ -213,6 +219,65 @@ An adsr envelope.
- level (the overall level of the envelope; everything will be scaled by this value) - level (the overall level of the envelope; everything will be scaled by this value)
- trigger (envelope will begin attack when set to 1.0 and release when set to 0.0) - trigger (envelope will begin attack when set to 1.0 and release when set to 0.0)
<br><br>
### maxiFilter ###
A bunch of useful filter methods
#### methods ####
##### .lores(input, cutoff, resonance) #####
A lowpass resonant filter. Returns the filtered frequency.
- input = input signal
- cutoff = cutoff frequency in Hz
- resonance = a value between 0.0 & 10.0
##### .hires(input, cutoff, resonance) #####
A highpass resonant filter. Returns the filtered frequency.
- input = input signal
- cutoff = cutoff frequency in Hz
- resonance = a value between 0.0 & 10.0
### maxiFFT ###
#### methods ####
##### .setup(fftSize, windowSize, hopSize) #####
must be called before using the FFT
- fftSize = (A power of two, 1024, 512 .. etc)
- windowSize = half the fftSize
- hopSize = half the windowSize
##### .process(sig) #####
returns true if successful
- sig = signal in
##### .getMagnitude(index) #####
get the magnitude of a particular bin
- index = A number between 0 and the fftSize/2
##### .getMagnitudeDB(index) #####
get the decibels of a particular bin
##### .magsToDb() #####
perform the conversion on all bins
<br><br>
### convert ### ### convert ###
A collection of conversion functions. Currently numbering one ! A collection of conversion functions. Currently numbering one !
...@@ -223,6 +288,29 @@ A collection of conversion functions. Currently numbering one ! ...@@ -223,6 +288,29 @@ A collection of conversion functions. Currently numbering one !
pass a midi value and its frequency is returned pass a midi value and its frequency is returned
<br><br>
### maxiMix ###
A multichannel mixer.
#### methods ####
##### .stereo(sig, outputArray, pan) #####
Makes a stereo mix.
- sig = inputsignal
- outputArray = VectorDbl array (see maxiTools)
- pan = a value between 0 & 1
<br><br>
### maxiTools ###
#### methods ####
##### .getArrayAsVectorDbl(inputArray) #####
Returns the array as a VectorDbl object. (Needed for maxiMix).
### Undocumented classes ### ### Undocumented classes ###
...@@ -233,10 +321,9 @@ pass a midi value and its frequency is returned ...@@ -233,10 +321,9 @@ pass a midi value and its frequency is returned
- maxiDistortion - maxiDistortion
- maxiDyn - maxiDyn
- maxiEnvelope - maxiEnvelope
- maxiEnvelopeFollower - maxiEnvelopeFollower (undefined)
- maxiFFT
- maxiFFTOctaveAnalyzer - maxiFFTOctaveAnalyzer
- maxiFilter
- maxiFlanger - maxiFlanger
- maxiHats - maxiHats
- maxiIFFT - maxiIFFT
...@@ -244,9 +331,7 @@ pass a midi value and its frequency is returned ...@@ -244,9 +331,7 @@ pass a midi value and its frequency is returned
- maxiLagExp - maxiLagExp
- maxiMFCC - maxiMFCC
- maxiMap - maxiMap
- maxiMix
- maxiSVF - maxiSVF
- maxiSettings - maxiSettings
- maxiSnare - maxiSnare
- maxiTools - maxiTools
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment