Philip Rhoades <p...@pricom.com.au> writes:

>>> \version "2.18.0"
>>> \score {
>>>   {
>>>     $(let ((random-state (seed->random-state (current-time))))
>>>        (make-sequential-music
>>>         (map (lambda (x)
>>>                (let ((idx (random 12 random-state)))
>>
>>>                  (make-event-chord
>>>                   (list
>>
>> You can forego the above two lines (of course removing the respective
>> closing parens later on) nowadays.
>>
>>>                    (make-music 'NoteEvent
>>>                      'duration (ly:make-duration 2 0 1/1)
>>>                      'pitch (ly:make-pitch
>>>                              (quotient idx 7)
>>>                              (remainder idx 7)
>>>                              0))))))
>>>           (make-list 24))))
>>
>> Ok, make-list is a tad-bit more basic and efficient than the iota I
>> employed.
>
>
> I get a GUILE error on line 5
>
>   $(let

I don't.  Copy and paste error?

>   $@(let
>
> but that didn't work either (obviously I don't know what I'm doing . .)

Obviously.  $ splices a single expression (which is what
make-sequential-music produces) into LilyPond, $@ splices a list of
expressions.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to