On Tue, Apr 25, 2017 at 5:21 PM nycgdf <nyc...@gmail.com> wrote:

> Hi everyone,
>
> I would like to write a function (potentially a music-function) that does
> the following task:
> For every set of notes that are played in the same time, if they are
> separated by less than 3 semitones, modal transpose the lower note at a
> given scale to one step lower.
>
> Input:
> musica = { a4 b4 c'4 d'4 }
> musicb = { d'4 c'4 b4 a4 }
>
> both = {
> <<
> \musica
> \musicb
> >>
> }
>
> output:
> <<
> { a4 a4 c'4 d'4 }
> { d'4 c'4 a4 a4 }
> >>
>
> I struggle to find a way to iterate on the note of a music:
> Ideally, I am looking for a 'for-each' function that I could call on 'both'
> that would iterate on the list:
> (list #{ << a4 d'4 >> << b4 c'4 >> << c'4 b4 >> << d'4 a4 >> #})
>
> and then I would use ly:pitch-semitones to calculate the difference and do
> the transpose.
>
> Thank you for your help


Can't you `for-each` this? Or `do` it?

> --

Jeffery Shivers
 jefferyshivers.com
 soundcloud.com/jefferyshivers
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to