Dear Mark,

I did this in a slightly different way...if you do

\displayMusic c4\rest

you can see how to represent a rest using the make-music procedure in scheme code. Modifying that a bit, I got

% --------------------
\version "2.25.6"

%\displayMusic c4\rest =
%(make-music
  %'RestEvent
  %'duration
  %(ly:make-duration 2)
  %'pitch
  %(ly:make-pitch -1 0))

restt = #(define-music-function (pit dur) (ly:pitch? ly:duration?)
    (make-music
        'RestEvent
        'duration
        dur
        'pitch
        pit)
)

\relative c' {
  \restt c 4
  \restt e 4
  \restt g 4
  \restt c 4
  \restt b 2
  \restt a 2
  \restt g 2.
  \restt g 4
}
% --------------------

-William


On 12/18/23 00:33, Mark Probert wrote:
Hi.

I'm struggling some with writing a music function for rests.  Basically I want to be able to write something like

  \rel-rest( b', 1)

which would place a dotted quarter rest on the indicated pitch (the equivalent of

   b'1\rest

I'm starting with

rel-rest =
#(define-music-function (pit dur) (ly:pitch? ly:duration?)
   #{
     #pit#dur\rest
   #})

but that gives me an error.

Any suggestions?

--

--
-mark.

--
William Rehwinkel - Oberlin College and Conservatory '24

will...@williamrehwinkel.net

PGP key: https://ftp.williamrehwinkel.net/pubkey.txt

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to