[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiple transpositions
From: |
David Kastrup |
Subject: |
Re: multiple transpositions |
Date: |
Sat, 12 Aug 2023 19:11:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Stefan Thomas <kontrapunktstefan@gmail.com> writes:
> Dear community,
> is it possible to transpose a sequence of notes with only one motif several
> times at once?
> I'have in mind something like this:
> motiv = { c'4 d' e' c' }
> \multitranspose d e fis gis \motiv
> % result: d'4 e' fis' d' e' fis' gis' e' e' fis' gis' e' gis'
> ais' bis' gis'
> Or maybee something like recursive transposition could be done?
> For example, as in the snippet above, a motif is to be transposed several
> times by a certain interval.
Try
multitranspose =
#(define-music-function (seq motiv) (ly:music? ly:music?)
(music-clone seq 'elements
(map (lambda (p) #{ \transpose c #(ly:music-property p 'pitch ) $motiv #})
(ly:music-property seq 'elements))))
motiv = { c'4 d' e' c' }
\multitranspose { d e fis gis } \motiv
--
David Kastrup