lilypond-user
[Top][All Lists]
Advanced

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

Music function to manage a moment and beat for the Staff and the Voice


From: Volodymyr Prokopyuk
Subject: Music function to manage a moment and beat for the Staff and the Voice
Date: Sat, 1 Jul 2023 16:42:36 +0200

Hi,

I'm trying to define a music function as below, however I've faced difficulties with parameter predicates, visibility of the Staff object, and flexibility of the solution ideally without code duplication

Desired music function (the code is not working)

  momentBeat = #(define-music-function (moment beat scope)
    (fraction? list? (what? Staff))
    #{
      \set #scope.beamExceptions = #'()
      \set #scope.baseMoment = #(ly:make-moment moment)
      \set #scope.beatStructure = #beat
    #})

Usage

\momentBeat 1/2 #'(1)
\momentBeat 1/4 1,1,1,1 Voice

Questions
Thank you,
Vlad

reply via email to

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