Paul Morris <[email protected]> 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. -- David Kastrup _______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
