lilypond-devel
[Top][All Lists]
Advanced

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

Re: Generating music from a list of identifiers


From: David Kastrup
Subject: Re: Generating music from a list of identifiers
Date: Wed, 01 Apr 2015 21:36:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

"Trevor Daniels" <address@hidden> writes:

> Hi Schemers
>
> I'm struggling to find how to do the following:
>
> I have a list of the identifiers of variables which contain either music or 
> #f and I'd like to generate the parallel music of all of them which contain 
> music.  I can do this by listing the identifiers explicitly, like this:
>
> AllMusic = <<
>   #(if DescantMusic DescantMusic)
>   #(if SopranoMusic SopranoMusic)
>   ...
>   #(if PianoLHMusic PianoLHMusic)
>>>
>
> But I'd like to do the same thing without listing each one explicitly, using 
> a list like this, which is generated algorithmically:
>
> #(define AllMusicNames
>    (list
>      "DescantMusic"
>      "SopranoMusic"
>      ...
>      "PianoLHMusic"))

Untested:

#(simultaneous-music
  (filter ly:music?
    (map (lambda (x) (ly:parser-lookup parser x))
      (map string->symbol AllMusicNames))))

-- 
David Kastrup



reply via email to

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