lilypond-user
[Top][All Lists]
Advanced

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

Converting \page-ref value to number type


From: Benjamin Bruce
Subject: Converting \page-ref value to number type
Date: Wed, 24 Apr 2024 08:47:02 -0600
User-agent: Cyrus-JMAP/3.11.0-alpha0-386-g4cb8e397f9-fm-20240415.001-g4cb8e397

Hello all,
I am just now learning how to use labels and \page-ref to retrieve the page 
number where a label is located.
I would like to use the value returned by \page-ref to do simple math in 
Scheme. I am able to pass the label to a markup command, but I can't figure out 
how to get it into a number format so I can manipulate it. Any tips? Here is my 
tiny example:

\version "2.24"

{ 
  \label #'myLabel
  c4 c c
}

#(define-markup-command 
  (page-number-calculations layout props label) (markup?)
  ; Throws error "Wrong type argument in position 1"
  (interpret-markup layout props (+ label 1))
)

myLabel = \markup { \page-ref #'myLabel "0" "?" }
\markup \page-number-calculations \myLabel




reply via email to

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