|
|
Created:
13 years, 11 months ago by Bertrand Bordage Modified:
13 years, 9 months ago CC:
lilypond-devel_gnu.org Visibility:
Public. |
DescriptionFattens the 256 first braces.
Patch Set 1 #
Total comments: 1
Patch Set 2 : Save variables #
Total comments: 4
Patch Set 3 : Cleans function (thanks to dak) #Patch Set 4 : Cleans code #MessagesTotal messages: 14
LGTM, with a small nitpick. I like the new braces better. Carl http://codereview.appspot.com/4518052/diff/1/mf/feta-braces.mf File mf/feta-braces.mf (right): http://codereview.appspot.com/4518052/diff/1/mf/feta-braces.mf#newcode148 mf/feta-braces.mf:148: fatten_factor := 1.5; I think that good practice would have you do a save when you define a new variable, so you won't override it if it's defined elsewhere in the file. Using save creates a local variable.
Sign in to reply to this message.
Thanks for the review ! Patch updated. I don't know if there's a better way to solve this issue. As big braces look good, I decided to limit the changes to the smallest ones.
Sign in to reply to this message.
LGTM, apart from one nitpick. I much prefer your redesigned braces! Trevor http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf File mf/feta-braces.mf (right): http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf#newcode150 mf/feta-braces.mf:150: save fatten; I don't think this placement of the save causes any problems, but wouldn't be neater to place it outside the loop with the other save commands?
Sign in to reply to this message.
http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf File mf/feta-braces.mf (right): http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf#newcode150 mf/feta-braces.mf:150: save fatten; That's what I thought at first. Then I saw "save number;" line 129, so I decided to put this here.
Sign in to reply to this message.
If you say you fatten the first 256 braces, does that mean that there is a jump in thickness when going from the 256th to the 257th brace? In that case, would it not be better to have a smoother transition rather than a jump? Metafont is good at curves, after all...
Sign in to reply to this message.
2011/5/11 <dak@gnu.org>: > If you say you fatten the first 256 braces, does that mean that there is > a jump in thickness when going from the 256th to the 257th brace? Is it a joke? -- Francisco Vila. Badajoz (Spain) www.paconet.org , www.csmbadajoz.com
Sign in to reply to this message.
2011/5/11 Francisco Vila <paconet.org@gmail.com>: > 2011/5/11 <dak@gnu.org>: >> If you say you fatten the first 256 braces, does that mean that there is >> a jump in thickness when going from the 256th to the 257th brace? > > Is it a joke? Oh, of course it is. Sorry :*) -- Francisco Vila. Badajoz (Spain) www.paconet.org , www.csmbadajoz.com
Sign in to reply to this message.
I don't know if this is a joke, so I answer to David's question : of course there is no jump between the 256th and the 257th ! Refer to this message to see before/after : http://lists.gnu.org/archive/html/lilypond-devel/2011-05/msg00150.html
Sign in to reply to this message.
http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf File mf/feta-braces.mf (right): http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf#newcode151 mf/feta-braces.mf:151: fatten := 1 + fatten_factor - min ( number * fatten_factor / 256, fatten_factor); This is a bit obscure to me. How about fatten := min(number/256,1)[1+fatten_factor,1]; That makes it more obvious that the factor is running from 1+fatten_factor to 1. There does not seem to be much point in using min, either, regarding clarity. So maybe the whole thing can be written as if number<256: x := x*(number/256[1+fatten_factor,1]); fi However, "fatten_factor" sounds like a _factor_, so it would make more sense to change it to 2.5 (is that really the intended value? Seems really large!) and write this as if number<256: x := (number/256)[x*fatten_factor,x]; fi I think that expresses the meaning better, even without requiring an extra variable "fatten".
Sign in to reply to this message.
http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf File mf/feta-braces.mf (right): http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf#newcode151 mf/feta-braces.mf:151: fatten := 1 + fatten_factor - min ( number * fatten_factor / 256, fatten_factor); Thanks ! Hum... I agree with your idea of making this clearer. I also agree that my factor isn't really a factor since it's neutral value is 0. But the functions you gave do not produce the correct output. And I can't manage to find something cleaner than what I wrote. Also : we can't get rid of "fatten", as it is also used to thicken the ends of the braces.
Sign in to reply to this message.
On 2011/05/11 09:22:14, Bertrand Bordage wrote: > http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf > File mf/feta-braces.mf (right): > > http://codereview.appspot.com/4518052/diff/2002/mf/feta-braces.mf#newcode151 > mf/feta-braces.mf:151: fatten := 1 + fatten_factor - min ( number * > fatten_factor / 256, fatten_factor); > Thanks ! > Hum... > I agree with your idea of making this clearer. > I also agree that my factor isn't really a factor since it's neutral value is 0. > But the functions you gave do not produce the correct output. > And I can't manage to find something cleaner than what I wrote. > Also : we can't get rid of "fatten", as it is also used to thicken the ends of > the braces. Well, the middle formula was missing parens around number/256. Other than that, it should have worked fine. Something like fatten := min(number/256,1)[1+fatten_factor,1]; should do the trick then.
Sign in to reply to this message.
On 2011/05/11 09:54:36, dak wrote: > Something like > fatten := min(number/256,1)[1+fatten_factor,1]; > should do the trick then. Well, I repeat the suggestion to make fatten_factor neutral at 1 instead of 0 (resulting in omitting 1+ in the above formula), and perhaps instead of hardcoding 256, one could make it a parameter fatten_end or similar.
Sign in to reply to this message.
:) Thanks ! This works great. Updated.
Sign in to reply to this message.
|