phptabs icon indicating copy to clipboard operation
phptabs copied to clipboard

can't change instrument tuning

Open belfie13 opened this issue 1 year ago • 0 comments

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

belfie13 avatar Jan 23 '24 22:01 belfie13