Macro not working with 2.16

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro not working with 2.16

Alberto Simões-2
Hello

Some time ago (years probably) somebody in this list helped me with this
macro, for \inline that work anywhere in the music:


partialInline = #(define-music-function
      (parser location nom den mus)
      (integer? integer? ly:music?)
   #{
     \set Score.measurePosition = #(ly:make-moment (- $nom) $den)
     $mus
    #}
)


That worked like
    \partialInline #1 #8 { a8 }

Now I get some complains with 2.16:

../utils.ly:9:34: error: GUILE signaled an error for the expression
beginning here
     \set Score.measurePosition = #
                                   (ly:make-moment (- $nom) $den)
Unbound variable: $nom
melody.ly:31:32: error: error in #{ ... #}
     \partialInline #1 #8 { a8 }
                                 |
Interpreting music...
warning: type check for `measurePosition' failed; value `#<unspecified>'
must be of type `moment'

Any help?
Thank you
Alberto

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Macro not working with 2.16

Jan-Peter Voigt
Hello Alberto,

the change was introduced in 2.13 or 2.15(?).
If you remove the dollar signs inside the scheme expression ($nom ->
nom) (but not inside the lily code $mus), it should work:

#{
\set Score.measurePosition = #(ly:make-moment (- nom) den)
$mus
#}

HTH
Jan-Peter

Am 10.04.2013 14:50, schrieb Alberto Simões:

> Hello
>
> Some time ago (years probably) somebody in this list helped me with
> this macro, for \inline that work anywhere in the music:
>
>
> partialInline = #(define-music-function
>      (parser location nom den mus)
>      (integer? integer? ly:music?)
>   #{
>     \set Score.measurePosition = #(ly:make-moment (- $nom) $den)
>     $mus
>    #}
> )
>
>
> That worked like
>    \partialInline #1 #8 { a8 }
>
> Now I get some complains with 2.16:
>
> ../utils.ly:9:34: error: GUILE signaled an error for the expression
> beginning here
>     \set Score.measurePosition = #
>                                   (ly:make-moment (- $nom) $den)
> Unbound variable: $nom
> melody.ly:31:32: error: error in #{ ... #}
>     \partialInline #1 #8 { a8 }
>                                 |
> Interpreting music...
> warning: type check for `measurePosition' failed; value
> `#<unspecified>' must be of type `moment'
>
> Any help?
> Thank you
> Alberto
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Macro not working with 2.16

Alberto Simões-2
Hello, Jan-Peter

On 10/04/13 14:01, Jan-Peter Voigt wrote:

> Hello Alberto,
>
> the change was introduced in 2.13 or 2.15(?).
> If you remove the dollar signs inside the scheme expression ($nom ->
> nom) (but not inside the lily code $mus), it should work:
>
> #{
> \set Score.measurePosition = #(ly:make-moment (- nom) den)
> $mus
> #}

Perfect. Thank you! :-)
Alberto


> Am 10.04.2013 14:50, schrieb Alberto Simões:
>> Hello
>>
>> Some time ago (years probably) somebody in this list helped me with
>> this macro, for \inline that work anywhere in the music:
>>
>>
>> partialInline = #(define-music-function
>>      (parser location nom den mus)
>>      (integer? integer? ly:music?)
>>   #{
>>     \set Score.measurePosition = #(ly:make-moment (- $nom) $den)
>>     $mus
>>    #}
>> )
>>
>>
>> That worked like
>>    \partialInline #1 #8 { a8 }
>>
>> Now I get some complains with 2.16:
>>
>> ../utils.ly:9:34: error: GUILE signaled an error for the expression
>> beginning here
>>     \set Score.measurePosition = #
>>                                   (ly:make-moment (- $nom) $den)
>> Unbound variable: $nom
>> melody.ly:31:32: error: error in #{ ... #}
>>     \partialInline #1 #8 { a8 }
>>                                 |
>> Interpreting music...
>> warning: type check for `measurePosition' failed; value
>> `#<unspecified>' must be of type `moment'
>>
>> Any help?
>> Thank you
>> Alberto
>>
>> _______________________________________________
>> lilypond-user mailing list
>> [hidden email]
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
>
> _______________________________________________
> lilypond-user mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Macro not working with 2.16

David Kastrup
In reply to this post by Alberto Simões-2
Alberto Simões <[hidden email]> writes:

> Hello
>
> Some time ago (years probably) somebody in this list helped me with
> this macro, for \inline that work anywhere in the music:
>
> Now I get some complains with 2.16:

If you had upgraded your files/macro using convert-ly, everything should
have worked fine.  convert-ly is _always_ the first thing to try
whenever something stops working in a newer version.

--
David Kastrup


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Macro not working with 2.16

SoundsFromSound
In reply to this post by Alberto Simões-2
Hi Alberto,

What does your macro do exactly?  Just curious, thanks!

Looks nice!

Alberto Simões-2 wrote
Hello

Some time ago (years probably) somebody in this list helped me with this
macro, for \inline that work anywhere in the music:


partialInline = #(define-music-function
      (parser location nom den mus)
      (integer? integer? ly:music?)
   #{
     \set Score.measurePosition = #(ly:make-moment (- $nom) $den)
     $mus
    #}
)


That worked like
    \partialInline #1 #8 { a8 }

Now I get some complains with 2.16:

../utils.ly:9:34: error: GUILE signaled an error for the expression
beginning here
     \set Score.measurePosition = #
                                   (ly:make-moment (- $nom) $den)
Unbound variable: $nom
melody.ly:31:32: error: error in #{ ... #}
     \partialInline #1 #8 { a8 }
                                 |
Interpreting music...
warning: type check for `measurePosition' failed; value `#<unspecified>'
must be of type `moment'

Any help?
Thank you
Alberto

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
composer | sound designer | asmr artist
LilyPond video tutorials: http://bit.ly/LearnLilyPond
Reply | Threaded
Open this post in threaded view
|

Re: Macro not working with 2.16

Thomas Morley
2013/4/10 SoundsFromSound <[hidden email]>:
> Hi Alberto,
>
> What does your macro do exactly?  Just curious, thanks!

It's a substitution-function
(see: http://lilypond.org/doc/v2.16/Documentation/extending/intermediate-substitution-functions
)
for `measurePosition'
(see Nr 1.2.6: http://lilypond.org/doc/v2.17/Documentation/notation/special-rhythmic-concerns
)

-Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user