tune
Tune up baudio.
install
Install tune and baudio: npm install tune baudio
You also need to install SoX: http://sox.sourceforge.net/
examples
Just a single note
var baudio = tune = ; var a = ; var b = ;b;
Hungarian Dance no5
var baudio = tune = ; var hungarian = ; var b = ;b;
Soundgarden - Black Hole Sun
var baudio = tune = ; var blackholesun = ; var b = ;b;
Final Fantasy Arpeggios
var baudio = tune = ; var ff = ; 'C D E G' 'A B C E' 'C D E G' 'A B C E' 'A C F G' 'A B D G' 'Ab C Eb G' 'A Bb D F';ff = ; var b = ;b;
methods
var tune = ;
var t = tune(notes)
Returns a function: function(time[, options])
that will return a value based
on time
between -1 and 1 to formulate a wave. Then you return the value within
your baudio function.
notes
can be a single note string: 'A#5'
or an array of notes:
['C4', 'D5', 'E4', 'Gb7']
. Mark notes with sharps #
and flats b
. Then
ending number refers to the octave. In a sequence if the octave isn't specified,
it will use the last set octave or 4
. Use .
for muted notes.
options
are an object literal {}
:
tempo
[4
] - how fast to transition through the notesvolume
[1.0
] - volume to play the tune:0.0 - 1.0
Release History
- 0.2.1 - Readme update.
- 0.2.0 -
tune
just returns a function now. - 0.1.2 - Add mute notes.
- 0.1.1 - Better API interface. Add volume option.
- 0.1.0 - initial release
License
Copyright (c) 2014 Kyle Robinson Young
Licensed under the MIT license.