Re: Removing 2sd intervals

2017-04-27 Thread David Nalesnik
On Thu, Apr 27, 2017 at 5:43 PM, nycgdf  wrote:
> I don't know how to for-each on a music object.
>
>

There are a number of useful functions: musicMap (defined in
ly/music-functions-init.ly); for-some-music, map-some-music,
fold-some-music (in scm/music-functions.scm).  Maybe you can get use
out of one of these, either directly or as inspiration.

The lists should have a few examples of at least one or two of these.

Hope this helps a little.

David

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Removing 2sd intervals

2017-04-27 Thread nycgdf
I don't know how to for-each on a music object.



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Removing-2sd-intervals-tp202646p202728.html
Sent from the Dev mailing list archive at Nabble.com.

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Removing 2sd intervals

2017-04-25 Thread Jeffery Shivers
On Tue, Apr 25, 2017 at 5:21 PM nycgdf  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


Removing 2sd intervals

2017-04-25 Thread nycgdf
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






--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Removing-2sd-intervals-tp202646.html
Sent from the Dev mailing list archive at Nabble.com.

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel