Arturo Toscanini was one of the greatest conductors of the 20th century. His photographic memory allowed him to answer his performers questions regarding their parts in entire performances, without physically examining the scores.
Inspired by Arturo Toscanini's great ability and skill, we made this module to answer some of the most common questions about music scores, particularly with band directors, performers, and musicologists in mind. Currently, this module only supports MusicXML, though various other formats (Ex: Finale, Sibelius, etc) can be converted to MusicXML. See also https://github.com/MegaArman/musicxml-iterator
https://megaarman.github.io/toscanini/
npm install toscanini
const fs = require("fs");
const Toscanini = require("toscanini"); //returns a factory function
const musicXML = fs.readFileSync("myscore.xml").toString();
const toscanini = Toscanini(musicXML); //create a Toscanini instance from a MusicXML string
toscanini.getPitchRange("Flute"); //assuming there is a flute in the score, see getInstrumentNames()
Currently supports the following queries:
returns the names of the instruments in the score as an array, ex:
[ "Voice", "Piano" ]
returns an object to represent the lowest and highest pitch in terms of midi numbers for an instrument or the entire score if no instrumentName is provided, ex:
{"minPitch": 30, "maxPitch": 72}
returns the key signatures for a particular instrument as an array, or the entire score if no instrumentName is provided, ex:
["Ab", "Eb"]
returns an array containing all tempos in the score, ex:
[105, 90]
returns an array of objects to represent the time signatures, ex:
[{ beatType: 4, beats: 4}, {beatType: 8, beats: 9}]
to show the score has time signatures 4/4 and 9/8 (in any instrument part). Note that node.js may reorder keys in objects.
returns an array of dynamics for a particular instrument, or for the score if no instrumentName is provided, ex:
["ff", "f", "mf"]
returns an array of objects representing the note types that appear for a particular instrument or for the entire score if no instrumentName is provided:
[{dotted: 0, type: "whole"}, {dotted: 0, type: "half"}, {dotted: 1, type: "quarter"},
{dotted: 1, type: "half"}, {dotted: 3, type: "quarter"}]
We can see from this example that the part had whole notes, half notes, dotted quarters, dotted halfs, and triple dotted quarters (a very particular composer indeed).
returns the number of measures in a score.