Predefined constants for common musical objects and properties.
- Source:
Example
// Inject all names into the global namespace.
// WARNING: This is not safe to do in large/serious projects, however,
// it is very convenient when experimenting with this library.
require('chorus/names').into(global);
Members
(static) CHORDS
Built-in Chord types.
The available CHORDS types are defined here
Note: whether a chord such as a triad is major, minor, diminished, or augmented depends on the scale and the root of the chord. This is because chords in chorus.js are defined in terms of scale degrees, so you don't have to worry about accidentally using notes that aren't part of the scale. If you don't know music theory, don't worry about it! When using scales and chords in chorus.js, things will tend to sound good by default.
- Source:
- See:
Example
const { CHORDS } = require('chorus');
const { TRIAD, SEVENTH } = CHORDS;
const I_CHORD = TRIAD(0);
const IV_CHORD = TRIAD(3);
const V7_CHORD = SEVENTH(4);
const vi_inv1_CHORD = TRIAD(5, 1); // first inversion
(static) PITCH_CLASSES
The 12 PitchClasses:
C, Db, D, Eb, E, F, Gb, G, Ab, A, Bb, B
- Source:
(static) PITCHES
The 128 Pitches:
C_1, Db_1, D_1, Eb_1, E_1, F_1, Gb_1, G_1, Ab_1, A_1, Bb_1, B_1, C0, Db0, D0, ..., Ab8, B8, C9, Cb9, D9, Db9, E9, F9, Gb9, G9
C_1
is the minimum Pitch value of 0 ("_1"
means -1 octave number).
G9
the is maximum Pitch value of 127.
- Source:
(static) SCALES
Built-in Scale types.
- Source:
- See:
Example
const { PITCH_CLASSES, SCALES } = require('chorus');
const { C } = PITCH_CLASSES;
const { MAJOR } = SCALES;
const cMajorScale = MAJOR(C);
Methods
(static) into(namespace)
Inject all predefined names into the given Object.
Parameters:
Name | Type | Description |
---|---|---|
namespace |
Object | the object whose properties will be destructively modified to set all name/values defined here |
- Source: