lilypond-user
[Top][All Lists]
Advanced

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

Re: Extract pitch and duration from ly:music


From: Paolo Prete
Subject: Re: Extract pitch and duration from ly:music
Date: Wed, 21 Feb 2018 15:03:21 +0000 (UTC)

In my previous message I specified that I want to extract pitch and duration from ly:music,  not from ly:pitch + ly:duration.

func = #(define-music-function (parser location note dur) 
 (ly:music) #{ ....  $mypitch $myduration .....  #}  )

That is because I want the possibility to call this kind of functions also when they are nested (and I can do that only if the argument is ly:music):

\func \func c' 4


How can I obtain that?


Il Mercoledì 21 Febbraio 2018 15:45, Malte Meyn <address@hidden> ha scritto:




Am 21.02.2018 um 15:40 schrieb Joshua Stutter:
> […]
>
> fun = #(define-music-function (parser location note dur) (ly:pitch?
> ly:duration?)
> #{ $note$dur #})
>
> and create notes from pitches and durations within #{ #}. I explained
> that, to the best of my knowledge, this is not possible and new notes
> must be constructed within Scheme and cannot be concatenated like this.
That’s not true, you simply need a space between $note and $dur:

\version "2.19.81"

fun = #(define-music-function (parser location note dur) (ly:pitch?
ly:duration?)
#{ $note $dur #})

\fun c' 4


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user



reply via email to

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