Dear LilyPond Community,

In the interest of learning more about Scheme as used in LilyPond (and
learning LilyPond in general!), I am currently in the process of making a
shortcut function that handles the artificial harmonic notation of string
instruments instead of typing "<note note \harmonic >"However, something
must be wrong with the way I am handling \transpose in the scheme code, and
there are some instances of the artificial harmonics that don't render
correctly. Code (as tiny as I could manage!) and screenshot attached. I'd
be grateful in advance if anyone could enlighten me on this.

(Context: I am/was a Finale user with some coding background who
rediscovered the LilyPond's goodness and this is week 3 of learning it
together with students at the university I work. Part of me wished there
was a way to specify the interval of transposition by some kind of interval
name followed by a direction, rather than "frompitch topitch"...but I know
this has some intricacies with absolute vs relative pitch notation...)

Thanks in advance!
Yoshi

=====

\version "2.24.4"
% I tried to use (make-relative) macro to see if it helped with anything,
but to no avail.
hf = #(define-music-function (note1) (ly:music?)
        #{ < #note1 \transpose c f $note1 \harmonic > #}
        )
{
  \time 3/4
  \relative c'
  {c'16 \hf b \hf bes \hf a \hf as \hf g \hf fis \hf f \hf e \hf es \hf d
\hf des | \hf c \hf b }
}

[image: image.png]

Reply via email to