Re: Extract pitch and duration from ly:music

2018-02-21 Thread David Kastrup
Joshua Stutter writes: > I feel I should enter into the discussion here. I had a conversation > with Paolo on lilypond IRC where he was wishing to accomplish > something along the lines of: > > fun = #(define-music-function (parser location note dur) (ly:pitch? >

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Paolo Prete
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

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Joshua Stutter
Wow, I did not know that, thanks. I think I've learned the most today. Joshua. On 21/02/18 14:48, Malte Meyn wrote: Am 21.02.2018 um 15:46 schrieb Malte Meyn: Oh, I forgot to say: This doesn’t work with 2.18.2 so you’re partially right. And again I made a mistake: It *does* work but only

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Malte Meyn
Am 21.02.2018 um 15:46 schrieb Malte Meyn: Oh, I forgot to say: This doesn’t work with 2.18.2 so you’re partially right. And again I made a mistake: It *does* work but only if you surround the pitch by ##{ #} \version "2.18.2" fun = #(define-music-function (parser location note dur)

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Malte Meyn
Am 21.02.2018 um 15:44 schrieb Malte Meyn: 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

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Malte Meyn
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

Re: Extract pitch and duration from ly:music

2018-02-21 Thread Joshua Stutter
I feel I should enter into the discussion here. I had a conversation with Paolo on lilypond IRC where he was wishing to accomplish something along the lines of: fun = #(define-music-function (parser location note dur) (ly:pitch? ly:duration?) #{ $note$dur #}) and create notes from pitches

Re: Extract pitch and duration from ly:music

2018-02-21 Thread David Kastrup
Paolo Prete writes: > Hello, > is it possible to extract pitch and duration, inside a function, from > a ly:music (a simple note) parameter? > I would like to obtain something like: > func = #(define-music-function (parser location note dur) > (ly:music) #{  $mypitch

Extract pitch and duration from ly:music

2018-02-21 Thread Paolo Prete
Hello, is it possible to extract pitch and duration, inside a function, from a ly:music (a simple note) parameter? I would like to obtain something like: func = #(define-music-function (parser location note dur) (ly:music) #{   $mypitch $myduration .  #}  ) ... But I don't understand if