views:

81

answers:

5

I'm writing a quick front end to display guitar tablature. The front end is in Flash but I want to store the tab in some human-readable format. Anyone know of something that already exists? Any suggestions on how to go about it? One idea I got from reading some stackoverflow posts was to use a strict ASCII tab format like so:

e||-1------3--------------0--|----2-------0---
B||--1-----3------------1----|----3-------0---
G||---2----0----------0------|----2-------1---
D||----3---0--------2--------|----0-------2---
A||----3---2------3----------|------------2---
E||----1---3----3------------|------------0---

It has advantages. I can gain a lot of info from the structure (how many strings, their tunings, the relative placement of notes) but it is a bit verbose. I'm guessing the '-'s will compress away pretty well when sent over the wire.

If anyone knows of an existing data-format for describing guitar tab I'll take a look as well.

edit:

I should note that this format is 90% for me and may not ever been seen by anyone other than myself. I want an easy way to write tab files that will be displayed eventually as graphics in a Flash front-end and I don't want to have to write an editor front end.

+1  A: 

These are not human readable:

Most common formats are Guitar Pro (proprietary) and PowerTab (freeware). DGuitar and TuxGuitar are open source viewers for Guitar Pro format. I'm sure that they have documentation for the format somewhere (at least in the code).

Advantage for using a common format would be the easiness of making tabs with those programs.

Cloudanger
Thanks, I've come across both of those before but I don't like the idea of getting stuck into a proprietary binary format. Guitar Pro exports to ASCII so maybe I can check how that looks and import something similar. I am not trying to make anything even slightly near as complex as either program.
James Fassett
+1  A: 

ASCII export would be a great feature, but using ASCII as internal data format is not a good idea. For example, note durations would be extremely hard to express (hou would you store 32nds or even 16ths?, not to mention triplets...), so parsing those files would be extremely difficult. Moreover, users would be tempted to load ASCII files created outside your app, which will be likely to fail.

To sum up, i'd recommend to either try to reuse existing format or invent your own if that's not feasible. You may try to use XML for that.

EDIT: Beside DGuitar, i know of TuxGuitar and KGuitar, which support Guitar Pro files. You can look into their sources or ask their authors about file formats. I think there is also open source PowerTab-to-ASCII converter.

el.pescado
+1  A: 

See Supported file formats in TuxGuitar.

TuxGuitar is open-source multiplatform software for reading, writing and playing the guitar tabs.

It supports the mentioned Guitar Pro and PowerTab format, and it also has its own TuxGuitar (.tg) format.

tomp
+1  A: 

Check out the ASCII tab format. Also great description of the format is here:

http://www.howtoreadguitartabs.net/

guitar tab format description (by howtoreadguitartabs.net)

tomp
This is close to what I'm thinking. Thanks. Not sure I'll support any and all tabs since I'll be writing the tabs in question by hand myself but I can try and get the most common slurs and effects in.
James Fassett
A: 

If you need the backend data structure to remain in human readable form I would probably stick it in a CDATA inside of XML. That could be inserted into a relational database with song/artist/title information and become searchable. Another option is to save it as zipped text files and insert links to those files in a database with the main artist info still searchable by sql.

TheImirOfGroofunkistan