Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread David Kastrup
Urs Liska  writes:

> Hi Malte, David,
>
> thank you for your suggestions.
>
>
> Am 21.03.2018 um 15:43 schrieb David Kastrup:
>> Urs Liska  writes:
>>
>>> Hi all,
>>>
>>> ...
>>>
>>>
>>> So is there a convenient way to write a pitch within a Scheme expression?
>> Like usual with quoting.
>>
>> transposition = #`( ,#{ d' #} . "D")
>>
>> Or even without quoting:
>>
>> transposition = #(cons #{ d' #} "D")
>>
>> But frankly: I'd use separate variables instead.
>>
>
> Indeed, now that I see it this really isn't an option. Probably I'll
> rather change the other end of the rope and don't treat the data as a
> pair internally at all.

Or

transposed =
#(define-scheme-function (p m) (ly:pitch? markup?) (cons p m))

transposition = \transposed d' "D"

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread Urs Liska

Hi Malte, David,

thank you for your suggestions.


Am 21.03.2018 um 15:43 schrieb David Kastrup:

Urs Liska  writes:


Hi all,

...


So is there a convenient way to write a pitch within a Scheme expression?

Like usual with quoting.

transposition = #`( ,#{ d' #} . "D")

Or even without quoting:

transposition = #(cons #{ d' #} "D")

But frankly: I'd use separate variables instead.



Indeed, now that I see it this really isn't an option. Probably I'll 
rather change the other end of the rope and don't treat the data as a 
pair internally at all.


Thanks again
Urs

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread David Kastrup
Urs Liska  writes:

> Hi all,
>
> I have a with block where I would like to let the user enter a pair as
> a value, and one of the elements of the pair should be a pitch.
>
> Something like:
>
> \with {
>   transposition = #'( d' . "D")
> }
>
> But this doesn't work, just like
>
>   transposition = #'( #{ d' #} . "D")
>
> What I currently do is have them write
>
>   transposition = d'
>   transposition-label = D
>
> and cons them together within the function. This works but is inconsistent.
>
> So is there a convenient way to write a pitch within a Scheme expression?

Like usual with quoting.

transposition = #`( ,#{ d' #} . "D")

Or even without quoting:

transposition = #(cons #{ d' #} "D")

But frankly: I'd use separate variables instead.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: How to write a ly:pitch? as element of a pair?

2018-03-21 Thread Malte Meyn



Am 21.03.2018 um 15:28 schrieb Urs Liska:

Hi all,

I have a with block where I would like to let the user enter a pair as a 
value, and one of the elements of the pair should be a pitch.


Something like:

\with {
   transposition = #'( d' . "D")
}

But this doesn't work, just like

   transposition = #'( #{ d' #} . "D")


How about #`( ,#{ d' #} . "D") ?

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user