Parse NBS (Note Block Song / Note Block Studio) files Pull Requests and issues are welcome!!
const NBS = require("nbs.js")
let song = NBS.loadSong("./song.nbs")
console.log(song)
Loads a song by given filename/path.
- filename : string
- Returns: Song
Parses data and returns a new Song.
- data : buffer
- Returns: Song
These properties are added to the song:
- data : object
- data.title : string
- data.author : string
- data.description : string
- data.original_author : string
- data.imported_name : string
- data.tempo : number (ticks per second)
- data.length : number (length of song measured in ticks)
- data.songHeight : number (opennbs says its count of layers, but check song.layers for that)
- data.layers : object (layers of the song)
Creates a new layer
Name of the layer
Volume of the layer (between 0 and 100)
Object containing Note. Object's keys are the tick position of the note.
Sets a note on tick.
- tick : number
- note : Note
These properties are also added to the note:
- instrument : number (0-15, can be found [here][https://opennbs.org/nbs])
- key : number (from 0-87, minecraft supports 33-57, [more info][https://opennbs.org/nbs])
Decimal number representing the pitch for notchian clients, is set to 0 if note.key is out of support range (33-57)
Returns a [minecraft-protocol][https://github.com/PrismarineJS/node-minecraft-protocol] packet data. Send to client with name of "sound_effect" to play the note.
Object used for note.pitch, perhaps you can modify it for something
Object used to make minecraft-protocol packet data. Is 1.12.2 as far as i know. Maybe fix this later