How to use tunajs - 10 common examples

To help you get started, we’ve selected a few tunajs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scriptify / soundcycle / app / sountility / webaudio-effect-units-collection / effects / pingPongDelay.js View on Github external
export default function createPingPongDelay(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...pingPongDelayData,
    effectChain: {
      pingpong: () => new tuna.PingPongDelay({
        wetLevel: 0.5, // 0 to 1
        feedback: 0.3, // 0 to 1
        delayTimeLeft: 150, // 1 to 10000 (milliseconds)
        delayTimeRight: 200 // 1 to 10000 (milliseconds)
      })
    }
  },
  audioCtx);
}
github scriptify / sountility / packages / webaudio-effect-units-collection / src / effects / compressor.js View on Github external
export default function createCompressor(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...compressorData,
    effectChain: {
      compressor: () => new tuna.Compressor({
        threshold: DEFAULT_THRESHOLD,    // -100 to 0
        makeupGain: DEFAULT_MAKEUPGAIN,     // 0 and up
        attack: DEFAULT_ATTACK,         // 0 to 1000
        release: DEFAULT_RELEASE,        // 0 to 3000
        ratio: DEFAULT_RATIO,          // 1 to 20
        knee: DEFAULT_KNEE,           // 0 to 40
        automakeup: DEFAULT_AUTOMAKEUP  // true/false
      })
    }
  },
github scriptify / soundcycle / app / sountility / webaudio-effect-units-collection / effects / delay.js View on Github external
export default function createDelay(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...delayData,
    effectChain: {
      delay: () => new tuna.Delay({
        feedback: DEFAULT_FEEDBACK,    // 0 to 1+
        delayTime: DEFAULT_DELAYTIME,    // 1 to 10000 milliseconds
        wetLevel: DEFAULT_WETLEVEL,    // 0 to 1+
        dryLevel: DEFAULT_DRYLEVEL,       // 0 to 1+
        cutoff: DEFAULT_CUTOFF      // cutoff frequency of the built in lowpass-filter. 20 to 22050
      })
    }
  },
  audioCtx);
}
github scriptify / sountility / packages / webaudio-effect-units-collection / src / effects / moog.js View on Github external
export default function createMoog(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...moogData,
    effectChain: {
      moog: () => new tuna.MoogFilter({
        cutoff: 0.065,    // 0 to 1
        resonance: 3.5,   // 0 to 4
        bufferSize: 4096  // 256 to 16384, NOT INCLUDED AS EDITABLE!
      })
    }
  },
  audioCtx);
}
github scriptify / soundcycle / app / sountility / webaudio-effect-units-collection / effects / wahwah.js View on Github external
export default function createWahWah(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...wahWahData,
    effectChain: {
      wahwah: () => new tuna.WahWah({
        automode: DEFAULT_AUTOMODE,                // true/false
        baseFrequency: DEFAULT_BASEFREQUENCY,            // 0 to 1
        excursionOctaves: DEFAULT_EXCURSIONOCTAVES,           // 1 to 6
        sweep: DEFAULT_SWEEP,                    // 0 to 1
        resonance: DEFAULT_RESONANCE,                 // 1 to 100
        sensitivity: DEFAULT_SENSITIVITY              // -1 to 1
      })
    }
  },
  audioCtx);
github scriptify / sountility / packages / webaudio-effect-units-collection / src / effects / wahwah.js View on Github external
export default function createWahWah(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...wahWahData,
    effectChain: {
      wahwah: () => new tuna.WahWah({
        automode: DEFAULT_AUTOMODE,                // true/false
        baseFrequency: DEFAULT_BASEFREQUENCY,            // 0 to 1
        excursionOctaves: DEFAULT_EXCURSIONOCTAVES,           // 1 to 6
        sweep: DEFAULT_SWEEP,                    // 0 to 1
        resonance: DEFAULT_RESONANCE,                 // 1 to 100
        sensitivity: DEFAULT_SENSITIVITY              // -1 to 1
      })
    }
  },
  audioCtx);
github scriptify / soundcycle / app / sountility / webaudio-effect-units-collection / effects / bitcrusher.js View on Github external
export default function createBitcrusher(audioCtx, tuna = new Tuna(audioCtx)) {
  // Tuna is optional

  return new EffectUnit({
    ...bitcrusherData,
    effectChain: {
      bitcrusher: () => new tuna.Bitcrusher({
        bits: 4,          // 1 to 16
        normfreq: 0.1,    // 0 to 1
        bufferSize: 4096  // 256 to 16384, NOT INCLUDED AS EDITABLE!
      })
    }
  },
  audioCtx);
}
github scriptify / soundcycle / app / sountility / webaudio-effect-units-collection / index.js View on Github external
export default function createEffectCollection(audioCtx) {

  const tuna = new Tuna(audioCtx);

  return {
    gain: createGain(audioCtx),
    lowpass: createLowpass(audioCtx),
    highpass: createHighpass(audioCtx),
    dubDelay: createDubDelay(audioCtx),
    reverb: createReverb(audioCtx),
    chorus: createChorus(audioCtx, tuna),
    delay: createDelay(audioCtx, tuna),
    phaser: createPhaser(audioCtx, tuna),
    compressor: createCompressor(audioCtx, tuna),
    tremolo: createTremolo(audioCtx, tuna),
    wahwah: createWahWah(audioCtx, tuna),
    bitcrusher: createBitcrusher(audioCtx, tuna),
    moog: createMoog(audioCtx, tuna),
    pingPongDelay: createPingPongDelay(audioCtx, tuna)
github FormidableLabs / react-music / src / components / moog-filter.js View on Github external
constructor(props: Props, context: Context) {
    super(props);

    const tuna = new Tuna(context.audioContext);

    this.connectNode = new tuna.MoogFilter({
      cutoff: props.cutoff,
      resonance: props.resonance,
      bufferSize: props.bufferSize,
    });

    this.connectNode.connect(context.connectNode);
  }
  getChildContext(): Object {
github FormidableLabs / react-music / src / components / reverb.js View on Github external
constructor(props: Props, context: Context) {
    super(props);

    const tuna = new Tuna(context.audioContext);

    this.connectNode = new tuna.Convolver({
      highCut: props.highCut,
      lowCut: props.lowCut,
      dryLevel: props.dryLevel,
      wetLevel: props.wetLevel,
      level: props.level,
      impulse: props.impulse,
      bypass: props.bypass,
    });

    this.connectNode.connect(context.connectNode);
  }
  getChildContext(): Object {

tunajs

Audio effects library for the Web Audio API

MIT
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis

Popular tunajs functions