Ciao David,

let's put it in another way. Have a look to the attached image and please
suggest me how you would write the code to generate it.

Then please have a look to the code I *would* like to write to obtain it.
Do you know if does exist anything similar to "\setOctave"? Do you see any
logical mistake in trying to write it in this way? Sorry if the example is
not very simple, but I have not been able to make it better.

\version "2.19.35"
\include "changePitch.ly"

rhythmPattern = {a16 \tuplet 3/2 {a8 a a} a16 a8 a4 a4} % a complex rhythm

scoreViolinI = \relative c'
{
  \setOctave c' %this command is just an example and it does not exist!
  \changePitch \rhythmPattern {c d d d c b d e}
  f g a b
  c d e f
  \setOctave c'
  \changePitch \rhythmPattern {c d d d c b d e}
}

scoreViolinII = \relative c'
{
  \setOctave c'
  \changePitch \rhythmPattern {a b b b a b a a}
  f f a a
  c c f f
  \setOctave c'
  \relative c' \changePitch \rhythmPattern {a b b b a b a a}
}

\score
{
  <<
    \new Staff \scoreViolinI
    \new Staff \scoreViolinII
  >>
  \layout { }
}


On Tue, Mar 8, 2016 at 7:39 PM, David Wright <lily...@lionunicorn.co.uk>
wrote:

> On Tue 08 Mar 2016 at 17:45:35 (+0100), Gianmaria Lari wrote:
> >    [...]
> >    So, more precisely I would write:
> >
> >      \version "2.19.35"
> >      pattern =
> >      {
> >         c16 d e f g a b c
> >      }
> >      \relative c'
> >      {
> >        \pattern d4 d4
> >        \pattern c4 e4
> >        \pattern e4 c4
> >      }
> >
> >    But the previous code generate:
> >    [...]
> >    So I played a bit with "\absolute" and at the end I have been able to
> fix
> >    the issue.
>
> I don't know what the issue is that you "fixed".
>
> >    Here it is the code:
> >
> >      \version "2.19.35"
> >      pattern = \absolute
> >      {
> >         c'16 d' e' f' g' a' b' c''
> >      }
> >      \relative c''
> >      {
> >        \pattern d4 d4
> >        \pattern c4 e4
> >        \pattern e4 c4
> >      }
> >
> >    Unfortunately this solution does not work well with "\changePitch"
> (that I
> >    need).
>
> Now here's a clue as to what you're trying to do. Looking at the
> changePitch documentation, patterns are only used as the first
> argument to a \changePitch function:
> \changePitch pattern newnotes
> Judging by its purpose, I would assume (short of testing it) that the
> pattern has an _implied_ \relative{} around it.
>
> What one doesn't do, but you are trying to do, is typeset the pattern
> itself directly into a score. All that your examples here are doing is to
> demonstrate the rules that LilyPond uses to interpret notes within
> { ... } \relative { ... } \absolute { ... }
>
> So the pattern's notes themselves are never seen in the score: they're
> replaced by the notes in the second argument (newnotes). That does
> mean that we expect to see \include "changePitch.ly" in any compilable
> examples you post.
>
> Cheers,
> David.
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to