Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukehorvat/web-audio-oscillators
A collection of Web Audio API custom oscillators.
https://github.com/lukehorvat/web-audio-oscillators
audiocontext oscillatornode oscillators periodicwave web-audio
Last synced: 24 days ago
JSON representation
A collection of Web Audio API custom oscillators.
- Host: GitHub
- URL: https://github.com/lukehorvat/web-audio-oscillators
- Owner: lukehorvat
- License: mit
- Created: 2017-09-06T17:14:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-09T12:23:18.000Z (6 months ago)
- Last Synced: 2024-09-24T11:50:00.587Z (3 months ago)
- Topics: audiocontext, oscillatornode, oscillators, periodicwave, web-audio
- Language: TypeScript
- Homepage:
- Size: 119 KB
- Stars: 61
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-webaudio - web-audio-oscillators - A collection of Web Audio custom oscillators. (Obsolete / Community)
README
# web-audio-oscillators [![npm version](https://img.shields.io/npm/v/web-audio-oscillators.svg?style=flat-square)](https://www.npmjs.com/package/web-audio-oscillators)
A collection of [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/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](https://oscillator.js.org).
## Installation
Install the package via npm:
```sh
npm install web-audio-oscillators
```## Usage
For example, to create an [OscillatorNode](https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode) that sounds like an organ:
```js
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!