Updates the internal selected nodes array with a collection of audio nodes matching the selector provided. Type, Class & Id selectors are supported.
//type selector using the node name, sets the frequency for all sines
__("sine").frequency(200);
//set the frequency for the node with id "foo"
__("#foo").frequency(200);
//set the frequency for any nodes with a class of "bar"
__(".bar").frequency(200);
//select all sines, any nodes with classname "bar" or id of "foo"
//and set their frequencies to 200
__("sine,.bar,#foo").frequency(200);
If invoked without arguments, cracked() resets the selection/connection state, removing any record of previous nodes and effectively marking the start of a new connection chain. Since a new node will try to connect to any previous node, calling __() tells a node that there is no previous node to connect to. For example:
//Create & connect sine -> lowpass -> dac
__().sine();
__.lowpass();
__.dac();
//Create but don't connect
__().sine();
__().lowpass();
__().dac();
cracked is also the namespace for public methods and also can be written as a double underscore __
__("sine"); //same as cracked("sine")
- Source:
Methods
Find
reset() → {cracked}
resets everything to its initial state
//reset state for the entire app
cracked.reset();
- Source:
Returns:
- Type
- cracked
exec(method, args, nodes) → {cracked}
executes a method with a specific set of selected nodes without modifying the internal selectedNodes array
//filter everything but the sines from currently selected nodes and
//execute the frequency method against the remaining sines.
//the internal _selectedNodes array remains unchanged
cracked.exec(
"frequency",
200,
cracked.filter("sine")
);
Parameters:
Name | Type | Description |
---|---|---|
method |
String | method name |
args |
Array | arguments to supply to the method |
nodes |
Array | node array to execute against |
- Source:
Returns:
- Type
- cracked
each(type, fn) → {cracked}
iterate over the selectedNodes array, executing the supplied function for each element
__.each(type, function(node,index,array){
//Loops over any selected nodes. Parameters are the
//current node, current index, and the selectedNode array
});
Parameters:
Name | Type | Description |
---|---|---|
type |
String | string to be checked against the node type |
fn |
function | function to be called on each node |
- Source:
Returns:
- Type
- cracked
filter(selector) → {Array}
Filter selected nodes with an additional selector returns node array that can used with exec()
//select any sine & sawtooth oscillators
__("sine,saw");
//filter out everything but the sines and
//execute the frequency method against those nodes.
//the internal _selectedNodes array remains unchanged
cracked.exec(
"frequency",
200,
cracked.filter("sine")
);
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | selector expression |
- Source:
Returns:
- Type
- Array
find(selector) → {Array}
Find nodes with a selector returns node array that can used with exec()
//find all the sines in the patch and
//execute the frequency method against those nodes.
//the internal _selectedNodes array remains unchanged
cracked.exec(
"frequency",
200,
cracked.find("sine")
);
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | selector expression |
- Source:
Returns:
- Type
- Array
Control
start()
Calls start() on the currently selected nodes. Throws no error if there aren't any selected nodes with a start method
//create and connect sine->lowpass->dac
__().sine().lowpass().dac();
//start the sine node
__("sine").start();
- Source:
stop()
Calls stop() on the currently selected nodes. Throws no error if there are no selected nodes that have a stop method.
//create and connect sine->lowpass->dac
__().sine().lowpass().dac();
//stop the sine node
__("sine").stop();
- Source:
ramp(target, timeToRamp, paramToRamp, initial, type)
Public method to ramp a parameter on currently selected nodes. Target & timeToRamp parameters can be numbers or arrays of numbers for multisegement ramps. Initial value param is optional, if omitted, then the current value is used as the initial value. If loop is running, then ramp start times are snapped to the sequencer grid.
//create and connect sine->lowpass->dac & play
__().sine().lowpass().dac().play();
//ramp the frequency of the sine. 220 to 880 in 5 seconds
__("sine").ramp(880,5,"frequency",220);
Parameters:
Name | Type | Description |
---|---|---|
target |
Number | Array | value to ramp to |
timeToRamp |
Number | Array | length of ramp in seconds |
paramToRamp |
String | name of parameter to ramp |
initial |
Number | value to start the ramp at |
type |
String | of ramp, "exp" is exponential. defaults to linear. |
- Source:
attr(userParams, userParams)
Set or get attribute values on a node. Takes an object with any number of key:value pairs to set. A string with the param name returns the current value of that param on the first selected node.
//create and connect sine->lowpass->dac & play
__().sine().lowpass().dac().play();
//set the frequency of the sine to 880
__("sine").attr({"frequency":880});
//get the frequency
__("sine").attr("frequency"); //880
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object | options object Properties
|
|||||||||
userParams |
String |
- Source:
Node
script(userParamsopt)
Native Script node
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
waveshaper(userParamsopt)
Native Waveshaper
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
compressor(userParamsopt)
Native Compressor
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
gain(userParamsopt)
Native Gain
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
native_delay(userParamsopt)
Naming this with prefix native so I can use "delay" as a plugin name max buffer size three minutes
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
osc(userParamsopt)
Native oscillator, used the oscillator plugins
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
biquadFilter(userParamsopt)
Native biquad filter, used by filter plugins
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
channelMerger(userParamsopt)
Native channelMerger
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userParams |
Object |
<optional> |
map of optional values |
- Source:
channelSplitter(userParamsopt)
Native channelSplitter
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userParams |
Object |
<optional> |
map of optional values |
- Source:
convolver(userParamsopt)
Native convolver, used by reverb
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
stereoPanner(userParamsopt)
Native stereo panner, used by panner
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userParams |
Object |
<optional> |
map of optional values |
- Source:
destination(userParamsopt)
Native destination, used by the dac plugin
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userParams |
Object |
<optional> |
map of optional values |
- Source:
origin(userParamsopt)
Native sound input node, used by the adc plugin origin = opposite of destination
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userParams |
Object |
<optional> |
map of optional values |
- Source:
buffer(userParamsopt)
Native audio source node and buffer combined.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
Sequence
loop(argopt, configopt) → {cracked}
main method for loop
//configure the loop: 8 steps, 100ms between steps
__.loop({steps:8,interval:100});
//start
__.loop("start");
//stop
__.loop("stop");
//reset the loop params
__.loop("reset");
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg |
String |
<optional> |
stop/start/reset commands |
||||||||||
config |
Object |
<optional> |
configuration object Properties
|
- Source:
Returns:
- Type
- cracked
bind(eventType, fn, data) → {cracked}
Listener - binds a set of audio nodes and a callback to loop step events
Parameters:
Name | Type | Description |
---|---|---|
eventType |
String | currently just "step" |
fn |
function | callback to be invoked at each step |
data |
Array | should the same length as the number of steps |
- Source:
Returns:
- Type
- cracked
unbind(eventType)
Remove any steps listeners registered on these nodes
Parameters:
Name | Type | Description |
---|---|---|
eventType |
String |
- Source:
Macro
begin(name, userParams)
start macro recording, add any user parameters (id,classname,etc) to the container macro
//define a simple macro named "microsynth"
__().begin("microsynth").sine().gain(0).dac().end("microsynth");
Parameters:
Name | Type | Description |
---|---|---|
name |
String | macro name |
userParams |
Object | options object |
- Source:
end(name)
end macro recording
//define a simple macro named "microsynth"
__().begin("microsynth").sine().gain(0).dac().end("microsynth");
Parameters:
Name | Type | Description |
---|---|---|
name |
String | macro name |
- Source:
Midi
midi_supported() → {boolean}
Is midi supported?
if(__.midi_supported()) {
//do midi stuff here
//cuz you can
}
- Source:
Returns:
- Type
- boolean
midi_init(callback)
Initialize midi. Callback is invoked when ready.
//when midi is ready...
__.midi_init(function(){
//...call this function
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
midi_receive(callback)
Midi input. Bind handler for the onMIDIMessage event.
//when midi is ready...
__.midi_init(function(){
__.midi_receive(function(midiEvent){
//handle incoming raw midi events here...
});
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
midi_noteon(callback)
Midi input. Shorthand binding for note ons
//when midi is ready...
__.midi_init(function(){
//get midi noteon events
__.midi_noteon(function(noteData){
//note data = [status,pitch,velocity]
//handle midi note ons...
});
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
midi_noteoff(callback)
Midi input. Shorthand binding for note offs
//when midi is ready...
__.midi_init(function(){
//get midi noteoff events
__.midi_noteoff(function(noteData){
//note data = [status,pitch,velocity]
//handle midi note offs...
});
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
midi_control(callback)
Midi input. Shorthand binding for midi control messages
//when midi is ready...
__.midi_init(function(){
//get midi control events
__.midi_control(function(noteData){
//note data = [status,pitch,velocity]
//handle midi control events...
});
});
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
Connect
connect(selector)
chainable method to connect nodes to previously instantiated nodes. Takes a selector to find the nodes to connect to.
//create and connect sine->lowpass->dac
__().sine().lowpass().dac();
//create a sawtooth and connect to the lowpass instantiated above
__().saw().connect("lowpass");
Parameters:
Name | Type | Description |
---|---|---|
selector |
String | selector expression |
- Source:
Returns:
cracked
remove(time)
chainable method to stop, disconnect and remove the currently selected nodes. Takes a time in ms to schedule the node removal.
//create and connect sine->lowpass->dac
__().sine().lowpass().dac();
//remove the lowpass instantiated above in 100ms
__("lowpass").remove(100);
Parameters:
Name | Type | Description |
---|---|---|
time |
Number | in ms to schedule node removal |
- Source:
Returns:
cracked
Debug
log()
log selected nodes to console if any.
//create and connect sine -> lowpass -> dac
__().sine().lowpass().dac();
//logs the [oscillatorNode] object to the console
__("sine").log()
- Source:
size() → {Number}
return the length of selected nodes array
//create and connect sine -> lowpass -> dac
__().sine().lowpass().dac();
//returns 2
__("sine,lowpass").size();
- Source:
Returns:
- Type
- Number
_dumpState()
dump the node lookup object to the console works in debug only
- Source:
_getNode(uuid) → {*}
debug method to get a node with a uuid works in debug only
Parameters:
Name | Type | Description |
---|---|---|
uuid |
- Source:
Returns:
- Type
- *
Type
ifUndef(test, def)
Returns the 2nd argument if the 1st is undefined
Parameters:
Name | Type | Description |
---|---|---|
test |
* | thing to test for undefined |
def |
* | default value to return if test is undefined |
- Source:
isNotUndef(test)
Returns true if not undefined
Parameters:
Name | Type | Description |
---|---|---|
test |
* | thing to test for undefined |
- Source:
isUndef(test)
Returns true if undefined
Parameters:
Name | Type | Description |
---|---|---|
test |
* | thing to test for undefined |
- Source:
isObj(obj)
Returns true if param is an object
Parameters:
Name | Type | Description |
---|---|---|
obj |
* | thing to test |
- Source:
isNum(num)
Returns true if param is a number
Parameters:
Name | Type | Description |
---|---|---|
num |
* | thing to test |
- Source:
isStr(str)
Returns true if param is a string
Parameters:
Name | Type | Description |
---|---|---|
str |
* | thing to test |
- Source:
isArr(arr)
Returns true if param is an array
Parameters:
Name | Type | Description |
---|---|---|
arr |
* | thing to test |
- Source:
isFun(fn)
Returns true if param is a function
Parameters:
Name | Type | Description |
---|---|---|
fn |
* | thing to test |
- Source:
Algorithmic
random_interval(callback, minTime, maxTime)
execute a callback at random intervals within a range
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | to be invoked at every interval |
minTime |
Number | minimum value for the random interval |
maxTime |
Number | maximum value for the random interval |
- Source:
random_envelope(length) → {Array}
create a adsr envelope with random values scaled to a length
Parameters:
Name | Type | Description |
---|---|---|
length |
Number | in sec |
- Source:
Returns:
- Type
- Array
fill_array(size, fn) → {Array}
fill an array with some values
Parameters:
Name | Type | Description |
---|---|---|
size |
Number | of the array to be filled |
fn |
function | to provide the value, if absent then array is filled with 0's. |
- Source:
Returns:
- Type
- Array
array_next(arr, offset, limit, callback)
advance thru array one step at a time. start over when arriving at the end
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | to loop over |
offset |
Number | added to index |
limit |
Number | upper bound to iteration |
callback |
function | invoked when the count resets |
- Source:
chance(percentage) → {boolean}
Returns a boolean based on percentage.
Parameters:
Name | Type | Description |
---|---|---|
percentage |
Number |
- Source:
Returns:
- Type
- boolean
scales(type)
Returns a musical scale/mode based on type
Parameters:
Name | Type | Description |
---|---|---|
type |
String | scale type |
- Source:
chords(type)
Returns a musical scale/mode based on type
Parameters:
Name | Type | Description |
---|---|---|
type |
String | scale type |
- Source:
random_scale(scale, octave_lower, octave_upper)
Return a random series of frequencies from randomly selected octaves from a given scale
Parameters:
Name | Type | Description |
---|---|---|
scale |
String | |
octave_lower |
Number | |
octave_upper |
Number |
- Source:
random_arpeggio(chord, octave_lower, octave_upper)
Return a random series of frequencies from a randomly selected octave from a given chord
Parameters:
Name | Type | Description |
---|---|---|
chord |
String | |
octave_lower |
Number | |
octave_upper |
Number |
- Source:
shuffle(arr)
Takes a reference to an array, shuffles it and returns it
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array |
- Source:
urnFactory(max)
Returns a function that generates a unique random number between 0 & max. If max is exceeded, then repeat the sequence of random numbers.
Parameters:
Name | Type | Description |
---|---|---|
max |
Number |
- Source:
random(min, max)
Returns a random number between min & max
Parameters:
Name | Type | Description |
---|---|---|
min |
Number | |
max |
Number |
- Source:
throttle_factory(num)
Factory to create a throttling function that returns true when called every nth times
Parameters:
Name | Type | Description |
---|---|---|
num |
Number |
- Source:
sequence(name)
Sequence - create a series of steps that take a function to execute and a time in minutes (including fractions) for when to execute it
Parameters:
Name | Type | Description |
---|---|---|
name |
String | name of sequence |
- Source:
Delay
reverb(paramsopt)
Convolver Reverb
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
delay(paramsopt)
Delay
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
comb(paramsopt)
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Distortion
bitcrusher(paramsopt)
Bitcrusher
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
ring(paramsopt)
Ring Modulator
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
overdrive(paramsopt)
Overdrive, waveshaper with additional parameters
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Envelope
adsr(userParamsopt, userParamsopt, userParamsopt, userParamsopt, userParamsopt)
Attack Decay Sustain Release envelope
Attack time is the time taken for initial run-up of level from nil to peak, beginning when the key is first pressed. Decay time is the time taken for the subsequent run down from the attack level to the designated sustain level. Sustain level is the level during the main sequence of the sound's duration, until the key is released. Release time is the time taken for the level to decay from the sustain level to zero after the key is released.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
userParams |
Array |
<optional> |
5 values: attack,decay,sustain,hold,release |
|
userParams |
Array |
<optional> |
4 values: attack,decay,sustain,release |
|
userParams |
Array |
<optional> |
3 values: attack,decay,sustain (holds until released) |
|
userParams |
String |
<optional> |
"slow" or "fast" |
|
userParams |
Number |
<optional> |
0.5 | length of the total envelope |
- Source:
Filter
lowpass(paramsopt)
Lowpass Filter
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
highpass(paramsopt)
Highpass Filter
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
bandpass(paramsopt)
Bandpass Filter
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
lowshelf(paramsopt)
Lowshelf Filter
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
highshelf(paramsopt)
Highshelf Filter
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
peaking(paramsopt)
Peaking Filter
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
notch(paramsopt)
Notch Filter
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
allpass(paramsopt)
Allpass Filter
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Interaction
mouse_movement()
Passes mouse move events to a callback. Tracks the movement of the mouse. web audio
- Source:
key_press()
Passes key press events to a callback. Tracks keyboard activity. web audio
- Source:
Miscellaneous
clip()
Clips audio level at 1/-1
- Source:
dac(paramsopt)
System out - destination with a master volume. Output is clipped if gain is 1 or less.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params |
Number |
<optional> |
1 | system out gain |
- Source:
adc(paramsopt)
System in - input with a master volume
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params |
Number |
<optional> |
1 | system in gain |
- Source:
out(paramsopt)
System out - destination with a master volume Alias for dac
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params |
Number |
<optional> |
1 | system out gain |
- Source:
multi_out(userParamsopt)
System multi_out - destination with a master volume w/ multi-channel support
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
in(paramsopt)
System in - input with a master volume Alias for adc
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
params |
Number |
<optional> |
1 | system in gain |
- Source:
panner(paramsopt)
Panner - simple stereo panner
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
map of optional values |
- Source:
sampler(userParamsopt)
Sampler - sound file player
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
Modulator
lfo(userParamsopt)
Low Frequency Oscillator
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userParams |
Object |
<optional> |
map of optional values Properties
|
- Source:
stepper(paramsopt)
Stepper
fill an audio buffer with a series of discrete values.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Noise
noise(paramsopt)
noise parametrized noise node
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
pink(paramsopt)
Pink Noise
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
white(paramsopt)
White Noise
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
brown(paramsopt)
Brown Noise
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Oscillator
sine(paramsopt)
Sine Wave Oscillator
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
square(paramsopt)
Square Wave Oscillator
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
saw(paramsopt)
Sawtooth Wave Oscillator
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
triangle(paramsopt)
Triangle Wave Oscillator
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
<optional> |
map of optional values Properties
|
- Source:
Setters
frequency(userParam)
Frequency setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | frequency to set |
- Source:
detune(userParam)
Detune setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | detune frequency to set |
- Source:
type(userParam)
Type setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
String | oscillator type to set |
- Source:
volume(userParam)
Gain setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | gain to set |
- Source:
fadeOut(userParam)
Fade out convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | optional time to set in seconds. Defaults to 0.02 |
- Source:
fadeIn(userParam)
Fade in convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | optional time to set in seconds. Defaults to 0.02 |
- Source:
time(userParam)
Delay time setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | delay time to set |
- Source:
feedback(userParam)
Feedback setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | feedback amount to set |
- Source:
speed(userParam)
Speed setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | sampler speed to set |
- Source:
drive(userParam)
Drive setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | drive distortion/waveshaper/etc to set |
- Source:
distortion(userParam)
Distortion setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | distortion to set |
- Source:
q(userParam)
q setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | q value to set |
- Source:
pan(userParam)
pan setter convenience method
Parameters:
Name | Type | Description |
---|---|---|
userParam |
Number | pan value (1 to -1) to set |
- Source:
Synth
gang_of_oscillators(paramsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
map of optional values |
- Source:
monosynth(paramsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
map of optional values |
- Source:
polysynth(paramsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
map of optional values |
- Source:
Utility
play()
Convenient way to say start everything
- Source:
scale(position, inMin, inMax, outMin, outMax, type)
Scale an input number between min & max to an output number between a min & max. Supports logarithmic or linear scaling.
Parameters:
Name | Type | Description |
---|---|---|
position |
Number | |
inMin |
Number | |
inMax |
Number | |
outMin |
Number | |
outMax |
Number | |
type |
String |
- Source:
sec2ms(second)
Converts a second value to millisecond value
Parameters:
Name | Type | Description |
---|---|---|
second |
Number |
- Source:
ms2sec(ms)
Converts a millisecond value to second value
Parameters:
Name | Type | Description |
---|---|---|
ms |
Number |
- Source:
ms2min(ms)
Converts a millisecond value to minute value
Parameters:
Name | Type | Description |
---|---|---|
ms |
Number |
- Source:
min2ms(minute)
Converts a minute value to a millisecond value
Parameters:
Name | Type | Description |
---|---|---|
minute |
Number |
- Source:
isSupported()
Returns a boolean true if the browser supports web audio
- Source:
pitch2freq(pitch)
Converts a pitch value to frequency
Parameters:
Name | Type | Description |
---|---|---|
pitch |
Number |
- Source:
freq2pitch(freq)
Converts a frequency to a pitch value
Parameters:
Name | Type | Description |
---|---|---|
freq |
Number |
- Source:
pitch2note(freq)
Converts a midi number to a note value
Parameters:
Name | Type | Description |
---|---|---|
freq |
Number |
- Source: