lilypond-user
[Top][All Lists]
Advanced

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

Re: music function playing well with context


From: Alberto Simões
Subject: Re: music function playing well with context
Date: Wed, 8 Feb 2023 18:45:43 +0000

Hi

On Tue, Feb 7, 2023 at 9:07 PM Jean Abou Samra <jean@abou-samra.fr> 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 } #})

{
  \myT c( gis a4_.)
  \myT c_. d^^ e4
}


You need to receive the argument as ly:music? so as to allow
articulations on the note. Then, you can override the duration,
with ly:music-set-property! .



I just noticed this does not support chords: \myT <c e> 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?

thanks
Alberto

reply via email to

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