0.1.1 • Published 10 years ago

coda-music v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

coda

Tired of regexping your way through your music notes? This package provides some useful abstractions to work with music concepts.

Quickstart

Install with:

npm install coda-music

Usage:

> var coda = require('coda-music');
> var Scale = coda.Scale;
> var Interval = coda.Interval;
> var Chord = coda.Chord;

> Scale.make('C', 'M')
{ id: 'CM',
  specId: 'M',
  label: 'C Major Scale',
  ascending: [ 'C', 'D', 'E', 'F', 'G', 'A', 'B' ],
  descending: [ 'B', 'A', 'G', 'F', 'E', 'D', 'C' ] }

> Scale.makeAll().length;
84

> Chord.make('C', '7')
{ id: 'C7',
  specId: '7',
  label: 'C 7th',
  notes: [ 'C', 'E', 'G', 'A#' ] }

> Chord.makeAll().length;
336

> Interval.getHalfsteps(Interval.AUGMENTED_FIFTH);
8

Roadmap

  • Key signatures
  • Harmonize a scale
  • Make scale notes key-aware (currently uses sharps only)
  • Ability to provide custom "specs" (templates to build scales/chords upon)
  • Suggestions? Please, file an issue or consider submitting a PR!