[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Custom key signature stencils, differentiating major and minor keys
From: |
Paul Morris |
Subject: |
Re: Custom key signature stencils, differentiating major and minor keys |
Date: |
Thu, 6 Dec 2012 09:30:51 -0500 |
On Dec 5, 2012, at 5:58 PM, Thomas Morley <address@hidden> wrote:
> 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!
Glad to help!
>>> 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. :)
Yeah, in this case they were only used once each, so it seemed like overkill to
assign them to variables. Maybe it's clearer that way though.
>>> 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
>> }
>> #})
>> } % <=============================
>> #}))
Argh! The missing braces strike again. I should have caught that. Your
reformatting makes it much easier to follow.
>>> %----> 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.
Thanks again!
-Paul