{"id":36970048,"url":"https://github.com/stdtabs/phptabs","last_synced_at":"2026-01-13T21:43:40.498Z","repository":{"id":53783659,"uuid":"57412838","full_name":"stdtabs/phptabs","owner":"stdtabs","description":"A PHP library for reading, writing and rendering guitar tablatures and MIDI files","archived":false,"fork":false,"pushed_at":"2023-12-21T12:59:15.000Z","size":1494,"stargazers_count":43,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-11T00:58:10.031Z","etag":null,"topics":["chords","guitar","guitar-pro","guitar-tablature","midi-parser","music","tablature"],"latest_commit_sha":null,"homepage":"https://phptabs.readthedocs.io/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stdtabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-29T21:05:21.000Z","updated_at":"2025-07-17T14:19:10.000Z","dependencies_parsed_at":"2022-08-24T07:40:11.546Z","dependency_job_id":null,"html_url":"https://github.com/stdtabs/phptabs","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/stdtabs/phptabs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdtabs%2Fphptabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdtabs%2Fphptabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdtabs%2Fphptabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdtabs%2Fphptabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stdtabs","download_url":"https://codeload.github.com/stdtabs/phptabs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stdtabs%2Fphptabs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28400972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chords","guitar","guitar-pro","guitar-tablature","midi-parser","music","tablature"],"created_at":"2026-01-13T21:43:39.717Z","updated_at":"2026-01-13T21:43:40.492Z","avatar_url":"https://github.com/stdtabs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PhpTabs\n=======\n\n[![Latest Stable Version](https://poser.pugx.org/stdtabs/phptabs/version.svg)](https://github.com/stdtabs/phptabs/releases)\n[![Build Status](https://api.travis-ci.com/stdtabs/phptabs.svg?branch=master)](https://travis-ci.com/stdtabs/phptabs)\n[![License](https://poser.pugx.org/stdtabs/phptabs/license.svg)](https://packagist.org/packages/stdtabs/phptabs)\n\n[PhpTabs](https://phptabs.readthedocs.io/) is a PHP library for reading and writing scores and MIDI files.\nIt provides direct methods to read a song name, get a list of instruments or whatever be your needs.\n\nPhpTabs currently supports the following file formats:\n\n- Guitar Pro 3 (.gp3)\n- Guitar Pro 4 (.gp4)\n- Guitar Pro 5 (.gp5)\n- MIDI (.mid, .midi)\n\nAny questions?\n\n- Read the [PhpTabs Manual](https://phptabs.readthedocs.io/)\n- [Open an issue on github](https://github.com/stdtabs/phptabs/issues)\n- [Contribute code](https://github.com/stdtabs/phptabs/pulls)\n- Contribute documentation in the /docs\n\nTable of contents\n=================\n\n__The documentation below contains only basic examples. If you want to\nsee more examples and the complete API behind the library, read the\n[PhpTabs Manual](https://phptabs.readthedocs.io/).__\n\nBefore version 1.0.0, the old manual [PhpTabs Manual](https://stdtabs.github.io/)\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [Composer](#composer)\n  - [Alternative](#alternative)\n- [Testing](#testing)\n- [Basic Usage](#basic-usage)\n- [Methods](#methods)\n  - [Accessing metadata](#accessing-metadata)\n    - [getName()](#getname)\n    - [getArtist()](#getartist)\n    - [getAlbum()](#getalbum)\n    - [getAuthor()](#getauthor)\n    - [getCopyright()](#getcopyright)\n    - [getWriter()](#getwriter)\n    - [getComments()](#getcomments)\n    - [getTranscriber()](#gettranscriber)\n    - [getDate()](#getdate)\n  - [Accessing tracks](#accessing-tracks)\n    - [countTracks()](#counttracks)\n    - [getTracks()](#gettracks)\n    - [getTrack()](#gettrackindex)\n  - [Accessing channels](#accessing-channels)\n    - [countChannels()](#countchannels)\n    - [getChannels()](#getchannels)\n    - [getChannel()](#getchannelindex)\n  - [Accessing instruments](#accessing-instruments)\n    - [countInstruments()](#countinstruments)\n    - [getInstruments()](#getinstruments)\n    - [getInstrument()](#getinstrumentindex)\n  - [Accessing measure headers](#accessing-measure-headers)\n    - [countMeasureHeaders()](#countmeasureheaders)\n    - [getMeasureHeaders()](#getmeasureheaders)\n    - [getMeasureHeader()](#getmeasureheaderindex)\n  - [Saving data](#saving-data)\n    - [save()](#savefilename)\n    - [export()](#exportformat)\n    - [convert()](#converttype)\n\n________________________________________________________________________\n\nRequirements\n------------\n\nPhpTabs requires PHP 7.4+ and 8.0+.\n\nUntil PhpTabs 1.0.5, it was maintained for PHP versions 7.2 and 7.3.\n\nUntil PhpTabs 0.6.1, it was maintained for PHP versions 7.0 and 7.1.\n\nUntil PhpTabs 0.6.0, it was maintained for PHP versions 5.4, 5.5, 5.6\nand HHVM.\n\n________________________________________________________________________\n\nInstallation\n------------\n\n### Composer\n\n```sh\ncomposer require stdtabs/phptabs\n```\n\n### Alternative\n\nDownload and extract an archive from [https://github.com/stdtabs/phptabs/releases](https://github.com/stdtabs/phptabs/releases)\n\nThen add this PHP line before usage:\n\n```php\n// Use standalone bootstrap\nrequire_once 'src/PhpTabs/bootstrap.php';\n```\n\n________________________________________________________________________\n\nTesting\n-------\n\nTo run tests, you should install PHPUnit first.\n\n```sh\ncomposer require phpunit/phpunit\n```\n\nThen run the test suite with:\n\n```sh\nvendor/bin/phpunit\n```\n________________________________________________________________________\n\nBasic Usage\n-----------\n\n```php\nrequire_once 'src/PhpTabs/bootstrap.php';\n\nuse PhpTabs\\PhpTabs;\n\n// Instanciates a tablature\n$tablature = new PhpTabs(\"mytabs.gp3\");\n\n// Reads information\necho $tablature-\u003egetName();\n```\n\n________________________________________________________________________\n\nMethods\n-------\n\n### Accessing metadata\n________________________________________________________________________\n#### getName()\n\n__Type__ *string*\n\nThe name of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetName();\n```\n________________________________________________________________________\n#### getArtist()\n\n__Type__ *string*\n\nThe interpreter of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetArtist();\n```\n________________________________________________________________________\n#### getAlbum()\n\n__Type__ *string*\n\nThe name of the album.\n\n__Example__\n\n```php\n$tablature-\u003egetAlbum();\n```\n________________________________________________________________________\n#### getAuthor()\n\n__Type__ *string*\n\nThe author of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetAuthor();\n```\n________________________________________________________________________\n#### getCopyright()\n\n__Type__ *string*\n\nThe copyright of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetCopyright();\n```\n________________________________________________________________________\n#### getWriter()\n\n__Type__ *string*\n\nThe songwriter.\n\n__Example__\n\n```php\n$tablature-\u003egetWriter();\n```\n________________________________________________________________________\n#### getComments()\n\n__Type__ *string*\n\nThe tablature comments. They are compounded of several lines\nseparated by a line break (```PHP_EOL```).\n\n__Example__\n\n```php\n$tablature-\u003egetComments();\n```\n________________________________________________________________________\n#### getTranscriber()\n\n__Type__ *string*\n\n\nPerson who has transcribed tablature\n\n__Support__\n\nGuitar Pro \u003e= 4\n\n__Example__\n\n```php\n$tablature-\u003egetTranscriber();\n```\n________________________________________________________________________\n#### getDate()\n\n__Type__ *string*\n\nDate when tablature has been transcribed\n\n__Support__\n\nGuitar Pro \u003e= 4\n\n__Example__\n\n```php\n$tablature-\u003egetDate();\n```\n________________________________________________________________________\n\n### Accessing tracks\n________________________________________________________________________\n\n#### countTracks()\n\n__Type__ *integer*\n\nThe number of tracks\n\n__Example__\n\n```php\n$tablature-\u003ecountTracks();\n```\n________________________________________________________________________\n#### getTracks()\n\n__Type__ *array*\n\nAn array of Track objects\n\nThere is one track object for each instrument of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetTracks();\n```\n________________________________________________________________________\n#### getTrack($index)\n\n__Type__ *object*\n\n__Parameter__ *integer* $index\n\nThe music sheet for one instrument.\n\n__Example__\n\n```php\n// Get the first track\n$tablature-\u003egetTrack(0);\n```\n________________________________________________________________________\n\n### Accessing channels\n________________________________________________________________________\n\n#### countChannels()\n\n__Type__ *integer*\n\nThe number of channels\n\n__Example__\n\n```php\n$tablature-\u003ecountChannels();\n```\n________________________________________________________________________\n#### getChannels()\n\n__Type__ *array*\n\nAn array of Channel objects\n\nThere is one channel object for each track of the song.\n\n__Example__\n\n```php\n$tablature-\u003egetChannels();\n```\n________________________________________________________________________\n#### getChannel($index)\n\n__Type__ *object*\n\n__Parameter__ *integer* $index\n\nThe instrument and sound parameters for one track.\n\n__Example__\n\n```php\n// Get the first channel\n$tablature-\u003egetChannel(0);\n```\n________________________________________________________________________\n\n### Accessing instruments\n________________________________________________________________________\n\n#### countInstruments()\n\n__Type__ *integer*\n\nThe number of instruments\n\n__Example__\n\n```php\n$tablature-\u003ecountInstruments();\n```\n________________________________________________________________________\n#### getInstruments()\n\n__Type__ *array*\n\nA list of instrument arrays\n\n```php\narray(\n  'id' =\u003e \u003cinteger InstrumentId\u003e,\n  'name' =\u003e \u003cstring InstrumentName\u003e\n)\n```\n\n__Example__\n\n```php\n$tablature-\u003egetInstruments();\n```\n________________________________________________________________________\n#### getInstrument($index)\n\n__Type__ *array*\n\n__Parameter__ *integer* $index\n\nAn instrument array\n\n```php\narray(\n  'id' =\u003e \u003cinteger InstrumentId\u003e,\n  'name' =\u003e \u003cstring InstrumentName\u003e\n)\n```\n\n__Example__\n\n```php\n// Get the first instrument\n$tablature-\u003egetInstrument(0);\n```\n________________________________________________________________________\n\n### Accessing measure headers\n________________________________________________________________________\n\n#### countMeasureHeaders()\n\n__Type__ *integer*\n\nThe number of measure headers\n\n__Example__\n\n```php\n$tablature-\u003ecountMeasureHeaders();\n```\n________________________________________________________________________\n#### getMeasureHeaders()\n\n__Type__ *array*\n\nAn array of MeasureHeader objects\n\n__Example__\n\n```php\n$tablature-\u003egetMeasureHeaders();\n```\n________________________________________________________________________\n#### getMeasureHeader($index)\n\n__Type__ *object*\n\n__Parameter__ *integer* $index\n\nMeasure header contains global informations about the measure.\n\n__Example__\n\n```php\n// Get the first measure header\n$tablature-\u003egetMeasureHeader(0);\n```\n\n________________________________________________________________________\n\n### Saving data\n________________________________________________________________________\n\n#### save($filename)\n\n__Type__ *bool*\n\n__Parameter__ *string* $filename\n\nThis method records data as binary to the disk or buffer.\nIt implicitly converts filetype if the specified file extension is\ndifferent from the original (see examples below).\n\nFollowing parameters are allowed:\n\n| Parameter        | Type      | Description                      |\n|:-----------------|:----------|:---------------------------------|\n| filename.ext     | *bool*    | A file_put_contents() return     |\n\n__Example__\n\n```php\n// Instanciate a GP3 tab\n$tab = new PhpTabs('mytab.gp3');\n\n// Save as GP3\n$tab-\u003esave('newfile.gp3');\n\n// Convert and save as GP5\n$tab-\u003esave('newfile.gp5');\n\n```\n________________________________________________________________________\n\n#### convert($type)\n________________________________________________________________________\n\n__Type__ *string*\n\n__Parameter__ *string* $type\n\nThis method returns data as a binary string into a specified format.\n\nFollowing formats are allowed:\n\n| Parameter        | Type      | Description                       |\n|:-----------------|:----------|:----------------------------------|\n| null             | *string*  | A binary string, original format  |\n| gp3              | *string*  | A binary string, GP3 formatted    |\n| gp4              | *string*  | A binary string, GP4 formatted    |\n| gp5              | *string*  | A binary string, GP5 formatted    |\n| mid              | *string*  | A binary string, MIDI formatted   |\n| midi             | *string*  | A binary string, MIDI formatted   |\n\n__Example__\n\n```php\n// Instanciate a GP3 tab\n$tab = new PhpTabs('mytab.gp3');\n\n// Convert as GP3\necho $tab-\u003econvert('gp3');\n\n// Convert as GP5\necho $tab-\u003econvert('gp5');\n\n// Convert as MIDI\necho $tab-\u003econvert('mid');\n\n// Render as original format\n// Should be equal as file_get_contents('mytab.gp3')\necho $tab-\u003econvert();\n\n```\n\nA lot more examples on [PhpTabs Manual](https://phptabs.readthedocs.io/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdtabs%2Fphptabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstdtabs%2Fphptabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstdtabs%2Fphptabs/lists"}