[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme question
From: |
David Kastrup |
Subject: |
Re: Scheme question |
Date: |
Mon, 13 Jun 2016 20:46:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Phil Holmes <address@hidden> writes:
> Can anyone explain why the f in the attached code is 2 octaves above where
> I would expect them?
>
> testy = #(define-music-function (note)
> (ly:music?)
> #{
> \tag #'a { #note }
> \tag #'b { #note }
> #})
>
> \score {
> \keepWithTag #'a {
> \new Staff
> {
> \new Voice { \relative c'' { c d e \testy f } }
> }
> }
> }
Because you let it be shifted two times before selecting your tag? Your
music does not contain two _copies_ of note, but rather contains note
_itself_ two times. So \relative is applied to the same music two times
in succession.
Use #(music-clone note) or #(ly:music-deep-copy note) or $note for your
two uses, and the note will get placed in two separate _copies_ of the
original rather than using the note object itself in two places.
--
David Kastrup