I know to add a mimetype I must use a code like that:
<mime-type type="audio/x-gtp">
<comment>GuitarPro file</comment>
<glob pattern="*.gp5"/>
</mime-type>
I know to add a mimetype whose file extension is used for other mimetype I can use magic like that:
<mime-type type="audio/x-gtp">
<magic priority="50">
<match value="BCFZ" type="string" offset="0" />
</magic>
<glob pattern="*.gpx"/>
</mime-type>
This, taking into account that the first 4 characters of the file are printable. I obtained this pattern using xxd. I show you the first four lines of xxd output:
xxd '/home/cactus/Descargas/Billie Eilish - Everything I Wanted.gpx' | head -n 4
00000000: 4243 465a 0420 0500 6848 68cd 4c00 0180 BCFZ. ..hHh.L...
00000010: 0000 4ed7 fdff feff ffff e76d 156a 52d8 ..N........m.jR.
00000020: 516e 142e 0141 7201 00e4 0201 c804 0390 Qn...Ar.........
00000030: 0807 2010 0e40 201c 8040 3900 8072 0100 .. ..@ ..@9..r..
So far, everything works fine.
The problem with this other filetype .gp, whose first characters are not imprimible, I show you the output of the first four xdd lines:
xxd /home/cactus/Descargas/arpeggio.gp | head -n 4
00000000: 504b 0304 1400 0000 0000 0000 0000 0000 PK..............
00000010: 0000 0000 0000 0000 0000 0800 0000 436f ..............Co
00000020: 6e74 656e 742f 504b 0304 1400 0800 0800 ntent/PK........
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
So I don't know how use magic with that type of files, I think the best way would be using hexadecimal code in value, but I don't know how use it.
Thanks for your time.