PHPackages                             stdtabs/phptabs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. stdtabs/phptabs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stdtabs/phptabs
===============

A PHP library for reading, writing and rendering Guitar Pro and MIDI files

1.1.0(2y ago)4291910[4 issues](https://github.com/stdtabs/phptabs/issues)[1 PRs](https://github.com/stdtabs/phptabs/pulls)LGPL-2.1+PHPPHP &gt;=7.4CI failing

Since Apr 30Pushed 2y ago5 watchersCompare

[ Source](https://github.com/stdtabs/phptabs)[ Packagist](https://packagist.org/packages/stdtabs/phptabs)[ Docs](https://phptabs.readthedocs.io/)[ GitHub Sponsors](https://github.com/landrok)[ Fund](https://ko-fi.com/landrok)[ RSS](/packages/stdtabs-phptabs/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (1)Versions (18)Used By (0)

PhpTabs
=======

[](#phptabs)

[![Latest Stable Version](https://camo.githubusercontent.com/22ead78998b1c7541a1edc4ccfa7563b3456dd0dccf193ec252697a8b04923ba/68747470733a2f2f706f7365722e707567782e6f72672f737464746162732f706870746162732f76657273696f6e2e737667)](https://github.com/stdtabs/phptabs/releases)[![Build Status](https://camo.githubusercontent.com/68827baaa404f5aca7e30801d9f4877c7b4682591062acea7883039e88c5e8d8/68747470733a2f2f6170692e7472617669732d63692e636f6d2f737464746162732f706870746162732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/stdtabs/phptabs)[![License](https://camo.githubusercontent.com/8059a97370d2e3249c98c4ba01591143fdd6601621b30bd680d264d221290edb/68747470733a2f2f706f7365722e707567782e6f72672f737464746162732f706870746162732f6c6963656e73652e737667)](https://packagist.org/packages/stdtabs/phptabs)

[PhpTabs](https://phptabs.readthedocs.io/) is a PHP library for reading and writing scores and MIDI files. It provides direct methods to read a song name, get a list of instruments or whatever be your needs.

PhpTabs currently supports the following file formats:

- Guitar Pro 3 (.gp3)
- Guitar Pro 4 (.gp4)
- Guitar Pro 5 (.gp5)
- MIDI (.mid, .midi)

Any questions?

- Read the [PhpTabs Manual](https://phptabs.readthedocs.io/)
- [Open an issue on github](https://github.com/stdtabs/phptabs/issues)
- [Contribute code](https://github.com/stdtabs/phptabs/pulls)
- Contribute documentation in the /docs

Table of contents
=================

[](#table-of-contents)

**The documentation below contains only basic examples. If you want to see more examples and the complete API behind the library, read the [PhpTabs Manual](https://phptabs.readthedocs.io/).**

Before version 1.0.0, the old manual [PhpTabs Manual](https://stdtabs.github.io/)

- [Requirements](#requirements)
- [Installation](#installation)
    - [Composer](#composer)
    - [Alternative](#alternative)
- [Testing](#testing)
- [Basic Usage](#basic-usage)
- [Methods](#methods)
    - [Accessing metadata](#accessing-metadata)
        - [getName()](#getname)
        - [getArtist()](#getartist)
        - [getAlbum()](#getalbum)
        - [getAuthor()](#getauthor)
        - [getCopyright()](#getcopyright)
        - [getWriter()](#getwriter)
        - [getComments()](#getcomments)
        - [getTranscriber()](#gettranscriber)
        - [getDate()](#getdate)
    - [Accessing tracks](#accessing-tracks)
        - [countTracks()](#counttracks)
        - [getTracks()](#gettracks)
        - [getTrack()](#gettrackindex)
    - [Accessing channels](#accessing-channels)
        - [countChannels()](#countchannels)
        - [getChannels()](#getchannels)
        - [getChannel()](#getchannelindex)
    - [Accessing instruments](#accessing-instruments)
        - [countInstruments()](#countinstruments)
        - [getInstruments()](#getinstruments)
        - [getInstrument()](#getinstrumentindex)
    - [Accessing measure headers](#accessing-measure-headers)
        - [countMeasureHeaders()](#countmeasureheaders)
        - [getMeasureHeaders()](#getmeasureheaders)
        - [getMeasureHeader()](#getmeasureheaderindex)
    - [Saving data](#saving-data)
        - [save()](#savefilename)
        - [export()](#exportformat)
        - [convert()](#converttype)

---

Requirements
------------

[](#requirements)

PhpTabs requires PHP 7.4+ and 8.0+.

Until PhpTabs 1.0.5, it was maintained for PHP versions 7.2 and 7.3.

Until PhpTabs 0.6.1, it was maintained for PHP versions 7.0 and 7.1.

Until PhpTabs 0.6.0, it was maintained for PHP versions 5.4, 5.5, 5.6 and HHVM.

---

Installation
------------

[](#installation)

### Composer

[](#composer)

```
composer require stdtabs/phptabs
```

### Alternative

[](#alternative)

Download and extract an archive from

Then add this PHP line before usage:

```
// Use standalone bootstrap
require_once 'src/PhpTabs/bootstrap.php';
```

---

Testing
-------

[](#testing)

To run tests, you should install PHPUnit first.

```
composer require phpunit/phpunit
```

Then run the test suite with:

```
vendor/bin/phpunit
```

---

Basic Usage
-----------

[](#basic-usage)

```
require_once 'src/PhpTabs/bootstrap.php';

use PhpTabs\PhpTabs;

// Instanciates a tablature
$tablature = new PhpTabs("mytabs.gp3");

// Reads information
echo $tablature->getName();
```

---

Methods
-------

[](#methods)

### Accessing metadata

[](#accessing-metadata)

---

#### getName()

[](#getname)

**Type** *string*

The name of the song.

**Example**

```
$tablature->getName();
```

---

#### getArtist()

[](#getartist)

**Type** *string*

The interpreter of the song.

**Example**

```
$tablature->getArtist();
```

---

#### getAlbum()

[](#getalbum)

**Type** *string*

The name of the album.

**Example**

```
$tablature->getAlbum();
```

---

#### getAuthor()

[](#getauthor)

**Type** *string*

The author of the song.

**Example**

```
$tablature->getAuthor();
```

---

#### getCopyright()

[](#getcopyright)

**Type** *string*

The copyright of the song.

**Example**

```
$tablature->getCopyright();
```

---

#### getWriter()

[](#getwriter)

**Type** *string*

The songwriter.

**Example**

```
$tablature->getWriter();
```

---

#### getComments()

[](#getcomments)

**Type** *string*

The tablature comments. They are compounded of several lines separated by a line break (`PHP_EOL`).

**Example**

```
$tablature->getComments();
```

---

#### getTranscriber()

[](#gettranscriber)

**Type** *string*

Person who has transcribed tablature

**Support**

Guitar Pro &gt;= 4

**Example**

```
$tablature->getTranscriber();
```

---

#### getDate()

[](#getdate)

**Type** *string*

Date when tablature has been transcribed

**Support**

Guitar Pro &gt;= 4

**Example**

```
$tablature->getDate();
```

---

### Accessing tracks

[](#accessing-tracks)

---

#### countTracks()

[](#counttracks)

**Type** *integer*

The number of tracks

**Example**

```
$tablature->countTracks();
```

---

#### getTracks()

[](#gettracks)

**Type** *array*

An array of Track objects

There is one track object for each instrument of the song.

**Example**

```
$tablature->getTracks();
```

---

#### getTrack($index)

[](#gettrackindex)

**Type** *object*

**Parameter** *integer* $index

The music sheet for one instrument.

**Example**

```
// Get the first track
$tablature->getTrack(0);
```

---

### Accessing channels

[](#accessing-channels)

---

#### countChannels()

[](#countchannels)

**Type** *integer*

The number of channels

**Example**

```
$tablature->countChannels();
```

---

#### getChannels()

[](#getchannels)

**Type** *array*

An array of Channel objects

There is one channel object for each track of the song.

**Example**

```
$tablature->getChannels();
```

---

#### getChannel($index)

[](#getchannelindex)

**Type** *object*

**Parameter** *integer* $index

The instrument and sound parameters for one track.

**Example**

```
// Get the first channel
$tablature->getChannel(0);
```

---

### Accessing instruments

[](#accessing-instruments)

---

#### countInstruments()

[](#countinstruments)

**Type** *integer*

The number of instruments

**Example**

```
$tablature->countInstruments();
```

---

#### getInstruments()

[](#getinstruments)

**Type** *array*

A list of instrument arrays

```
array(
  'id' => ,
  'name' =>
)
```

**Example**

```
$tablature->getInstruments();
```

---

#### getInstrument($index)

[](#getinstrumentindex)

**Type** *array*

**Parameter** *integer* $index

An instrument array

```
array(
  'id' => ,
  'name' =>
)
```

**Example**

```
// Get the first instrument
$tablature->getInstrument(0);
```

---

### Accessing measure headers

[](#accessing-measure-headers)

---

#### countMeasureHeaders()

[](#countmeasureheaders)

**Type** *integer*

The number of measure headers

**Example**

```
$tablature->countMeasureHeaders();
```

---

#### getMeasureHeaders()

[](#getmeasureheaders)

**Type** *array*

An array of MeasureHeader objects

**Example**

```
$tablature->getMeasureHeaders();
```

---

#### getMeasureHeader($index)

[](#getmeasureheaderindex)

**Type** *object*

**Parameter** *integer* $index

Measure header contains global informations about the measure.

**Example**

```
// Get the first measure header
$tablature->getMeasureHeader(0);
```

---

### Saving data

[](#saving-data)

---

#### save($filename)

[](#savefilename)

**Type** *bool*

**Parameter** *string* $filename

This method records data as binary to the disk or buffer. It implicitly converts filetype if the specified file extension is different from the original (see examples below).

Following parameters are allowed:

ParameterTypeDescriptionfilename.ext*bool*A file\_put\_contents() return**Example**

```
// Instanciate a GP3 tab
$tab = new PhpTabs('mytab.gp3');

// Save as GP3
$tab->save('newfile.gp3');

// Convert and save as GP5
$tab->save('newfile.gp5');
```

---

#### convert($type)

[](#converttype)

---

**Type** *string*

**Parameter** *string* $type

This method returns data as a binary string into a specified format.

Following formats are allowed:

ParameterTypeDescriptionnull*string*A binary string, original formatgp3*string*A binary string, GP3 formattedgp4*string*A binary string, GP4 formattedgp5*string*A binary string, GP5 formattedmid*string*A binary string, MIDI formattedmidi*string*A binary string, MIDI formatted**Example**

```
// Instanciate a GP3 tab
$tab = new PhpTabs('mytab.gp3');

// Convert as GP3
echo $tab->convert('gp3');

// Convert as GP5
echo $tab->convert('gp5');

// Convert as MIDI
echo $tab->convert('mid');

// Render as original format
// Should be equal as file_get_contents('mytab.gp3')
echo $tab->convert();
```

A lot more examples on [PhpTabs Manual](https://phptabs.readthedocs.io/).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 99.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~174 days

Recently: every ~279 days

Total

17

Last Release

922d ago

Major Versions

0.6.4 → 1.0.02020-11-22

PHP version history (5 changes)v0.1.0PHP &gt;=5.4.0

0.2.0PHP &gt;=5.4.0 || ^7.0

0.6.1PHP ^7.0

0.6.2PHP &gt;=7.2

1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/04ee1be59b281d31a2d48077a359052060f53baf7409cd1be97fe54ad4e7eb51?d=identicon)[landrok](/maintainers/landrok)

---

Top Contributors

[![landrok](https://avatars.githubusercontent.com/u/3310446?v=4)](https://github.com/landrok "landrok (676 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")[![motniemtin](https://avatars.githubusercontent.com/u/23047848?v=4)](https://github.com/motniemtin "motniemtin (2 commits)")

---

Tags

chordsguitarguitar-proguitar-tablaturemidi-parsermusictablaturemusictabsmidiguitartablature

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stdtabs-phptabs/health.svg)

```
[![Health](https://phpackages.com/badges/stdtabs-phptabs/health.svg)](https://phpackages.com/packages/stdtabs-phptabs)
```

###  Alternatives

[kartik-v/bootstrap-tabs-x

Extended Bootstrap Tabs with ability to align tabs in multiple ways, add borders, rotated titles, and more.

1021.4M1](/packages/kartik-v-bootstrap-tabs-x)[kartik-v/yii2-tabs-x

A supercharged Bootstrap tabs widget with ability to align tabs in multiple ways, add borders, rotated titles, and more.

301.4M21](/packages/kartik-v-yii2-tabs-x)[digital-creative/resource-navigation-tab

Organize your resource fields into tabs.

78150.5k](/packages/digital-creative-resource-navigation-tab)[drsdre/yii2-wizardwidget

Multi step wizard widget using tabs to guide a user through steps to complete a task. Based on the Form wizard (using tabs) from lukepzak (see http://bootsnipp.com/snippets/featured/form-wizard-using-tabs).

37149.1k](/packages/drsdre-yii2-wizardwidget)[colinodell/indentation

Library to detect and manipulate indentation in strings and files

3913.1k7](/packages/colinodell-indentation)[vildanbina/livewire-tabs

Laravel Livewire Tab Form component

505.1k](/packages/vildanbina-livewire-tabs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
