lilypond-user
[Top][All Lists]
Advanced

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

Re: problem with changePitch,


From: Alexander Kobel
Subject: Re: problem with changePitch,
Date: Sat, 05 Dec 2009 17:03:58 +0100
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Stefan Thomas wrote:
Dear community,
I've got a problem with the changePitch function.
I expectedt to get the same rhythms in the first and second staff, but it doesn't work. I don't understand, what could be the reason for this!

Hi, Stefan.

First of all, remember that changePitch is not one of the built-in functions. Chances to get an answer are better if you attach or link to the definition of the command, since also those can respond that did not follow our last thread about it. For your code: The time signatures and bar lengths in global do not match, but that's a minor issue; nowhere in changePitch does it says something about MultiMeasureRests. Factor those out into first and second, and you probably get what you expected.

global = {
  \time 4/8 s2
  \time 3/8 s4.
  \time 4/8 s2
  \time 3/8 s4.
  \time 4/8 s2
  \time 3/8 s4.
}

goOn = { g'' 16 -. e'' ( fis'' ) gis'' -. g'' ( a'' ) | }

beginning = {
  r4 r8 e'' 16 e'' | a'' 16 d'' fis'' fis'' r8 |
}

first = {
  \beginning
  R2 R4. R2 R4.
  \goOn
}


second = {
  \changePitch \beginning { cis'' cis'' f'' bes' es'' es'' s }
  R2 R4. R2 R4.
  \changePitch \goOn { b' c'' d'' es'' e'' f'' }
}
\score {
  <<
    \new Staff { \context Voice << {\first } { \global }>>}
    \new Staff { \context Voice << {\second } { \global }>>}
  >>
}

Why don't you try to keep stuff simple? Define an expression with the rhythms, where you don't have to care about pitches, and define both first in second in terms of those afterwards? Then you can easily factor out the MultiMeasureRests, and the whole input is far less cluttered.

rhI = { r4 r8 c16 c | c c c c r8 } %% Pitches don't matter here - to be used with \changePitch
  rhII  = { R2 R4. R2 R4. }
  rhIII = { c''16-. c( c) c-. c( c) }

  first = {
    \changePitch \rhI ...
    \rhII
    \changePitch \rhIII ...
  }
  second = ... (similar)


Cheers,
Alexander




reply via email to

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