Note¶
Note’s parent is Voice.
Read note informations¶
use PhpTabs\PhpTabs;
$song = new PhpTabs('my-song.gp5');
// Get a note
$note = $song->getTrack(0)
->getMeasure(0)
->getBeat(2)
->getVoice(0)
->getNote(0);
echo sprintf("
Note
----
string: %s
value: %s
velocity: %s
is tied note: %s
",
$note->getString(),
$note->getValue(),
$note->getVelocity(),
$note->isTiedNote() ? 'true' : 'false'
);
It will ouput something like:
Note
----
string: 3
value: 11
velocity: 95
is tied note: false
Write note informations¶
$note->setString(1);
$note->setValue(12);
$note->setVelocity(24);
$note->isTiedNote(true);
Voice¶
You may handle its voice.
// Get note voice
$voice = $note->getVoice();
// Set note voice
$note->setVoice($voice);