Class: Metronome

Metronome

Metronome audio engine. It extends Time Engine as a transported interface. example

Constructor

new Metronome(optionsopt)

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Default options

Properties
Name Type Attributes Default Description
period Number <optional>
1

Metronome period

clickFreq Number <optional>
600

Metronome click frequency

clickAttack Number <optional>
0.002

Metronome click attack time

clickRelease Number <optional>
0.098

Metronome click release time

gain Number <optional>
1

Gain

Source:
Example
import * as audio from 'waves-audio';
const scheduler = audio.getScheduler();
const metronome = new audio.Metronome({period: 0.333});

scheduler.add(metronome);

Extends

Members

clickAttack :Number

Metronome click attack time

Type:
  • Number
Source:

clickFreq :Number

Metronome click frequency

Type:
  • Number
Source:

clickRelease :Number

Metronome click release time

Type:
  • Number
Source:

gain :Number

linear gain factor

Type:
  • Number
Source:

period :Number

metronome period

Type:
  • Number
Source:

phase :Number

Set phase parameter (available only when 'transported'), should be between [0, 1[

Type:
  • Number
Source:

Methods

connect(target)

Connect to an audio node (e.g. audioContext.destination)

Parameters:
Name Type Description
target AudioNode

Target audio node

Inherited From:
Source:

disconnect(target)

Disconnect from an audio node (e.g. audioContext.destination). If undefined disconnect from all target nodes.

Parameters:
Name Type Description
target AudioNode

Target audio node.

Inherited From:
Source:

trigger(time)

Trigger metronome click

Parameters:
Name Type Description
time Number

metronome click synthesis audio time

Source: