npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

toscanini

v2.0.3

Published

A music score deep search tool

Downloads

8

Readme

toscanini

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

Demo

https://megaarman.github.io/toscanini/

Installation

npm install toscanini

Example Usage

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:

getInstrumentNames()

returns the names of the instruments in the score as an array, ex:

[ "Voice", "Piano" ]

getPitchRange(instrumentName)

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}

getKeySignatures(instrumentName)

returns the key signatures for a particular instrument as an array, or the entire score if no instrumentName is provided, ex:

["Ab", "Eb"]

getTempos()

returns an array containing all tempos in the score, ex:

[105, 90]

getTimeSignatures()

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.

getDynamics(instrumentName)

returns an array of dynamics for a particular instrument, or for the score if no instrumentName is provided, ex:

["ff",  "f",  "mf"] 

getRhythmComplexity(instrumentName)

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).

getNumberOfMeasures()

returns the number of measures in a score.