lilypond-devel
[Top][All Lists]

## Re: How to create complex chord

 From: Simon Albrecht Subject: Re: How to create complex chord Date: Wed, 6 Apr 2016 22:37:51 +0200

Hi Larry,


how come you asked on the devel list? As the name says, this list is about developing LilyPond, not about using it – for that, there’s the user list.

On 06.04.2016 21:57, Larry wrote:

Hello,

I need to create a chord of which part is a tuplet and don't know how.



A chord can only contain notes of the same duration, so for different durations you need two voices. Your example uses two voices, in two staves, and the most convenient solution would seem to be moving one of the voices to the lower staff. A correct version of the code is found below. In any case, it will make your life much easier if you read the Learning Manual <http://lilypond.org/doc/v2.18/Documentation/learning/index.html> for getting a grip on the basics of LilyPond. It’s indispensible.

So HTH,
Simon


PS. The example was already quite good in that it was complete and compiled fine. However, it might have been somewhat smaller still (see <http://lilypond.org/tiny-examples.html>), e.g. by omitting everything for MIDI output. Just saying…

%%%%%%%%%%%%%
\version "2.18.2"
\language "english"

\paper {
#(set-paper-size "letter")
}

global = {
\key e \major
\time 4/4
}

right = \relative c' {
\global
\change Staff = "left"
\voiceOne
\tuplet 3/2 { e,8 gs cs }
}

left = \relative c, {
\global
\voiceTwo
<cs gs' cs>1
}

\score {
\new PianoStaff \with {
instrumentName = "Piano"
} <<
\new Staff = "right" \with {
midiInstrument = "acoustic grand"
} \right
\new Staff = "left" \with {
midiInstrument = "acoustic grand"
} { \clef bass \left }
>>
\layout { }
\midi {
\tempo 4=70
}
}