lilypond-user
[Top][All Lists]
Advanced

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

Re: need to generate mass quantities of random notes for practice


From: Stan Sanderson
Subject: Re: need to generate mass quantities of random notes for practice
Date: Tue, 5 Jun 2007 21:53:43 -0500


On Jun 5, 2007, at 8:49 AM, Stan Sanderson wrote:


On Jun 4, 2007, at 10:32 PM, Rune Zedeler wrote:

Adam Good wrote:

This is just too cool! Really thank you for sharing it.

:-)

One thing, for me I'm only getting the pitches of C major, how can I do all 12 notes of the chromatic scale?

Okay, in this one you can freely select which notes to choose from by
changing the list in the top of the program. Don't try to use relative, or change the format of the list in any way. You are welcome to change
the length of the list, though.

\version "2.10.0"
notes = { c'  cis'  d'  es'  e'  f'  fis'  g'  gis'  a'  bes'  b'
          c'' cis'' d'' es'' e'' f'' fis'' g'' }
\score { {
  #(let* ((random-state (seed->random-state (current-time)))
          (note-list (ly:music-property notes 'elements))
          (num-notes (length note-list)))
    (ly:export
     (make-music 'SequentialMusic 'elements
      (map (lambda x
            (list-ref note-list (random num-notes random-state)))
       (make-list 256)))))
} }

-Rune

Does this latest incarnation break the current-time seed? Successive compiles produce
the same output for me. The previous version worked as described.

Stan


Rune-

My apologies. I erred copying the code; corrected, it works perfectly.

Much fun!

Stan






reply via email to

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