A Sharp11 plugin for playing notes, scales, and chords with Web Audio.
This module is designed for use with the Sharp11 library. It comes with a piano soundfont and a simple loader that exposes functions for playing notes, scales, and chords from Sharp11.
npm install sharp11-web-audio
var s11 = require('sharp11');
var audio = require('sharp11-web-audio');
audio.init(function (err, fns) {
// Your code here
});
obj
must be a note, scale, chord, or array of notes.start
specifies how many seconds after invocation the object should be played. It is0
by default.duration
specifies how many seconds the object should be sustained for. It is0.3
by default.- If a
callback
is given, it will be invoked each time a note in the object is played. It is given two parameters, the original object and the particular note being played.
Chords and arrays of notes are played all at once. Scales are played in succession, with the duration
applying to each note individually.
obj
must be a scale, chord, or array of notes.start
specifies how many seconds after invocation the object should be played. It is0
by default.duration
specifies how many seconds each note should be sustained for. It is0.3
by default.- If a
callback
is given, it will be invoked each time a note in the object is played. It is given two parameters, the original object and the particular note being played.
Scales, chords and arrays of notes are played in succession, with the duration
applying to each note individually.
Stops all objects scheduled to be played in the future and their callbacks.