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
npm install toscanini
const fs = ;const Toscanini = ; //returns a factory functionconst musicXML = fs;const toscanini = ; //create a Toscanini instance from a MusicXML stringtoscanini; //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:
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:
returns an array containing all tempos in the score, ex:
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.