Giter Site home page Giter Site logo

mixer-gain-node's Introduction

altnode.MixerGainNode

Build Status NPM Version License

Installation

npm install -S altnode.mixer-gain-node

API

AudioNode

  • constructor(audioContext: AudioContext, numberOfInputs = 2)

Instance attributes

  • context: AudioContext

Instance methods

Also implements methods from the interface altnode.AudioNode.

  • getChannelGain(channel: number): AudioParam

Example

import MixerGainNode from "altnode.mixer-gain-node";

let audioContext = new AudioContext();
let oscillator1 = audioContext.createOscillator();
let oscillator2 = audioContext.createOscillator();
let oscillator3 = audioContext.createOscillator();
let mixer = new MixerGainNode(audioContext, 3);
let t0 = audioContext.currentTime;
let t1 = t0 + 5;

oscillator1.frequency.value = 440;
oscillator1.start(t0);
oscillator1.stop(t1);
oscillator1.connect(mixer, 0, 0);

oscillator2.frequency.value = 660;
oscillator2.start(t0);
oscillator2.stop(t1);
oscillator1.connect(mixer, 0, 1);

oscillator3.frequency.value = 880;
oscillator3.start(t0);
oscillator3.stop(t1);
oscillator1.connect(mixer, 0, 2);

mixer.getChannelGain(0).value = 0.1;
mixer.getChannelGain(1).value = 0.2;
mixer.getChannelGain(2).setValueAtTime(0, t0);
mixer.getChannelGain(2).linearRampToValueAtTime(0.5, t1);

mixer.connect(audioContext.destination);

LICENSE

MIT

mixer-gain-node's People

Contributors

mohayonao avatar

Stargazers

Michael Anthony avatar

Watchers

James Cloos avatar Michael Anthony avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.