A sequence is an alternate notation of a part. Instead of passing in an array of [time, event] pairs, pass in an array of events which will be spaced at the given subdivision. Sub-arrays will subdivide that beat by the number of items are in the array. Sequence notation inspiration from Tidal
var seq = new Sequence(function(time, note){
console.log(note);
//straight quater notes
}, ["C4", "E4", "G4", "A4"], "4n");
var seq = new Sequence(function(time, note){
console.log(note);
//subdivisions are given as subarrays
}, ["C4", ["E4", "D4", "E4"], "G4", ["A4", "G4"]]);
The number of seconds of 1 processing block (128 samples)
The callback to invoke.
The context belonging to the node.
Set this debug flag to log all events that happen in this class.
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The index at which the sequence should start looping
If mute is true, the callback won't be invoked.
The current progress of the loop interval. Returns 0 if the event is not started yet or it is not set to loop.
The duration in seconds of one sample.
Returns the playback state of the note, either "started" or "stopped".
The subdivision of the sequence. This can only be set in the constructor. The subdivision is the interval between successive steps.
The value which is passed to the callback function.
The version number semver
Cancel all scheduled events greater than or equal to the given time
Get the object's attributes.
osc.get();
//returns {"type" : "sine", "frequency" : 440, ...etc}
Returns all of the default options belonging to the class.
Return the current time of the Context clock without any lookAhead.
Return the current time of the Context clock plus the lookAhead.
Set the parameters at once. Either pass in an object mapping parameters to values, or to set a single parameter, by passing in a string and value. The last argument is an optional ramp time which will ramp any signal values to their destination value over the duration of the rampTime.
//set values using an object
filter.set({
"frequency" : 300,
"type" : "highpass"
});
Start the part at the given time.
The offset index to start at
Convert the input to a frequency number
Convert the incoming time to seconds
Convert the class to a string
const osc = new Oscillator()
osc.toString() // "Oscillator"
Convert the input time into ticks