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


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to