Tempo

Tempo’s parent is MeasureHeader.

Read tempo informations

use PhpTabs\PhpTabs;

$song = new PhpTabs('my-song.gp5');

// Get the first measure header's tempo
$tempo = $song->getMeasureHeader(0)->getTempo();

echo sprintf("
Tempo
-----

value: %s
in ms: %s
time per quarter: %s
",

    $tempo->getValue(),
    $tempo->getInMillis(),
    $tempo->getInTPQ()
);

It will ouput something like:

Tempo
-----

value: 200
in ms: 300
time per quarter: 300000

Write tempo informations

$tempo->setValue(100);

Copy

You may copy all attributes from another tempo.

// Copy from another tempo
$newTempo->copyFrom($tempo);