lilypond-devel
[Top][All Lists]
Advanced

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

Re: Removing 2sd intervals


From: Jeffery Shivers
Subject: Re: Removing 2sd intervals
Date: Tue, 25 Apr 2017 21:52:04 +0000

On Tue, Apr 25, 2017 at 5:21 PM nycgdf <address@hidden> 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


reply via email to

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