phptabs
phptabs copied to clipboard
can't change instrument tuning
when i try the following, it just changes the strings
$filename = '/GuitDaEMOns/CIID-Heaven&Hell-BibleBlack-Full2exp.mid';
$tab = new PhpTabs($filename);
foreach ($tab->getTracks() as $itrack => $track) {
if ($track->getStrings()[0]->getValue() !== 0)
{
$tuning = [36,41,46,51,55,60,65];
$count = $track->countStrings();
$diff = $count - count($tuning) + 1;
$j = 0;
for ($i = $count - 1; $i >= 0; $i--)
{
$tabString = $track->getStrings()[$j];
$tabString->setValue($tuning[$i]);
$j++;
}
}
}
file_put_contents($filename.'.gp5', $tab->getTablature()->toGuitarPro5());
echo $tab->getTablature()->toAscii();
the strings change tuning but the notes don't change, the frets stay the same