Re: music function playing well with context

2023-02-08 Thread Jean Abou Samra
On 08/02/2023 20:00, Alberto Simões wrote: > I get a >   Unbound variable: when > may it be the lilypond version? running 2.22 here. > THanks when was added in Guile 2, which LilyPond 2.24 uses while LilyPond 2.22 is on Guile 1. But I really recommend upgrading to 2.24. OpenPGP_signature

Re: music function playing well with context

2023-02-08 Thread Alberto Simões
On Wed, Feb 8, 2023 at 7:00 PM Alberto Simões wrote: > > > On Wed, Feb 8, 2023 at 6:57 PM Alberto Simões > wrote: > >> >> >> On Wed, Feb 8, 2023 at 6:50 PM Jean Abou Samra >> wrote: >> >>> On 08/02/2023 19:45, Alberto Simões wrote: >>> >>> > I just noticed this does not support chords: \myT f

Re: music function playing well with context

2023-02-08 Thread Alberto Simões
On Wed, Feb 8, 2023 at 6:57 PM Alberto Simões wrote: > > > On Wed, Feb 8, 2023 at 6:50 PM Jean Abou Samra wrote: > >> On 08/02/2023 19:45, Alberto Simões wrote: >> >> > I just noticed this does not support chords: \myT f >> > While I can do that manually (just a couple of cases) it would be

Re: music function playing well with context

2023-02-08 Thread Alberto Simões
On Wed, Feb 8, 2023 at 6:50 PM Jean Abou Samra wrote: > On 08/02/2023 19:45, Alberto Simões wrote: > > > I just noticed this does not support chords: \myT f > > While I can do that manually (just a couple of cases) it would be nice > to learn how to handle these cases. > > Would it be possible?

Re: music function playing well with context

2023-02-08 Thread Jean Abou Samra
On 08/02/2023 19:45, Alberto Simões wrote: > I just noticed this does not support chords: \myT f > While I can do that manually (just a couple of cases) it would be nice to > learn how to handle these cases. > Would it be possible? Chords are distinguished by having the music class

Re: music function playing well with context

2023-02-08 Thread Alberto Simões
Hi On Tue, Feb 7, 2023 at 9:07 PM Jean Abou Samra wrote: > > \version "2.24.0" > > myT = > #(define-music-function (pa pb) (ly:music? ly:music?) >(ly:music-set-property! pa 'duration #{ 4 #}) >(ly:music-set-property! pb 'duration #{ 8 #}) > #{ \tuplet 3/2 { #pa #pb } #}) > > { >

Re: music function playing well with context

2023-02-08 Thread Mats Bengtsson
On 2023-02-07 22:07, Jean Abou Samra wrote: I understand that having a ly:pitch argument, I can only use... pitch But changing it to ly:music?, I am not being able to control the notes duration. This is my first function, so sorry if this is too basic  This is not a dumb question. Try

Re: music function playing well with context

2023-02-07 Thread Jean Abou Samra
On 07/02/2023 22:17, Alberto Simões wrote: > Understood. Thank you . > After looking to the example, it makes sense, but it wasn't easy to get there > :-)> Always great to learn! Perhaps you will have an easier time building custom functions after reading pages like these:

Re: music function playing well with context

2023-02-07 Thread Alberto Simões
On Tue, Feb 7, 2023 at 9:07 PM Jean Abou Samra wrote: > On 07/02/2023 21:57, Alberto Simões wrote: > > Hello > > > > I am transcribing a piece that has a lot of tuplets: > > > >\tuplet 3/2 { a4 b8 } > > > > The duration of the notes is always this, just the pitch changes. > > I tried to

Re: music function playing well with context

2023-02-07 Thread Jean Abou Samra
On 07/02/2023 21:57, Alberto Simões wrote: > Hello > > I am transcribing a piece that has a lot of tuplets: >   >    \tuplet 3/2 { a4 b8 } > > The duration of the notes is always this, just the pitch changes. > I tried to create a music function with this code > > myT = #(define-music-function

music function playing well with context

2023-02-07 Thread Alberto Simões
Hello I am transcribing a piece that has a lot of tuplets: \tuplet 3/2 { a4 b8 } The duration of the notes is always this, just the pitch changes. I tried to create a music function with this code myT = #(define-music-function (pa pb) (ly:pitch? ly:pitch?) #{ \tuplet 3/2