Note

One sound of a track: a pitch held for a stretch of ticks, together with what the channel that plays it needs to know to sound it.

Import

import { Note } from '@halleyfante/chiptune';

Playing a note

Constructor

new Note({ frequency: number, start: number, length: number, settings: Settings })
OptionDescription
frequencyIn hertz.
startIn ticks from the beginning of the track.
lengthIn ticks.
settingsHow the channel that plays the note should sound it.

Properties

NameTypeDescription
frequencynumber
startnumber
lengthnumber
settingsSettings
endnumberThe first tick after the note.
keynumberCounted as in MIDI, where 60 is middle C and 69 is the A at 440 hertz. An old chip plays slightly out of tune, so this is the nearest key.