Skip to content
A collection of Web Audio API custom oscillators.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.gitignore
.npmignore
LICENSE
README.md
package.json

README.md

web-audio-oscillators NPM version

A collection of Web Audio API custom oscillators.

Are you after a nice organ or bass sound? Look no further!

An online demo of all oscillators included in this package can be found here.

Installation

Install the package with NPM:

$ npm install web-audio-oscillators

Usage

For example, to create an OscillatorNode that sounds like an organ:

import oscillators from "web-audio-oscillators";

let context = new (window.AudioContext || window.webkitAudioContext)();
let oscillator = oscillators.organ(context);
oscillator.frequency.value = 220;
oscillator.connect(context.destination);
oscillator.start();

All oscillators provided by this package:

  • sine
  • square
  • square2
  • sawtooth
  • triangle
  • triangle2
  • chiptune
  • organ
  • organ2
  • organ3
  • organ4
  • organ5
  • bass
  • bass2
  • bass3
  • bass4
  • brass
  • brass2
  • aah
  • ooh
  • eeh
  • buzz
  • buzz2
  • dissonance

Contributing

Pull requests are most welcome. I'd like to expand this collection to cover more musical use cases!

You can’t perform that action at this time.