How to use the virtual-audio-graph.biquadFilter function in virtual-audio-graph

To help you get started, we’ve selected a few virtual-audio-graph 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 benji6 / andromeda / src / plugins / effects / Delay / index.js View on Github external
delayTime,
  dryLevel,
  feedback,
  highCut,
  lowCut,
  pingPong,
  wetLevel,
}) => virtualAudioGraph.update({
  0: gain('output', {gain: wetLevel}),
  1: stereoPanner(0, {pan: -1}),
  2: stereoPanner(0, {pan: 1}),
  3: delay([2, 8], {delayTime, maxDelayTime}),
  4: gain(3, {gain: feedback}),
  5: delay(pingPong ? [1, 3] : [0, 8], {delayTime, maxDelayTime}),
  6: biquadFilter(5, {frequency: highCut}),
  7: biquadFilter(6, {frequency: lowCut, type: 'highpass'}),
  8: gain(7, {gain: feedback}),
  9: gain('output', {gain: dryLevel}),
  input: gain([8, 9], {gain: 1}, 'input'),
})
github benji6 / andromeda / src / plugins / effects / Reverb / index.js View on Github external
bufferPromise.then(buffer => virtualAudioGraph.update({
    0: gain('output', {gain: dryLevel}),
    1: biquadFilter('output', {frequency: highCut}),
    2: biquadFilter(1, {frequency: lowCut, type: 'highpass'}),
    3: gain(2, {gain: wetLevel}),
    4: gain(3, {gain: 0.5}),
    5: convolver(4, {buffer}, 'input'),
    input: gain([0, 5]),
  }))
  reverbTypeToBufferPromise[reverbType] = bufferPromise
github miselaytes-anton / web-audio-experiments / packages / tape-app / src / components / Audio / index.js View on Github external
const paramsToGraph = ({tapeSpeed, feedbackAmount, reader1Position, audioBuffer, mix, lowpass}) => {
  //ensure a new node is created each time
  const bufferSourceDry = `bufferSourceDry${new Date().getTime()}`;
  const bufferSourceWet = `bufferSourceWet${new Date().getTime()}`;
  return {
    master: gain('output', {gain: 0.7}),
    dry: gain('master', {gain: normDry(mix)}),
    wet: gain('master', {gain: normWet(mix)}),
    feedback: gain(['delay'], {gain: normFeedback(feedbackAmount)}),
    lowpass: biquadFilter(['feedback', 'wet'], {type: 'lowpass', frequency: normFrequency(lowpass)}),
    delay: delay('lowpass', {delayTime: normDelay(reader1Position)}),
    [bufferSourceDry]: bufferSource('dry', {buffer: audioBuffer, loop: true}),
    [bufferSourceWet]: bufferSource('delay', {buffer: audioBuffer, loop: true, playbackRate: normSpeed(tapeSpeed)}),
  };
};
github benji6 / andromeda / src / plugins / effects / Delay / index.js View on Github external
const updateAudioGraph = virtualAudioGraph => ({
  delayTime,
  dryLevel,
  feedback,
  highCut,
  lowCut,
  pingPong,
  wetLevel,
}) => virtualAudioGraph.update({
  0: gain('output', {gain: wetLevel}),
  1: stereoPanner(0, {pan: -1}),
  2: stereoPanner(0, {pan: 1}),
  3: delay([2, 8], {delayTime, maxDelayTime}),
  4: gain(3, {gain: feedback}),
  5: delay(pingPong ? [1, 3] : [0, 8], {delayTime, maxDelayTime}),
  6: biquadFilter(5, {frequency: highCut}),
  7: biquadFilter(6, {frequency: lowCut, type: 'highpass'}),
  8: gain(7, {gain: feedback}),
  9: gain('output', {gain: dryLevel}),
  input: gain([8, 9], {gain: 1}, 'input'),
})
github benji6 / andromeda / src / plugins / effects / Reverb / index.js View on Github external
bufferPromise.then(buffer => virtualAudioGraph.update({
    0: gain('output', {gain: dryLevel}),
    1: biquadFilter('output', {frequency: highCut}),
    2: biquadFilter(1, {frequency: lowCut, type: 'highpass'}),
    3: gain(2, {gain: wetLevel}),
    4: gain(3, {gain: 0.5}),
    5: convolver(4, {buffer}, 'input'),
    input: gain([0, 5]),
  }))
  reverbTypeToBufferPromise[reverbType] = bufferPromise
github benji6 / andromeda / src / plugins / instruments / Prometheus / notesToGraph.js View on Github external
frequency,
          gain: oscillatorSuper.gain,
          pan: oscillatorSuper.pan,
          pitch: oscillatorSuper.pitch,
          startTime,
          stopTime,
          type: type === 'random'
            ? ['sawtooth', 'sine', 'square', 'triangle'][Math.floor(Math.random() * 4)]
            : type,
        })
      }
    }

    return acc
  }, {
    filter: biquadFilter('masterPan', filter),
    lfo: lfoNode({destination: 'frequency', key: 'filter'}, lfo),
    masterGain: gainNode('output', {gain: master.gain}),
    masterPan: stereoPanner('masterGain', {pan: master.pan}),
  })