zazate.js v0.0.1
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
- notes fifths - attribute augment(note) - function diminish(note) - function is_enharmonic(note1, note2) - function is_valid_note(note) - function note_to_int(note) - function int_to_note(note_int) - function remove_redundant_accidentals(note) - function to_major(note) - function to_minor(note) - function
- diatonic basic_keys - attribute get_notes(key) - function int_to_note(note_int, key) - function interval(key, start_note, interval) - function
- intervals augmented_unison(note1, note2, shorthand) - function determine(note1, note2, shorthand) - function fifth(note, key) - function fourth(note, key) - function from_shorthand(note, interval, up) - function get_interval(note, interval, key) - function interval(interval) - function is_consonant(note1, note2, include_fourths) - function is_dissonant(note1, note2, include_fourths) - function is_imperfect_consonant(note1, note2) - function is_perfect_consonant(note1, note2, include_fourths) - function major_fifth(note) - function major_fourth(note) - function major_second(note) - function major_seventh(note) - function major_sixth(note) - function major_third(note) - function major_unison(note) - function measure(note1, note2) - function minor_fifth(note) - function minor_fourth(note) - function minor_second(note) - function minor_seventh(note) - function minor_sixth(note) - function minor_third(note) - function minor_unison(note) - function perfect_fifth(note) - function perfect_fourth(note) - function second(note, key) - function seventh(note, key) - function sixth(note, key) - function third(note, key) - function * unison(note, key) - function
- chords I(key) - function I7(key) - function II(key) - function II7(key) - function III(key) - function III7(key) - function IV(key) - function IV7(key) - function V(key) - function V7(key) - function VI(key) - function VI7(key) - function VII(key) - function VII7(key) - function augmented_major_seventh(note) - function augmented_minor_seventh(note) - function augmented_triad(note) - function determine(chord, shorthand, no_inversions, no_polychords) - function determine_extended_chord5(chord, shorthand, no_inversions, no_polychords) - function determine_extended_chord6(chord, shorthand, no_inversions, no_polychords) - function determine_extended_chord7(chord, shorthand, no_inversions, no_polychords) - function determine_polychords(chord, shorthand) - function determine_seventh(seventh, shorthand, no_inversion, no_polychords) - function diminished_seventh(note) - function diminished_triad(note) - function dominant(key) - function dominant7(key) - function dominant_flat_five(note) - function dominant_flat_ninth(note) - function dominant_ninth(note) - function dominant_seventh(note) - function dominant_sharp_ninth(note) - function dominant_sixth(note) - function dominant_thirteenth(note) - function eleventh(note) - function first_inversion(chord) - function from_shorthand(shorthand_string, slash) - function half_diminished_seventh(note) - function hendrix_chord(note) - function ii(key) - function ii7(key) - function iii(key) - function iii7(key) - function int_desc(tries) - function invert(chord) - function lydian_dominant_seventh(note) - function major_ninth(note) - function major_seventh(note) - function major_sixth(note) - function major_thirteenth(note) - function major_triad(note) - function mediant(key) - function mediant7(key) - function minor_eleventh(note) - function minor_major_seventh(note) - function minor_ninth(note) - function minor_seventh(note) - function minor_seventh_flat_five(note) - function minor_sixth(note) - function minor_thirteenth(note) - function minor_triad(note) - function second_inversion(chord) - function seventh(note, key) - function sevenths(key) - function sixth_ninth(note) - function subdominant(key) - function subdominant7(key) - function submediant(key) - function submediant7(key) - function subtonic(key) - function subtonic7(key) - function supertonic(key) - function supertonic7(key) - function suspended_fourth_ninth(note) - function suspended_fourth_triad(note) - function suspended_second_triad(note) - function suspended_seventh(note) - function suspended_triad(note) - function third_inversion(chord) - function tonic(key) - function tonic7(key) - function triad(note, key) - function triads(key) - function vi(key) - function vi7(key) - function vii(key) - function * vii7(key) - function
- scales aeolian(note) - function chromatic(note) - function determine(scale) - function diatonic(note) - function diminished(note) - function dorian(note) - function get_notes(key) - function harmonic_minor(note) - function ionian(note) - function locrian(note) - function lydian(note) - function melodic_minor(note) - function mixolydian(note) - function natural_minor(note) - function phrygian(note) - function whole_note(note) - function
- meter common_time - attribute cut_time - attribute is_asymmetrical(meter) - function is_compound(meter) - function is_simple(meter) - function is_valid(meter) - function * valid_beat_duration(duration) - function
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