Stroke¶
Stroke’s parent is Beat.
Read stroke informations¶
use PhpTabs\PhpTabs;
$song = new PhpTabs('my-song.gp5');
// Get stroke for the first beat
$stroke = $song->getTrack(0)
->getMeasure(0)
->getBeat(0)
->getStroke();
echo sprintf("
Stroke
------
direction: %s
value: %s
",
$stroke->getDirection(),
$stroke->getValue()
);
It will ouput something like:
Stroke
------
direction: 0
value:
Write stroke informations¶
/**
* Default direction = 0
* NONE = 0
* UP = 1
* DOWN = -1
*/
$stroke->setDirection(1);
$stroke->setValue(1);
Copy¶
You may copy all attributes from another stroke.
// Copy from another stroke
$newStroke>copyFrom($stroke);