class Metronome

Metronome tick object. More...

Full nameTSE3::Metronome
Definition#include <Metronome.h>
InheritsTSE3::Notifier [public ], TSE3::Playable [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Members


Detailed Description

This class provides the functionality of a metronome.

The metronome remembers whether it should be produced in playing and recording modes, but it doesn't enforce this itself - it is the responsibility of the Transport playback routines.

There are two different metronome ticks that are produced, for bars and beats. They must have the same MIDI channel, port, and duration, but can have different notes and velocities.

To determine the point at which clocks bar ticks are produced, a bar reference exists.

See also: Playable

 Metronome ()

Metronome

Constructs a Metronome with default tick.

 ~Metronome ()

~Metronome

[virtual]

int  channel ()

channel

[const]

Returns the metronome MIDI channel.

Returns: Metronome MIDI channel

See also: setChannel

void  setChannel (int c)

setChannel

Sets the metronome MIDI channel.

Parameters:
cNew metronome MIDI channel

See also: channel

int  port ()

port

[const]

Returns the metronome MIDI port.

Returns: Metronome MIDI port

See also: setPort

void  setPort (int p)

setPort

Sets the metronome MIDI port.

Parameters:
pNew metronome MIDI port

See also: port

int  duration ()

duration

[const]

Returns the metronome duration.

Returns: Metronome tick duration

See also: setDuration

void  setDuration (int d)

setDuration

Sets the metronome duration.

Parameters:
pNew metronome tick duration

See also: duration

int  barNote ()

barNote

[const]

Returns the metronome bar note. This is the note that is played on a metronome tick that occurs at the start of a bar.

Returns: Metronome bar note

See also: setBarNote, setBeatNote, setBarVelocity

void  setBarNote (int n)

setBarNote

Sets the metronome bar note.

Parameters:
nNew metronome bar note

See also: barNote, beatNote, barVelocity

int  barVelocity ()

barVelocity

[const]

Returns the metronome bar velocity.

Returns: Metronome bar velocity

See also: setBarVelocity, setBeatVelocity, setBarNote

void  setBarVelocity (int v)

setBarVelocity

Sets the metronome bar velocity.

Parameters:
vNew metronome bar velocity

See also: barVelocity, beatVelocity, barNote

int  beatNote ()

beatNote

[const]

Returns the metronome beat note. This is the note that is played on a metronome tick that does not occur at the start of a bar.

Returns: Metronome beat note

See also: setBeatNote, setBarNote, setBeatVelocity

void  setBeatNote (int n)

setBeatNote

Sets the metronome beat note.

Parameters:
nNew metronome beat note

See also: beatNote, barNote, beatVelocity

int  beatVelocity ()

beatVelocity

[const]

Returns the metronome beat velocity.

Returns: Metronome beat velocity

See also: setBeatVelocity, setBarVelocity, setBeatNote

void  setBeatVelocity (int v)

setBeatVelocity

Sets the metronome bar velocity.

Parameters:
vNew metronome bar velocity

See also: beatrVelocity, barVelocity, beatNote

bool  status (int mode)

status

[const]

Returns the metronome playing status for a given Transport object status mode.

Parameters:
modeTransport object status mode

Returns: Whether metronome is produced in this mode

See also: setStatus

void  setStatus (int mode, bool s)

setStatus

Sets the metronome playing status for a given transport mode.

Parameters:
modeTransport object status mode
sNew metronome playing status

See also: status

int  beatsPerBar ()

beatsPerBar

[const]

Returns the metronome beats per bar value.

A normal TSE3 library user need not worry about this method.

The Transport object uses this value to tell the metronome the current time signtaure information. The value represents the number of quarter notes in a bar. It is used in conjuction with the barReference to determine which metronome ticks are 'bar' and which are 'beat'.

Returns: Metronome beats per bar value

See also: setBeatsPerBar

void  setBeatsPerBar (int bpb)

setBeatsPerBar

Sets the metronome beats per bar value.

A normal TSE3 library user need not worry about this method.

Parameters:
bpbNew beats per bar value

See also: beatsPerBar

Clock  barReference ()

barReference

[const]

Returns the metronome bar reference clock.

A normal TSE3 library user need not worry about this method.

This is the time value of some accented 'bar' note. This tells the Metronome object when to create a 'bat' tick and when to create a 'beat' tick when used in conjuction with the beatsPerBar method.

Returns: A bar tick reference time

See also: setBarReference, beatsPerBar

void  setBarReference (Clock br)

setBarReference

Sets the metronome bar reference clock.

A normal TSE3 library user need not worry about this method.

Parameters:
brNew bar tick reference time

See also: barReferenceTime

PlayableIterator * iterator (Clock index)

iterator

[virtual]

Reimplemented from Playable for internal purposes..

Clock  lastClock ()

lastClock

[const virtual]

Reimplemented from Playable for internal purposes..

friend class MetronomeIterator

MetronomeIterator