lilypond-user
[Top][All Lists]
Advanced

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

How can I write simultaneous music in \chordmode?


From: Jim Long
Subject: How can I write simultaneous music in \chordmode?
Date: Tue, 6 Jan 2015 18:14:58 -0800
User-agent: Mutt/1.5.23 (2014-03-12)

I often use LilyPond 2.18.2 to make jazz/pop charts which will
need to be transposed for non-concert instruments.  This can
sometimes lead to non-optimal enharmonic choices of melodic notes
or chord roots in the transposed book part(s).

I work around this by employing tags around the problematic
note(s), such as when I have a concert B, but wish to have the
trumpet part show a D-flat, not a C-sharp:

foo = \new Staff \relative c' {
  <<
    \tag #'concert { b1 }
    \tag #'trumpet { ces1 }
  >>
}

\score {
  \transpose c d \keepWithTag #'trumpet \foo
}

This is not a perfect example, but I hope it illustrates my point.
I use simulataneous music around the tags so that the length of music
in variable foo is accurate, and I can use many of the handy extractMusic
functions (extractBegin, extractEnd, etc.) that I picked up from someone
on this list whose name escapes me right now. 
[ "Thank you" to http://gillesth.free.fr/Lilypond/extractMusic/extractMusic.ly ]

This works great.  But I often have the same problem in chordmode
music, "the same problem" meaning that I need to use tagged
alternative bits of enharmonic music where the tagged
alternatives are simultaneous so that they don't artificially
lengthen the number of beats/bars of music.  Unfortunately,
simultaneous music << >> doesn't work in \chordmode:

foo = \new Staff \relative c' {
  <<
    \tag #'concert { b1 }
    \tag #'trumpet { ces1 }
  >>
}

fooChords = \new ChordNames \chordmode {
  <<
    \tag #'concert { b1 }
    \tag #'trumpet { ces1 }
  >>
}

\score {
  \transpose c d
    \keepWithTag #'trumpet
      <<
        \fooChords
        \foo
      >>
}

Lily complains with:

x.ly:9:3: error: syntax error, unexpected $undefined

Is there a technical reason why simultaneous music hasn't been
implemented in \chordmode music?  How might I work around this,
so that usage of \tag within \chordmode doesn't distort the true
length of the music stored in a variable?

For passages of repeated chords with only slight changes at the
end, I often write things like:

foo = \chordmode { a1 b1 c1 c1 }

bar = \chordmode {
  \extractBegin
    \repeat unfold 2 \foo
    s1*7  % extract the first 7 of those 8 bars
  a1
}

to create a variable bar that yields:

a1 b1 c1 c1
a1 b1 c1 a1

But of course, that breaks down if \foo contains tagged music that isn't
simultaneous with the \tag alternatives.  That is, I need the lengths of:

\foo
\keepWithTag #'concert \foo
\keepWithTag #'trumpet \foo
\keepWithTag #'altosax \foo

to all be equal.

I hope I've explained this well, I'm not so sure right now! :)  If someone
feels like they could help if they had a clearer example, I'll try to cobble
one up.


Thank you!

Jim



reply via email to

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