Skip to content

JSON Notation

Latest
Compare
Choose a tag to compare
@meenie meenie released this 25 Aug 00:15
· 1 commit to master since this release

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();