lilypond-user
[Top][All Lists]
Advanced

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

Re: "Generative music" and "Algorithmic composition"


From: David Kastrup
Subject: Re: "Generative music" and "Algorithmic composition"
Date: Thu, 16 Jan 2014 08:08:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Philip Rhoades <address@hidden> 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



reply via email to

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