0.0.1 • Published 5 years ago

zazate.js v0.0.1

Weekly downloads
12
License
-
Repository
github
Last release
5 years ago

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