On 6/4/2018 2:44 PM, Malte Meyn wrote:


Am 04.06.2018 um 19:46 schrieb Ben:
but I wonder if it's possible to write a simple function to basically 'turn on add :32 tremolo to notes until turned off' - that would keep the code much cleaner, although I know it's somewhat limited in it's usability. But, just brainstorming here.

How about the following code? Works only for single notes, not for chords; but that could be changed.

\version "2.19.81"

addTremolos =
#(define-music-function (number music) (integer? ly:music?)
   (music-map
    (lambda (mus)
      (if (eq? 'NoteEvent
               (ly:music-property mus 'name))
          (let ((art (ly:music-property mus 'articulations '())))
            (ly:music-set-property!
             mus
             'articulations
             (cons
              (make-music
               'TremoloEvent
               'tremolo-type number)
              art))))
      mus)
    music))


\addTremolos 16 {
  b r a
}


Wow. Um, this is awesome. Yes it works beautifully. How difficult would it be to allow this function to accept chords? Or would that simply be best served as creating another function like \addTremChords or something?

I use a lot of tremolo in double-stop strings for these recent projects, so I'm curious :)

Thank you so much! This is so cool.


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to