Classes
Note

Note

What is a note?

A note is a sound with a specific pitch and duration. It is the most basic element of music.

How to create a note?

A note can be created with the following code:

index.js
import { Note } from 'musiquejs';
 
const note = new Note('C', 4, 0.5);

The above code will create a note with the pitch C4 and the duration 0.5 seconds.

How to play a note?

A note can be played with the following code:

index.js
import { Note } from 'musiquejs';
 
const note = new Note('C', 4, 0.5);
 
note.play();