Classes
Chords

Chords

What is a Chord?

A chord is a group of notes that are played together.

Types of Chords

This library implements two classes for chords:

CustomChord

What we call "CustomChord" is a class that allows you to create your own chords by specifying the notes you want to include in it.

How to create a custom chord?

index.js
import { CustomChord, Note } from 'musiquejs';
 
const cchord = new CustomChord([
    new Note('G', 5, 0.18),
    new Note('C', 5, 0.18),
    new Note('E', 5, 0.18)
  ]);

CustomChords can then simply be inserted into a partition easily like notes or played directly.

How to play a custom chord?

index.js
import { CustomChord, Note } from 'musiquejs';
 
const cchord = new CustomChord([
    new Note('C', 5, 0.18),
    new Note('E', 5, 0.18)
]);
 
cchord.play();

Chord

⚠️

Chords have yet to be added to the library as of version 1.1.0. This feature will be added in a future release, it could change from what is currently displayed here.

What we call "Chord" is a class that represents an existing real-life chord tha is often present in music pieces.

Existing chords

ChordNotes
A majorA, C#, E
C majorC, E, G
D majorD, F#, A

A chord can be called with the following code:

index.js
import { Chord } from 'musiquejs';
 
const chord = new Chord('C Major');

Chords can then simply be inserted into a partition or played directly.

How to play a chord?

index.js
import { Chord } from 'musiquejs';
 
const chord = new Chord('C Major');
 
chord.play();