lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom key signature stencils, differentiating major and minor keys


From: Thomas Morley
Subject: Re: Custom key signature stencils, differentiating major and minor keys
Date: Wed, 5 Dec 2012 23:58:52 +0100

Sorry to send this again, forgot to cc the list.

2012/12/5 Thomas Morley <address@hidden>:
> 2012/12/5 Paul Morris <address@hidden>:
>> On Dec 4, 2012, at 7:27 PM, Thomas Morley <address@hidden> wrote:
> [...]
>>> May I ask, if you could add a commented 2.16-version of it?
>>> Although your code will work for 2.16.1 up to 2.17.6 (so far I
>>> tested), it would be nice to show the new make-engraver-macro and the
>>> possibility of #{ #} in scheme-code, once the LSR is updated.
>>
>> Ok, I just uploaded a new version with the 2.16 code commented out.  The 
>> make-engraver-macro is quite nice.
>
> Thanks for doing this!
>
>>
>> It was a little tricky figuring out the #{ \markup ... #} syntax after 
>> getting used to the scheme version.  If it were not for the need to 
>> demonstrate the new syntax (which I'm happy to help with) I'd probably just 
>> stick with the scheme version at this point.
>
> I know what you mean. :)
> I tend to use only scheme-syntax in longer scheme-expressions.
> It's nice to show #{ #}, though.
>
>> I eventually got it working in all cases, but had to move the accidental 
>> markups into variables
>
> Well, I do like variables. :)
>
>> to avoid too much nesting, which wasn't working.  Namely this part:
>>
>>           (if (pair? tonic-acc)
>>             (set! key-name (markup key-name (if (= acc-type 0.5 )
>>               (markup #:translate (cons (* mult -0.3) (* mult 0.8)) 
>> #:magnify (* mult 0.9) #:sharp)
>>               (markup #:translate (cons (* mult -0.2) (* mult 0.4)) 
>> #:magnify (* mult 0.9) #:flat)))))
>>
>> % ----> the following doesn't work:
>>
>>       (if (pair? tonic-acc)
>>         (set! key-name #{ \markup #key-name #(if (= acc-type 0.5 )
>>           #{ \markup { \translate #(cons (* mult -0.3) (* mult 0.8)) 
>> \magnify #(* mult 0.9) \sharp } #}
>>           #{ \markup { \translate #(cons (* mult -0.2) (* mult 0.4)) 
>> \magnify #(* mult 0.9) \flat  } #} ) #} ))
>
> It will work, while adding two braces:
>
> (if (pair? tonic-acc)
>   (set! key-name
>   #{ \markup { % <==========================
>           #key-name
>           #(if (= acc-type 0.5 )
>                #{
>                        \markup {
>                                \translate #(cons (* mult -0.3) (* mult 0.8))
>                                \magnify #(* mult 0.9)
>                                \sharp
>                        }
>                #}
>                #{
>                        \markup {
>                                \translate #(cons (* mult -0.2) (* mult 0.4))
>                                \magnify #(* mult 0.9)
>                                \flat
>                        }
>                #})
>           } % <=============================
>     #}))
>>
>> %----> but this does:
>>
>>           (if (pair? tonic-acc)
>>             (set! key-name #{ \markup { #key-name #(if (= acc-type 0.5 ) 
>> txt-sharp txt-flat ) } #} ))
>>
>>
>> Regards,
>> -Paul
>
>
> Now approved:
> http://lsr.dsi.unimi.it/LSR/Item?id=856
>
> Regards,
>   Harm
>
> P.S.
> I cc-ed the list, because I think it might be of interest for all.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]