web-audio-oscillators
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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 via npm:

npm install web-audio-oscillators

Usage

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

import { customOscillators } from 'web-audio-oscillators';

const context = new AudioContext();
const oscillator = customOscillators.organ(context);
oscillator.frequency.value = 220;
oscillator.connect(context.destination);
oscillator.start();

All custom 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!

Package Sidebar

Install

npm i web-audio-oscillators

Weekly Downloads

18

Version

2.0.0

License

MIT

Unpacked Size

11.8 kB

Total Files

25

Last publish

Collaborators

  • lukehorvat