我正在写一个快速的前端来显示吉他平台。前端在Flash中,但我想以某种人类可读格式存储标签。有人知道已经存在的东西吗?关于如何去的任何建议?我从阅读某些stackoverflow帖子中获得的一个想法是使用STON SO:

的严格ascii标签格式
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---
.

它有优势。我可以从结构中获得大量信息(有多少字符串,他们的调整,笔记的相对放置),但它是有点冗长的。我猜测' - 在送线时,'-'s会很好地压缩。

如果有人知道用于描述吉他标签的现有数据格式,我也会看看。

编辑:

我应该注意到我的格式为90%,也可能是除了自己以外的任何人。我想要一个简单的方法来编写选项卡文件,最终将显示为闪光前端中的图形,我不想写入编辑器前端。

有帮助吗?

解决方案

查看 ascii选项卡格式。此格式的很好描述在这里:

http://www.howtoreadguitartabs.net/

其他提示

ASCII导出将是一个很棒的功能,但是使用ASCII作为内部数据格式并不是一个好主意。例如,注意持续时间非常难以表达(侯会储存32个甚至16个?,更不用说三胞胎......),因此解析这些文件将非常困难。此外,用户将被诱惑加载应用程序外部创建的ASCII文件,这可能会失败。

总结,我建议尝试重复使用现有格式或者如果这是不可行的,则会发明自己的格式。您可能会尝试使用XML。

编辑:在dguitar旁边,我知道Tuxguitar和Kguitar,支持吉他专业文件。您可以调查他们的来源或向他们的作者询问关于文件格式。我认为还有开源powertab-to-ascii转换器。

支持的文件格式在tuxguitar

tuxguitar 是用于读取,写作和播放吉他标签的开源多平台软件。

它支持提到的吉他pro powertab 格式,它也有自己的 tuxguitar (.tg)格式。

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.

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.

The Guitar Pro 4 format is described here http://dguitar.sourceforge.net/GP4format.html

I wrote a quick utility for displaying tab. For personal use. You can happily take the internal format I used.

I use a very simple string based format. There are three important structures.

Column, a vertical column in the output tab - all notes played simultaneously. Bar, a collection of Columns Motif, a collection of Bars

A Column looks like ':#|:#|*:#' where each * is a string number and each # is a fret number. If you are playing a chord you separate each string:fret with a '|'

A Bar looks like '[,,-,*]' where each * is a Column. A - indicates an empty column where no notes are played.

A Motif looks is just many Bars running back to back. For instance

"[1:5,-,3:7,-,3:5,-,3:7,-,-,3:5,3:7,-,1:8,-,1:5]"

    e||---------------|---------------||
    B||---------------|---------------||
    G||---------------|---------------||
    D||--7-5-7--57----|--7-5-7--57----||
    A||---------------|---------------||
    E||5-----------8-5|5-----------8-5||


"[-,-,1:3|2:2|3:0|4:0|5:3|6:3,-,-][-,-,3:0|4:2|5:3|6:2,-,-]"

   e||--3--|--2--||
   B||--3--|--3--||
   G||--0--|--2--||
   D||--0--|--0--||
   A||--2--|-----||
   E||--3--|-----||
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top