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

zazate.js

v0.0.1

Published

Music theory and notation library for javascript and node.js

Downloads

1

Readme

zazate.js

Zazate.js is music theory and notation package or module for Javascript, can be used by programmers, musicians, composers and researchers to make and investigate music. Zazate.js is integrated with a big numbers of functions related to find notes, chords and intervals.

Features

  • Work with notes, intervals, chords, scales, keys and meters in a simple and theoretically sound way.
  • Generate natural diatonic intervals (seconds, thirds, fourths, etc) and absolute intervals (minors second, perfect fifths, etc.)
  • Generate natural diatonic triads, seventh chords, and absolute chords directly or from shorthand (min7, m/M7, etc). zazate.js also knows about inversions, slashed chords and polychords.
  • Refer to chords by their diatonic function (tonic, subtonic, etc. or I, ii, iii, IV, etc).
  • Work with diatonic scales and their modes (ionian, mixolydian, etc.), generate the minor (natural, harmonic and melodic) and chromatic or whole note scales.
  • Recognize intervals, scales and hundreds of chords from lists of notes.
  • Recognize the harmonic functions of chords.

Installation

via npm:

$ npm install zazate.js

Usage

var zazate = require('zazate.js');
var result = zazate.notes.augment('C');
console.log(result); // print 'C#'

Use this syntax

var zazate = require('zazate.js');
zazate.<library>.<function>(arg1, arg2...);

In zazatz.js, there are the following libraries:

  • notes
  • diatonic
  • intervals
  • chords
  • scales
  • meter
  • values (need documentation)
  • progressions (not full yet)

See functions of each library in documentation below.

Documentation

Index

More documentation is coming soon!!















zazate.intervals.determine("C", "E"); // return 'major third'
zazate.intervals.determine("C", "Eb"); // return 'minor third'
zazate.intervals.determine("C", "E#"); // return 'augmented third'
zazate.intervals.determine("C", "Ebb"); // return 'diminished third'
zazate.intervals.determine("C", "G"); // return 'perfect fifth'
zazate.intervals.determine("C", "F"); // return 'perfect fourth'



zazate.intervals.from_shorthand("A", "b3"); // return 'C'
zazate.intervals.from_shorthand("D", "2"); // return 'A'
zazate.intervals.from_shorthand("E", "2", false); // return 'D'












zazate.intervals.unison("C"); // return 'C'










Can determine major, minor, diminished and suspended triads. Also knows about invertions.

zazate.chords.determine_triad(["A", "C", "E"]) // 'A minor triad'
zazate.chords.determine_triad(["C", "E", "A"]) // 'A minor triad, first inversion'
zazate.chordsdetermine_triad(["A", "C", "E"], true) // 'Am'














zazate.chords.from_shorthand("Amin") // ["A", "C", "E"]
zazate.chords.from_shorthand("Am/M7") // ["F", "Ab", "C", "E"]
zazate.chords.from_shorthand("A") // ["A", "C#", "E"]
zazate.chords.from_shorthand("A/G") // ["G", "A", "C#", "E"]
zazate.chords.from_shorthand("Dm|G") // ["G", "B", "D", "F", "A"]

Recognised abbreviations: the letters m and M in the following abbreviations can always be substituted by respectively min, mi or - and maj or ma (eg. from_shorthand("Amin7") == from_shorthand("Am7"), etc.).

  • Triads: 'm', 'M' or '', 'dim'.
  • Sevenths: 'm7', 'M7', '7', 'm7b5', 'dim7', 'm/M7' or 'mM7'
  • Augmented chords: 'aug' or '+', '7#5' or 'M7+5', 'M7+', 'm7+', '7+'
  • Suspended chords: 'sus4', 'sus2', 'sus47', 'sus', '11', 'sus4b9' or 'susb9'
  • Sixths: '6', 'm6', 'M6', '6/7' or '67', 6/9 or 69
  • Ninths: '9', 'M9', 'm9', '7b9', '7#9'
  • Elevenths: '11', '7#11', 'm11'
  • Thirteenths: '13', 'M13', 'm13'
  • Altered chords: '7b5', '7b9', '7#9', '67' or '6/7'
  • Special: '5', 'NC', 'hendrix'




























































Returns true if meter is an asymmetrical meter, false otherwise.

zazate.meter.is_asymmetrical([3,4]) // true
zazate.meter.is_asymmetrical([3,4]) // false