Package Exports
- ciseaux
- ciseaux/lib/tape
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ciseaux) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
:feelsgood: work in progress
ciseaux
JavaScript utility to chop an audio buffer, inspired from youpy/scissor
✂️ Installation
bower:
bower install ciseauxnpm:
npm install ciseauxdownloads:
✂️ API
Ciseaux.silence(duration: number): TapeCiseaux.concat(tapes: Tape[]): TapeCiseaux.mix(tapes: Tape[], fillMethod='silence'): Tape
Ciseaux.Tape
constructor(audioBuffer: AudioBuffer)
Instance attributes
sampleRate: numberreadonlylength: numberreadonlyduration: numberreadonlynumberOfChannelsreadonlynumberOfTracksreadonly
Instance methods
gain(gain: number = 1): Tapepan(pan: number = 0): Tapereverse(): Tapepitch(rate: number = 1): Tapestretch(rate: number = 1): Tape- not implemented (Pull Request please)
concat(...tapes: Tape): Tapeslice(startTime: number = 0, duration: number = inf): Tapeloop(n: number = 2): Tapefill(duration: number): Tapereplace(startTime: number = 0, duration: number = 0, tape: Tape = null): Tapesplit(n: number = 2): Tape[]mix(tape: Tape, fillMethod = 'silence'): Taperender(audioContext: AudioContext): Promise<AudioBuffer>dispose(): void
Ciseaux.Sequence
constructor(pattern: string, durationPerStep: number)
Instance methods
apply(instruments: object): Tape
✂️ Examples
var tape = new Ciseaux.Tape(audioBuffer);
var stutter = tape.split(100).map(function(tape) {
return tape.loop(4);
});
Ciseaux.concat(stutter).render(audioContext).then(function(audioBuffer) {
play(audioBuffer);
});var seq = new Ciseaux.Sequence("x y xyz", 0.2);
var tape = seq.apply({
x: foo,
y: function() {
return bar;
},
z: foo.reverse().
}).loop(4).render(audioContext).then(function(audioBuffer) {
play(audioBuffer);
});