cknadler / marktab-c

Concise, machine readable guitar tabs
MIT License
36 stars 7 forks source link

Add optional config header to grammar #9

Closed cknadler closed 9 years ago

cknadler commented 12 years ago

marktab needs an optional header that allows you to configure miscellaneous parts of the tab.

Currently running with the idea preceding each config line with a #.

# strings: 7
# tuning: B E A D G b e

defaults:

# strings: 6
# tuning: E A D G B e
cknadler commented 12 years ago

Another idea for this would be to have bass and guitar modes for marktab to parse.

Type: bass would default to Strings: 4 and Tuning: E A D G.

cknadler commented 11 years ago

New take on this issue:

Config header should be YAML:

---
strings: 7
tuning: B E A D G b e
import: some_chords.mt
---
russplaysguitar commented 11 years ago

For easier parsing?

cknadler commented 11 years ago

Yes, and it stands out better, to me at least. The --- is pretty universally YAML while the # means comment in ruby. So, in the grammar, I changed --- to indicate a config header and # to be a comment. I'm going to remove the c-style comments as well.

cknadler commented 11 years ago

Adding a new config option:

line_length: 80 #default

That brings us to:

---
strings: 6
tuning: E A D G B e
import: stdlib.mt
line_length: 80
---
cknadler commented 11 years ago

For the first implementation of the parser, I have a few changes I want to make to the conf header.

Strings and Tuning

These two are redundant. By declaring what tuning you are using, you are inherently telling MarkTab how many strings have.

I think that removing the strings option altogether is the easiest.

Import

A stdlib of chords would be awesome, but slightly beyond the scope of the first implementation. For now, I'm leaving this out.

Revised Conf Options

tuning: E A D G B e
line_length:  80

Much simpler.

<3 <3 <3

russplaysguitar commented 11 years ago

:ok_hand: