Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add support for exporting in text format #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

djeebus
Copy link

@djeebus djeebus commented Sep 5, 2016

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)------------|

@fholger
Copy link
Owner

fholger commented Sep 5, 2016

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 :)

Fixed width and formatting issues
@djeebus
Copy link
Author

djeebus commented Sep 5, 2016

Sounds like a plan, glad it's appreciated!

@djeebus
Copy link
Author

djeebus commented Sep 7, 2016

Ok, I feel a lot better about this code. Let me know if there's anything else I should be supporting!

@fholger
Copy link
Owner

fholger commented Sep 11, 2016

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:

  1. 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 :)

  2. 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.

@djeebus
Copy link
Author

djeebus commented Sep 11, 2016

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.

@fholger
Copy link
Owner

fholger commented Sep 11, 2016

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:

  1. 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..
  2. The shortest note value in the bar is followed by a single dash (-), whereas longer notes have more in scale.
  3. 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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants