Learn how to convert any guitar pro tab file to the midi format using MuseScore 3 from the command line.

How to convert any Guitar Pro Tab file (GP, GP3, GP5, GPX) to Midi from the command line using MuseScore 3

Guitar Pro is a tool that allows you to edit your music scores and tablature for guitar, bass, and ukulele, as well as create backing tracks for drums or piano. I used to work with this tool when I was just a kid and tried to learn how to play some songs using chords on my guitar as the tool showed you where to place your fingers and so on. As of today, there are multiple uses for this kind of file, like obtaining the MIDI version of the tab to play in special players.

In this short article, I will explain to you how to easily convert a Guitar Pro tab file to midi using MuseScore 3 in the command line.

1. Download and install MuseScore 3

The first thing you gotta do is to install MuseScore on your computer. You can download MuseScore from the official website here. Run the MSI installer and follow the installation wizard:

MuseScore Installation

After finishing the installation, you should be able to find all the resources of the software in the default directory c:\Program Files\MuseScore 3 (unless you've changed it).

2. Download a GuitarPro Tab

To follow this tutorial you will need a guitar pro tab file to convert to its MIDI format. You can download a test Guitar Pro file from this website if you need one. In our case, we will use the song Poison Heart by The Ramones (poison-heart-3_ramones-the.gp5).

3. Convert tab to midi

Launch a new command prompt window and change the current directory to the bin directory of MuseScore 3. In our case we will switch to the default directory with the following command:

cd "c:\Program Files\MuseScore 3\bin"

Now that you are in the binaries directory of MuseScore you will be able to use the MuseScore3 executable. The command to convert a guitar pro tab file to midi using the command line is the following one:

MuseScore3.exe <input-guitarpro-file.gp5> -o <output-midi-file.mid>

As you can see, the command receives as the first positional argument the absolute path to the Guitar Pro tab file that you want to convert to midi and then the -o (output) option that expects the output directory of the file that will be generated. The format is determined by the extension of the file, so using .mid or .midi will generate a MIDI file. The valid extensions for output files are:

  • flac: Free Lossless Audio Codec (compressed audio)
  • metajson: various score metadata (JSON)
  • mid: standard MIDI file
  • midi: standard MIDI file
  • mlog: internal file sanity check log (JSON)
  • mp3: MPEG Layer III (lossy compressed audio)
  • mpos: measure positions (XML)
  • mscx: uncompressed MuseScore file
  • mscz: compressed MuseScore file
  • musicxml: uncompressed MusicXML file
  • mxl: compressed MusicXML file
  • ogg: OGG Vorbis (lossy compressed audio)
  • pdf: portable document file (print)
  • png: portable network graphics (image) — Individual files, one per score page, with a hyphen-minus followed by the page number placed before the file extension, will be generated.
  • spos: segment positions (XML)
  • svg: scalable vector graphics (image)
  • wav: RIFF Waveform (uncompressed audio)
  • xml: uncompressed MusicXML file

The following example shows how to convert them using the absolute path of the input file and the output:

MuseScore3.exe "C:\Users\sdkca\Downloads\poison-heart-3_ramones-the.gp5" -o "C:\Users\sdkca\Downloads\poison-heart.mid"

Happy coding ❤️!


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors