lilypond-user
[Top][All Lists]
Advanced

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

Function to add a drone staff?


From: Gilles
Subject: Function to add a drone staff?
Date: Thu, 09 Apr 2015 13:51:56 +0200
User-agent: Scarlet Webmail

Hi.

Is there a way (i.e. a function) to automatically add a
staff for a bagpipe's drone note(s)?
Up to now, I was adding a staff by hand (with a tag so it
would not appear on the printed score).   But it is more
complicated than it could be since the drone does not change,
plays along the melody and stop at rests.

Here is how the code currently looks like:
---CUT---
melodyNotes = \relative c'' {
  % ...
}

droneNotes = \relative c'' {
  <g g'>2~ |
  <g g'>2~ |
  % and so on...
  <g g'>2 |
}

bagpipeOneStaff = \new Staff {
  \set Staff.instrumentName = \markup \column { "Bagpipe I" }
  <<
    \new Voice {
      \set midiInstrument = "oboe"
      \set midiMinimumVolume = #0.6
      \set midiMaximumVolume = #0.7
      \clef G
      \melodyNotes
    }
    \new Voice {
      \set midiInstrument = "accordion"
      \set midiMinimumVolume = #0.2
      \set midiMaximumVolume = #0.3
      \tag #'no-layout {
        \droneNotes
      }
    }
  >>
}
---CUT---
[Thus, whenever there are changes in "melodyNotes", the "droneNotes"
must also be modified...]

So, an idea would be to use the function in order to
automatically add the drone voice (second voice in the
above excerpt) with the MIDI settings, and tag, as
parameters.
Hence, the above would become:

---CUT---
melodyNotes = \relative c'' {
  % ...
}

melody = \new Voice {
  \set midiInstrument = "oboe"
  \set midiMinimumVolume = #0.6
  \set midiMaximumVolume = #0.7
  \clef G
  \melodyNotes
}

bagpipeStaff = \new Staff {
  \set Staff.instrumentName = \markup \column { "Bagpipe I" }
  <<
    \melody
% I don't know what is legal syntax for the parameters specification...
    \makeDrone #'no-layout <g g'> #'accordeon #0.2 #0.3 \melody
  >>
}
---CUT---

Does that make sense?


Best regards,
Gilles




reply via email to

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