portable-synthesizer

1.0.1 • Public • Published

portable-synthesizer Build Status

Making sounds with JavaScript! 🎹🎼🎶

portable-synthesizer is a wrapper around the Web Audio API aimed at making it easy to use the browser as a synthesizer. Currently, it has a fairly minimal API that allows users to define a set of oscillators and noises, play notes, and define custom sounds based on a mix of oscillators and noises.

Installation

portable-synthesizer is available on npm:

npm install portable-synthesizer --save

Usage Example

This library works in all browsers that support the Web Audio API.

import Synthesizer from 'portable-synthesizer'
 
const synth = Synthesizer(window.AudioContext || window.webkitAudioContext)
 
synth.setTone({
  oscillators: [{ waveform: 'triangle' }]
})
 
synth.play('C4') // middle C
 
setTimeout(() => {
  synth.stop('C4')
}, 500)

Readme

Keywords

none

Package Sidebar

Install

npm i portable-synthesizer

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

83 kB

Total Files

16

Last publish

Collaborators

  • atwulf