lilypond-user
[Top][All Lists]
Advanced

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

Re: \transpose of drum voices


From: Fernando Dobladez
Subject: Re: \transpose of drum voices
Date: Mon, 29 Aug 2011 09:14:29 -0300

Excellent. Thanks!

On Mon, Aug 29, 2011 at 2:18 AM, Jay Anderson <address@hidden> wrote:
> On Sun, Aug 28, 2011 at 9:03 PM, Fernando <address@hidden> wrote:
>> Is it possible to use \transpose for patterns written in \drummode ?
>
> Here's something that I might do:
> ==============================
> \version "2.14.2"
>
> drumSwap =
> #(define-music-function (parser location from to music) (symbol?
> symbol? ly:music?)
>  (define (swap-drum-type mus)
>    (if (and (eq? (ly:music-property mus 'name) 'NoteEvent)
>             (eq? (ly:music-property mus 'drum-type) from))
>      (ly:music-set-property! mus 'drum-type to))
>    mus)
>  (music-map (lambda (x) (swap-drum-type x)) music))
>
> drumMus = \drummode
> {
>  sn4 sn sn sn
> }
>
> \score
> {
>  <<
>    \new DrumStaff \drumMus
>    \new DrumStaff \drumSwap #'snare #'bassdrum \drumMus
>  >>
> }
> ==============================
>
> It simply swaps all of one type for another. Look up the symbols for
> the drum pitches in drumpitch-init.ly.
>
> -----Jay
>



reply via email to

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