This simple module aims to make conversions in music informatics easier. It is helpful for MusicXML processing.
npm install concertmaster
const cm = require("concertmaster");
console.log(cm.noteToMidi("G#5")); //=> 68Currently supports the following functions:
takes a note string and converts it to a midi #
Ex:
cm.noteStringToMidiNum("G#5"); //=> 68takes a midi # and converts to a note string
Ex:
cm.midiNumToNoteString(68); //=> G#5takes a key and converts it to a number between -6 and 6. Negative numbers represent flats and positive numbers represent sharps as is in accordance with MusicXML
Ex:
cm.keyToNumSharpsFlats("Gb"); //=> -6takes a number between -6 and 6 and converts it to a key. Negative numbers represent flats and positive numbers represent sharps as is in accordance with MusicXML
Ex:
cm.numSharpsFlatsToKey(-6); //=> Gb...