truthling,

On 2014-10-22 14:20, truthling wrote:
Were you successful with this Phillip?


I did get some help from the Lilypond list before - I attach the the files I was playing around with then. To be honest, although it was an interesting exercise, I went back to converting the Sagreras Guitar book into the AN I developed but then was almost immediately overwhelmed with other life issues (that are continuing) and I haven't been able to even practise that stuff very much. After I have finally moved house I hope to get back to it . .

Regards,

Phil.


--
View this message in context:
http://lilypond.1069038.n5.nabble.com/Generating-random-notes-tp157801p167781.html
Sent from the User mailing list archive at Nabble.com.

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

--
Philip Rhoades

GPO Box 3411
Sydney NSW      2001
Australia
E-mail:  p...@pricom.com.au
\include "gnote2_2.ily"

\new StaffGNoteTwo {
% \new Voice {
  $@(let
  ((notes
  (ly:music-property
  #{
  <c des d dis e f fis g gis a ais b>
  #}
  'elements)))
      (map
      (lambda (x)
      (list-ref notes
      (random
      (length notes))))
      (iota 400)))
}
\version "2.18.0"

randomNotes =
{
  $@(let ((notes (ly:music-property #{ <e f g a b c' d' e' f' g' a' b' c'
d'> #}
                                    'elements)))
      (map (lambda (x) (list-ref notes (random (length notes)))) (iota
400)))
}

\new Voice {
  \transpose c c {
    \randomNotes
  }
}

\score {
  {
    #(let ((random-state (seed->random-state (current-time))))
       (ly:export
        (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)))))
  }
}
\score {
  {
    #(let ((random-state (seed->random-state (current-time))))
       (ly:export
        (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)))))
  }
}

\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))))
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to