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: Rune Zedeler
Subject: Re: need to generate mass quantities of random notes for practice
Date: Tue, 05 Jun 2007 05:32:04 +0200
User-agent: Thunderbird 1.5.0.10 (X11/20070306)

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





reply via email to

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