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: Philip Rhoades
Subject: Re: "Generative music" and "Algorithmic composition"
Date: Thu, 16 Jan 2014 17:58:28 +1100
User-agent: Roundcube Webmail/0.9.2

David,


On 2014-01-16 07:43, David Kastrup wrote:
Paul Morris <address@hidden> writes:

SoundsFromSound wrote
Paul, that is a great little bit of code! Thank you for sharing that...I'm
going to play around with it later today. :)

Glad you like it, but David Kastrup gets the credit for it:
http://lists.gnu.org/archive/html/lilypond-user/2014-01/msg00638.html

I just changed it from a set of 12 chromatic notes to those in C major and added \transpose. Maybe it's worth adding it to the LSR... hmmm... looks
like there's already a random note generator there:
http://lsr.dsi.unimi.it/LSR/Item?id=274

It generates notes in the current key from (middle) c' up to g''
Here it is after running convert-ly (from 2.14.0 to 2.18.0):

\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

anyway . . I tried changing it to:

  $@(let

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

Regards,

Phil.



--
Philip Rhoades

GPO Box 3411
Sydney NSW      2001
Australia
E-mail:  address@hidden



reply via email to

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