A Track is contained by a Song.
This method returns the number of measures contained by the track.
integer
$tab = new PhpTabs('mytabs.gp4');
$track = $tab->getTrack(0);
// Count the number of measures
echo $track->countMeasures();
// Will print a number between 0 and n-1
This method returns a Measure resource.
$tab = new PhpTabs('mytabs.gp4');
// Get first measure
$measure = $tab->getTrack(0)->getMeasure(0);
// Print the measure id
echo $measure->getNumber();
// Will print "1"
This method returns an array of Measure resources.
These are all measures contained in the current track.
$tab = new PhpTabs('mytabs.gp4');
// Get all measures
$measures = $tab->getTrack(0)->getMeasures();
// Print all measure ids
foreach ($measures as $index => $measure) {
echo sprintf(
"\nMeasure number=%d, index=%d",
$measure->getNumber(),
$index
);
}
will ouput something like:
Measure number=1, index=0
Measure number=2, index=1
Measure number=3, index=2
Measure number=4, index=3
This method returns the number of strings.
integer
$tab = new PhpTabs('mytabs.gp4');
$track = $tab->getTrack(0);
// Count the number of strings
echo $track->countStrings();
// Will print something like 6
This method returns a TabString resource.
$tab = new PhpTabs('mytabs.gp4');
// Get the first string
$string = $tab->getTrack(0)->getString(0);
// Print string value
echo $track->getValue();
// Will print something like "34"
This method returns an array of TabString resources.
These are all configured strings for the current track.
$tab = new PhpTabs('mytabs.gp4');
// Get all strings
$strings = $tab->getTrack(0)->getStrings();
// Print all strings data
foreach ($strings as $index => $string) {
echo sprintf(
"\nString index=%d, number=%d, value=%d",
$index,
$string->getNumber(),
$string->getValue()
);
}
will ouput something like:
String index=0, number=1, value=64
String index=1, number=2, value=59
String index=2, number=3, value=55
String index=3, number=4, value=50
String index=4, number=5, value=45
String index=5, number=6, value=40
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns.
None
integer
This method returns the parent Song.
$tab = new Phptabs('mytab.gp4');
$track = $tab->getTrack(0);
// Print song name
echo $track->getSong()->getName();
// Will ouput "My song name"
This method returns the name of the track.
string
$tab = new PhpTabs('mytabs.gp4');
// Get the first track
$track = $tab->getTrack(0);
// Print track name
echo $track->getName();
will ouput something like:
My track name
This method returns the channel identifier for this track.
integer
$tab = new PhpTabs('mytabs.gp4');
// Get the first track
$track = $tab->getTrack(0);
// Print the channel id
echo $track->getChannelId();
will ouput something like:
1
This method returns the number identifier of the track.
integer
$tab = new PhpTabs('mytabs.gp4');
// Get the first track
$track = $tab->getTrack(0);
// Print the channel id
echo $track->getNumber();
will ouput something like:
1
This method returns a Lyric resource.
None