lilypond-user
[Top][All Lists]
Advanced

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

Re: Function to add a drone staff?


From: Paul Morris
Subject: Re: Function to add a drone staff?
Date: Thu, 9 Apr 2015 08:27:30 -0700 (MST)

Gilles Sadowski wrote
> Is there a way (i.e. a function) to automatically add a staff for a
> bagpipe's drone note(s)?

Hi, Here's a start, a function to change all the pitches of a melody to a
given pitch.  Not tested on real music... (Since you only want the drone
notes in midi maybe you don't need to deal with chords, which makes the
coding simpler.)

HTH,
-Paul

Hat tip to David Kastrup for this example:
https://lists.gnu.org/archive/html/lilypond-user/2012-03/msg00621.html

%%%%%%%%%%%%%%% 

dronify =
#(define-music-function (parser location drone melody)
   (ly:pitch? ly:music?)
   (map-some-music
    (lambda (m)
      (and (ly:pitch? (ly:music-property m 'pitch))
           (begin
            (set! (ly:music-property m 'pitch) drone)
            m)))
    melody)
   melody)

melody = \relative f' {
  c4 r c8 d8 r4
  g2 r4 b4
}

<<
  \melody
  \dronify g' \melody
  \dronify g \melody
>>



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Function-to-add-a-drone-staff-tp174261p174278.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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