lilypond-user
[Top][All Lists]
Advanced

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

Typesetting "ornaments" with parallel voices when using accordion push s


From: Mojca Miklavec
Subject: Typesetting "ornaments" with parallel voices when using accordion push spanner
Date: Mon, 19 Dec 2016 10:57:59 +0100

Hi,

I would like to typeset some scores where only the main melody is obligatory:

\language "deutsch"

global = {
    \time 3/4
    \key f \major
}

melody = \fixed c' {
    \global
    <c' e'>2.~ |
    <c' e'>2. |
}

while one could optionally add some ornaments:

\fixed c' {
    s4 g4. a8 |
    b2. |
}

and I would like to mark that "optionality" in whatever way is
reasonable to do so.


I was thinking of using grace notes (they are supposed to be
ornaments), so I started with

melody = \fixed c' {
    \global
    \afterGrace <c' e'>2.~ { g4. a8 } |
    <c' e'>2. | % b2. still missing
}

but the resulting MIDI sounds weird. It looks as if grace notes are
really meant as something that is as short as possible and "doesn't
take any time". (Otherwise the visual result is kind-of OK.)


I next tried to follow instruction for parallel voices, but the
following doesn't seem to work, the second voice seems to interfere
with the first one, note heads change direction and properties etc.:

  \version "2.19.30"
  \language "deutsch"

  global = {
    \time 3/4
    \key f \major
  }

  rhythm = {
    \global
    \repeat unfold 3 { c4 c c | }
  }

  melody = \fixed c' {
    \global
    <<
      {
        \voiceOne
        <c' e'>2.~ |
        <c' e'>2. |
      }
      {
        % This seems to change the first one as well
        \voiceTwo
        % I would like a simple command so switch the style, but only
the colour,
        % potentially the size, not to the super ugly shape
        % \voiceOneStyle
        %
        % dots should be coloured as well
        \override NoteHead.color = #blue
        \override Stem.color = #blue
        r4 g4. a8 |
        b2. |
        \override NoteHead.color = #black
        \override Stem.color = #black
      }
    >> \oneVoice
    <g b>4 <a c'> <b d'> |
  }
  \score {
  \new PianoStaff <<
      \new Voice = "melody" {
        \set Staff.midiInstrument = "accordion"
        \melody
      }
      \new RhythmicStaff {
        \rhythm
      }
    >>
  }


Creating a new voice helped:

    melody = \fixed c' {
      \global
      <<
        {
          \voiceOne
          <c' e'>2.~ |
          <c' e'>2. |
        }
        \new Voice {
          \voiceTwo
          % dot should be blue as well
          \override NoteHead.color = #blue
          \override Stem.color = #blue
          r4 g4. a8 |
          b2. |
        }
      >> \oneVoice
      %\startPush
      <g b>4 <a c'> <b d'> |
      %\stopPush
    }

but it seems to interfere with accordion push spanner (as implemented
for me by David Nalesnik, so I'm not sure how to "fix" that code).

    \score {
    \new PianoStaff <<
        \new Voice = "melody" {
          \set Staff.midiInstrument = "accordion"
          \melody
        }
        \new AccordionPushPull \with {
          \override VerticalAxisGroup.nonstaff-nonstaff-spacing.padding = 1
        } {
          \melody
        }
        \new RhythmicStaff {
          \rhythm
        }
      >>
    }

I could probably work around the problems mentioned above by defining
a completely independent second voice, but that will be a lot more
error-prone.

Is there a way to fix the interference between a new voice and the push spanner?

I tried to come up with as minimal example as possible, but I wouldn't
know how to further shrink the code from accordion.ily.

Thank you,
    Mojca

(Please CC me.)

Attachment: accordion.ily
Description: Binary data

Attachment: ornament.ly
Description: Binary data

Attachment: duplication-of-second-voice-in-push-spanner.png
Description: PNG image


reply via email to

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