[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: \transpose of drum voices
From: |
Jay Anderson |
Subject: |
Re: \transpose of drum voices |
Date: |
Sun, 28 Aug 2011 22:18:31 -0700 |
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