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 14:18:59 +1100
User-agent: Roundcube Webmail/0.9.2

Paul,


On 2014-01-16 07:22, Paul Morris wrote:
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
                   (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))))
  }
}


maybe we (and by "we" I mean "you" - at least initially) could enhance this little bit of code to do what my Ruby script was doing? - and if more people got interested it could develop into something more sophisticated with some music theory behind it? So the first step would be a Scheme script that would:

- start with a single random note in a particular key

- most of the time, derive the next note from the current note by selecting a note (in the same key) within [+/-]1 of the value of the current note

- on some occasions (20% of the time?), selected a note within [+/-]2 of the value of the current note

- more rarely (5% of the time?) jump to another completely random note

What do you think?

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]