Options
All
  • Public
  • Public/Protected
  • All
Menu

A Metronome based on Tone.js

Hierarchy

  • Metronome

Index

Constructors

constructor

  • Metronome constructor.

    Parameters

    • callbackObject: MetronomeCallbackObject

      An MetronomeCallback object that contains click(), quarter() and bar() methods to be called during the metronome run time.

    • Default value clicksPerQuarter: number = 1

      The number of clicks the metronome should make per quarter. For example, if clicksPerQuarter=1, then the metronome will click on every quarter note, but if clicksPerQuarter = 4, the metronome will make audible clicks on every sixteenth note.

    Returns Metronome

Properties

clicksPerQuarter

clicksPerQuarter: number = 1

Protected hiClick

hiClick: any = new Tone.MembraneSynth({pitchDecay: 0.008,envelope: {attack: 0.001, decay: 0.3, sustain: 0},}).toDestination()

Protected hiClickNote

hiClickNote: string = "g5"

Protected loClick

loClick: any = new Tone.MembraneSynth({pitchDecay: 0.008,envelope: {attack: 0.001, decay: 0.3, sustain: 0},}).toDestination()

Protected loClickNote

loClickNote: string = "c5"

muted

muted: boolean = false

Methods

getOffsetTime

  • getOffsetTime(): number

getStartedAt

  • getStartedAt(): number

isTicking

  • isTicking(): boolean

start

  • start(bpm?: number): void
  • Starts the metronome with the provided bpm.

    Parameters

    • Default value bpm: number = 120

    Returns void

stop

  • stop(): void

Generated using TypeDoc