Skip to content

can't change instrument tuning #21

Open
@belfie13

Description

@belfie13

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions