This new version includes the ability to load a whole song with JSON. There is two ways of inputting note, verbose and shorthand. Below is example of doing both:
var gameMusic = new EightBit();
gameMusic.load({
timeSignature: [4, 4],
tempo: 100,
instruments: {
rightHand: 'square',
leftHand: 'sawtooth'
},
notes: {
// Shorthand notation
rightHand: [
'E5, F#4|quarter|tie',
'rest|quarter',
'E5, F#4|quarter',
'rest|quarter'
],
// Verbose notation
leftHand: [
{
type: 'note',
pitch: 'D3',
rhythm: 'quarter'
}
]
}
});
gameMusic.play();