lilypond-user
[Top][All Lists]
Advanced

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

Re: octave doubling


From: Mats Bengtsson
Subject: Re: octave doubling
Date: Fri, 12 Dec 2003 17:20:31 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

First of all, your example code doesn't work as you expect, since
the \transpose command only transposes the property setting, nothing
else (a pair of curly brackets {\property ... \lowerone } solves that
or you could interchange the order of the transpose and property lines).

Anyway, by default the engraver handling scripts lives in the Voice
context, which means that as soon as you set a property in the Voice
context it will apply to all the music within that context. Since your
two octaves share the same context the solution has to be somewhat more
advanced than just setting a property.
The trick is to move the engraver from the Voice context to the Thread
context since your two octaves correspond to separate Thread contexts.
Then, you can set the property in one of the Threads without affecting
the other.

The resulting part of the code could look something like:

lowerOctave = \notes <<
  \context Thread=lowerOne {
    \property Thread.Script \set #'transparent = ##t
    \property Thread.TextScript \set #'transparent = ##t
\transpose c' c \lowerOne }

  \context Thread=lowerOne {
    \repeat "unfold" 4 { \firstEight }
  }
>>

\score {
  <<
    \context PianoStaff <<
      \context Staff=upper <<
        \context Voice=upperOne <<
          \upperOne
          \upperOctave
        >>
      >>
      \context Staff=lower <<
        \clef bass
        \context Voice=lowerOne <<
          \lowerOne
          \lowerOctave
        >>
      >>
    >>
  >>
  \paper {
    \translator{
      \VoiceContext
      \remove "Script_engraver"
      \remove "Text_engraver"
    }
    \translator{
      \ThreadContext
      \consists "Script_engraver"
      \consists "Text_engraver"
    }
 }
}


Note that you have to do the same trick separately for ordinary scripts
(such as fermatas or staccato dots) and text scripts ( such as
^"Allegro")

   /Mats


Atte André Jensen wrote:
I'm looking at:
http://lilypond.org/doc/v2.1/input/test/out-www/lily-1706119646.ly

Looks nice, but it seams that added articulations get's printed twice. How can this be avoided? I tried to hide them from one "version" of the music, byy putting \property Voice.Script \set #'transparent = ##t in lowerOctave like this, but it doesn't work (seems the stems get hidden instead):


lowerOctave = \notes <<
    \context Thread=lowerOne {
    \transpose c' c
    \property Voice.Script \set #'transparent = ##t
    \lowerOne
    }
    \context Thread=lowerOne {
    \repeat "unfold" 4 { \firstEight }
    }
 >>


--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463                         
        Fax:   (+46) 8 790 7260
        Email: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================





reply via email to

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