musicbits is a node library for easier creation of music with baudio-like modules.
var musicbits = require('musicbits')A simple ADSR envelope, where:
- a: attackDuration
- d: decayDuration
- s: sustainLevel
- r: releaseDuration
- frequency: frequency in Hertz
- duration: duration in seconds
- adsrConfig: JSON object with keys
a,d,sandrto pass tomusicbits.ADSR
-
melody: an array container integers representing note indices or arrays of two elements each, first being the note index and second being the duration
For example, the melody argument
[40, [41, 2], 42]would play note 40 for one note duration, note 41 for 2 notes duration and then 42 for one note duration -
adsrConfig (optional): A string, either
pianoorfluteor a JSON object with keysa,d,sandrto pass tomusicbits.ADSR -
fullNoteDuration (optional): Length of a normal length note in seconds