RFC: Add support for exporting in text format
I don't have Guitar Pro, but I do have notepad! For anyone else in the same boat as me, this will export songs in good ol' text format, similar to the following.
Not sure if you're interested in the feature, but I thought I'd offer it up anyway. It supports displaying hammer ons, pull offs, bends, slides, and palm muting; others embelishments should be pretty easy to add support for in the TxtExporter.ToText method. Still working on cleaning a few things up, but wanted to at least start the discussion.
Thanks building this in the first place!
Title: Libra
Artist: Intervals feat. Plini
Album: The Shape of Color
Generated by RocksmithToTab v1.1
=> http://www.rocksmithtotab.de
Created from archive: Intervals_Libra_v1_2_DD_p.psarc
CDLC author: albatross213
CDLC version: 1.2
===== Rhythm =====
A#sus2 F3 F5 A#5 Dsus4 D5 A#5 A#sus2 Fsus2 D5 Dmin7/G A#5 F G5
e: - - - - - - - - - - - 5 - -
B: - - - - - - 3 11 - - - 6 11 -
G: 10 - - - - 0 2 10 - - - 5 10 -
D: 10 7 5 3 8 0 0 8 10 5 0 7 8 10
A: 8 8 5 3 8 0 0 8 8 3 0 5 8 8
D: 8 7 5 3 8 0 0 8 8 3 0 5 8 7
A#sus2 A#sus2 A#sus2 Fsus2
e|----|----|----------------|--------------------------|-----------------------|----------------------------|
B|----|----|----------------|--------------------------|-----------------------|----------------------------|
G|----|----|----10-10-10-10-|--------------------------|-----------------------|--------5/7-----------------|
D|----|----|----10-10-10-10-|--10-10-10-10-10-10-10-10-|--10\----5-5-5-5-------|----------------------------|
A|----|----|-----8--8--8--8-|---8--8--8--8--8--8--8--8-|---8\----3-3-3-3-------|--0-----3/5-----------------|
D|----|----|-----8--8--8--8-|---8--8--8--8--8--8--8--8-|---8\----3-3-3-3-3/5h8-|----3-0-----(0)-(0)-(0)-(0)-|
Dmin7/G Dmin7/G
e|--5-5-5-5-5-5-5-5-|--5/------12-12-12-12-12-12-12-|--12-----------------------|-------------------------|
B|--6-6-6-6-6-6-6-6-|--6/------13-13-13-13-13-13-13-|--13-----------------------|-------------------------|
G|--5-5-5-5-5-5-5-5-|--5/------12-12-12-12-12-12-12-|--12-----------------------|-------------------------|
D|--7-7-7-7-7-7-7-7-|--7/------15-15-15-15-15-15-15-|--15-----------------14\-8-|--------------10p0-------|
A|--5-5-5-5-5-5-5-5-|--5/------12-12-12-12-12-12-12-|--12-8----------(12)-------|--8----------------10h12-|
D|--5-5-5-5-5-5-5-5-|--5/------12-12-12-12-12-12-12-|--12---7-0-(10)------------|----7-(0)-(7)------------|
Very nice! I am interested in the feature, but due to the availability of free alternatives to Guitar Pro, it has never reached a high enough priority for me to actually implement it. So thanks for contributing :)
If it's alright with you, I'll leave it open for a while until I have the time to actually work on RocksmithToTab again, but I'm very interested to merge this eventually :)
Sounds like a plan, glad it's appreciated!
Ok, I feel a lot better about this code. Let me know if there's anything else I should be supporting!
I had a quick look now. Code looks fine to me, using yield generator functions is a nice touch :) I found two bugs you might want to look into, other than that I'll happily accept the pull request targeted at some future version 2.0. As for the bugs:
-
The output seems to swallow whole bars. For example, in "Foo Fighters - Everlong (Combo 1)" there is a bar missing at the end of every line, far as I can tell. I didn't look closely at other songs, but if that's the pattern, it might be an easy fix :)
-
Again in Everlong, there are some inconsistencies in the printed chord names. For example, in the second bar on the forth row it prints DMaj4, even though the chord is the same as in the previous bar, where it was labeled B5(add9). I think this might actually be related to the first bug.
One thing I notice that your program doesn't do is take note lengths into account. I totally understand why you don't, because it is a very non-trivial problem to do that correctly, but ultimately I would want to see proper rhythm in the output. Perhaps you are interested in working on that, but it's also fine if you aren't - I may investigate this myself :) Either way, it's an improvement for the future, after this pull request.
Thanks for the feedback! Let me see what I can do about those.
I noticed the lack of rhythm too, but not quite sure what to do about it. I'll play with a few ideas though.
I looked at how Guitar Pro 5 is generating ASCII tabs, and though I didn't look at all possible edge cases, I think the basics work like this:
- There is an additional line above the bars which states the note value, e.g. e for eighth, s for sixteenth, Q for quarter, H for half etc..
- The shortest note value in the bar is followed by a single dash (-), whereas longer notes have more in scale.
- If a note has attached information (like chord names) which make it require more space, additional dashes are appended, but are otherwise ignored (i.e. other notes do not get additional dashes because of it). Note decorations (hammer ons, pull offs, slides, ...) do not influence the spacing.
I think the first one could be a good place to start and should be relatively straight-forward to add with the code you've already written. Getting the spacing "right" is then just visual sugar, but not absolutely required :)