http://codereview.appspot.com/335430043
Ticket 5025 https://sourceforge.net/p/testlilyissues/issues/5025/ opened up the possibilty of reversing the order of strings by setting a negative string-distance:
\new FretBoards {
\chordmode {
\override FretBoard.fret-diagram-details.string-thickness-factor = #0.3
c1
\override FretBoard.fret-diagram-details.string-distance = #-1
c1
}
}
Karlin High reported an unwanted side effect of negative string-distance values (see attached image):
The "nut" doesn't properly align with the outer edges of the fretboard.
Reason for misalignment: half-linethickness of the outer strings is effectively being subtracted rather than being added due to the negative sign introduced by the negative string-distance.
Cheerio,
Torsten
Related feature documentation: issue 5263 Document distance of strings and frets
https://sourceforge.net/p/testlilyissues/issues/5263/
Issue 5264: fret diagram nut alignment
This fixes the alignment for negative string-distance.
http://codereview.appspot.com/335430043
Diff:
Hi Malte,
Your fix does the trick - everyting's working as expected now...
I've set a string-thickness-factor in the original coding example in order to ensure that even varying string thicknesses work as expected in spite of the negative string-distance.
Remark: Insted of if clauses, I'd probably just multiply the "half-thicknesses" by (sign string-distance) in order to toggle between + and -.
But that's just a matter of taste... both ways are OK.
How about setting the status to "review"?
Cheerio,
Torsten
This is something done after a "Patch-new" issue has been tested with a standard testing procedure. Usually by James.
Such things can be discussed on Rietveld (see the codereview… link above). There seems to be no signum function (I tried sign, signum, sgn, sig and reading the reference).
Oh, wait - there are obviously more problems than expected...
(landscape mode moves below the baseline, marginal objects (e.g. capo numbers) flip inside the diagram...
Probably we should gerneralize and rename this issue so that it is not only restricted to nut line alignment but generally handles effects caused by negative string-number values.
@Malte: As to the sign function, I'll drop a note at Rietveld.
@DAK: Thanks for the enlightenment and sorry for my naiveness - I'm working on it...
use sign function from lily-library.scm instead of if clause
http://codereview.appspot.com/335430043
I didn’t realise that LilyPond has defined its own sign function. Of course that’s better to read.
Last edit: Malte Meyn 2018-01-18
Diff:
align correctly for different size
http://codereview.appspot.com/335430043
Passes make, make check and a full make doc.
As mentioned on Rietveld a concurrent patch attached.
Ordering strings and frets correctly right from the start, as we already do for 'landscape and 'opposing-landcape.
If we follow this route we should disable negative string-distance.
Regtests/docs are todo
That looks like a way better approch IMO. I’d suggest you take over the issue (change owner & subject, add your patch to Rietveld) or make a new one and mark this one Invalid (?).
Thomas, can you upload a patch as per the normal process for this case (I have made you the current owner as per Malte's suggestion) it will then enter the normal Patch test queue. At this time I have set the call to 'needs work'.
Will do, likely after the weekend, though. Have to work. And the patch needs some additional polish.
I opened a new ticket for code/docs of left-handed fret-diagrams.
https://sourceforge.net/p/testlilyissues/issues/5265/
Closing this one.