Any documentation about the ptab file format?

Showing 1-5 of 5 messages
Any documentation about the ptab file format? Artran 1/28/06 4:19 AM
Hi,
I'm interested in writing a Java application which can read ptab files.
Is there any documentation about the format? It's a long time since I
wrote any C so I'd struggle with reading the source code but I'll do
that if it's the only option.

Anything that I produce will be offered back to the community.

Regards,
Ray Tran

Re: Any documentation about the ptab file format? Dummy 1/28/06 4:59 PM

Power Tab File Header Info

Little Endian Byte Ordering

 

Data Types Used

DWORD - unsigned integer, 4 bytes

WORD - unsigned short, 2 bytes

BYTE - unsigned char, 1 byte

CString - Microsoft String - 1, 3 or 7 bytes = length of string, followed by the string itself

 

In order to optimize space, the length is stored using variable lengthed types.  If the length of the string is < 255 (hex = 0xff), the length is stored as a BYTE.  If the length is < 65535 (hex = 0xffff), the length is stored in a WORD that follows the first BYTE.  Otherwise the length is stored as a DWORD that follows the first BYTE and WORD.

 

Sample Code:

 

UINT ReadStringLength()

{

          // attempt BYTE length first

          BYTE bLen;

          ReadByte(bLen);

 

          // If length is not 0xff (255), then we've got the length, otherwise keep reading

          if (bLen < 0xff)

                   return bLen;

 

          // attempt WORD length

          WORD wLen;

          ReadWord(wLen)

 

          // If length is not 0xffff(65535), then we've got the length, otherwise keep reading

          if (wLen < 0xffff)

                   return wLen;

 

          // read DWORD of length

          DWORD dwLen;

          ReadDWord(dwLen);

         

          return (UINT)dwLen;

}

 

 

Header Format: Read the header variables in the following order

 

Variable

Size

Description

Values

File Tag

DWORD

Tag that uniquely identifies a Power Tab file

should always be 1650553968

File Version

WORD

Version # for the file (the version of the program that saved the file; since every file format is different, it's also the version of the program needed to read the file)

0 - Unknown,

1 - v1.0

2 - v1.0.2

3 - v1.5

4 - v1.7

 

If File Version = v1.7

File Type

BYTE

The type of Power Tab file

0 - Song

1 - Lesson

If File Type = Song then

File Contents

BYTE

Type of score contents contained in the file

If bit 1 set, contains Guitar Score data.

If bit 2 set, contains Bass Score data.

Song Title

CString

Title of the song

 

Artist

CString

Artist who performed song

 

Release Type

BYTE

Type of release for the song

0 - Public Audio

1 - Public Video

2 - Bootleg

3 - Not Released

If Release Type = Public Audio then

Album Type

BYTE

Type of album

0 - Single

1 - EP

2 - LP

3 - Double LP

4 - Triple LP

5 -  Boxset

Album Title

CString

Title of the album

 

Year

WORD

Year album was released

 

Live

BYTE

Was the song live?

0 - No

1 - Yes

else if Release Type = Public Video

Video Title

CString

Title of the video

 

Live

BYTE

Was the song live?

0 - No

1 - Yes

else if Release Type = Bootleg

Bootleg Title

CString

Title of the bootleg

 

Month

WORD

Month bootleg was recorded

 

Day

WORD

Day bootleg was recorded

 

Year

...
Re: Any documentation about the ptab file format? Ray Tran 1/29/06 1:42 AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks for that, it should save me some time. I'll let you know how I  
get on.
On 29 Jan 2006, at 00:59, Dummy Account wrote:

> The only documentation I have is for the header, which I've  
> attached. The rest you'll have to figure out using the code.>> <Power Tab File Header Info.htm>

- --
Ray Tran

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFD3I4VoKSI/kIogUgRAieEAJwKQuxxHUslSZUv+0Rbum8jPSqOfQCcDIhi
h0TJmEz7baVLtBRsn0OY9Qo=
=HTL9
-----END PGP SIGNATURE-----

Re: Any documentation about the ptab file format? nickk 2/14/06 7:49 PM
Hi,

Does anyone have the format specification handy?
ie - how does the file actually describe the SONG, not just the header
info..that would be an enormous. help.

I'm working on a genetic algorithm to translate 5-bar sheet music to
6-bar guitar tablature, and I would love to use powertab. Thanks in
advance.

Nickk

Re: Any documentation about the ptab file format? Ray Tran 2/16/06 1:15 AM
Hi,
I've been working on understanding the file format too. I have been  
reading the source code and trying to relate that to the bytes that I  
can see in the file. I have the beginnings of a structure diagram but  
it's nowhere near complete, or even much use, at the moment. I've  
attached it for you but I'm not sure if you'll get much from it.

There is a tex document on the net with the structure described. And  
you may find some useful info looking around the site that it is on.  
The document is here: http://jelmer.vernstok.nl/oss/ptabtools/svn/
trunk/format.tex . The author wrote some tools for reading various  
music files. His description of the string representation isn't quite  
right but the rest of the stuff looks ok.

I hope that's some help.

On 15 Feb 2006, at 03:49, nickk wrote:

>
> Hi,
>
> Does anyone have the format specification handy?
> ie - how does the file actually describe the SONG, not just the header
> info..that would be an enormous. help.
>
> I'm working on a genetic algorithm to translate 5-bar sheet music to
> 6-bar guitar tablature, and I would love to use powertab. Thanks in
> advance.
>
> Nickk
>
>
> Ray Tran wrote:
>>
>> Thanks for that, it should save me some time. I'll let you know how I
>> get on.
>> On 29 Jan 2006, at 00:59, Dummy Account wrote:
>>
>>> The only documentation I have is for the header, which I've
>>> attached. The rest you'll have to figure out using the code.
>>>
>>>>
>>>> Hi,
>>>> I'm interested in writing a Java application which can read ptab
>>>> files.
>>>> Is there any documentation about the format? It's a long time  
>>>> since I
>>>> wrote any C so I'd struggle with reading the source code but  
>>>> I'll do
>>>> that if it's the only option.
>>>>
>>>> Anything that I produce will be offered back to the community.
>>>>
>>>> Regards,
>>>> Ray Tran
>>>> <Power Tab File Header Info.htm>
>>
>> - --
>> Ray Tran
>>

Cheers,
--
Ray Tran