JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q51051F

utility to chop an audio buffer

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

Build Status NPM Version Bower Coverage Status License

JavaScript utility to chop an audio buffer, inspired from youpy/scissor

✂️ Installation

bower:

bower install ciseaux

npm:

npm install ciseaux

downloads:

✂️ API

  • Ciseaux.silence(duration: number): Tape
  • Ciseaux.concat(tapes: Tape[]): Tape
  • Ciseaux.mix(tapes: Tape[], fillMethod='silence'): Tape

Ciseaux.Tape

  • constructor(audioBuffer: AudioBuffer)

Instance attributes

  • sampleRate: number readonly
  • length: number readonly
  • duration: number readonly
  • numberOfChannels readonly
  • numberOfTracks readonly

Instance methods

  • gain(gain: number = 1): Tape
  • pan(pan: number = 0): Tape
  • reverse(): Tape
  • pitch(rate: number = 1): Tape
  • stretch(rate: number = 1): Tape
    • not implemented (Pull Request please)
  • concat(...tapes: Tape): Tape
  • slice(startTime: number = 0, duration: number = inf): Tape
  • loop(n: number = 2): Tape
  • fill(duration: number): Tape
  • replace(startTime: number = 0, duration: number = 0, tape: Tape = null): Tape
  • split(n: number = 2): Tape[]
  • mix(tape: Tape, fillMethod = 'silence'): Tape
  • render(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);
});

✂️ License

MIT