cknadler / marktab-c

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

Modifiers must be special characters #35

Closed cknadler closed 11 years ago

cknadler commented 11 years ago

When you take symbols out of the grammar, you can put modifiers wherever you want.

1:1*

# or
1:1 *

They apply to the left, spaces dont matter. Everything is good.

When you introduce symbols, things break. This is because of the "palm mute" modifier, currently represented as m in the grammar. This is problematic because "m" is also a part of the symbol matching production.

Example:

chord: (1:1 2:1 3:1)

chordm

I want to palm mute that chord, but the parser is going to grab that all as one single symbol.

The easiest way to fix this is to pick a special character and change the palm mute to it. Currently, I like the idea of changing it to be _. The underscore rests right on the bottom of the line, similar to resting your palm on the strings. Also, it is one of the few symbols that are not already being used.

Example:

chord: (1:1 2:1 3:1)

chord_
russplaysguitar commented 11 years ago

Why not wrap the symbol in parenthesis when the special case arises that you want to palm mute the symbol? (chord)m

Using something other than m for palm mute makes it just that much harder to learn the syntax.

cknadler commented 11 years ago

That solution is including a special case that the user would have to learn about the langage. It may make sense because you are familiar with the implementation but it is unintuitive. Why should the modifier have to be applied in a different way specially when it comes to symbols?

I would argue that that is much more important to have modifiers behave the same throughout the grammar than to have the modifier syntax for palm muting be m.

Ignoring my above arguments though, on a basic level I agree. The m makes more sense for muting than a _. Sadly, it's not possible to just have the plain m. Changing the symbol to something else, Gmaj_ is going to be easier to write than [Gmaj]m.

What I'm trying to get across is that as long as the grammar is reasonable, it shouldn't matter if every symbol is the same as guitar tab syntax. The purpose for marktab is to write tabs fast. Anyone learning it is already going to have to learn what each of the tokens do. Making the tokens the same as guitar tab syntax is great, but only if it doesn't make the language itself more confusing or less intuitive.

russplaysguitar commented 11 years ago

Why isn't using spacing an option? chord m ?

I'm a big fan of elegance, but not at the expense of ease-of-use.

cknadler commented 11 years ago

Because spacing is optional with the other modifiers. I also completely agree with that statement.

Sent from my iPhone

On Jan 19, 2013, at 2:21 PM, Russ notifications@github.com wrote:

Why isn't using spacing an option? chord m ?

I'm a big fan of elegance, but not at the expense of ease-of-use.

— Reply to this email directly or view it on GitHub.