]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/generating-random-notes.ly
1611b89b6d4dd32b73621126cc7158b47f1ba86f
[lilypond.git] / input / lsr / generating-random-notes.ly
1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
3 \version "2.13.1"
4
5 \header {
6   lsrtags = "pitches"
7
8 %% Translation of GIT committish: 48f804da6794a7bc8e7fdd4b1649f485b0b09d26
9   texidoces = "
10 Este fragmento de código basado en Scheme genera
11 24 notas aleatorias (o tantas como se necesiten), basándose en la
12 hora actual (o en cualquier número pseudo-aleatorio que se
13 especifique en su lugar, para obtener las mismas notas aleatorias
14 cada vez): es decir, para obtener distintos patrones de notas,
15 sólo tiene que modificar este número.
16
17 "
18   doctitlees = "Generación de notas aleatorias"
19
20   texidoc = "
21 This Scheme-based snippet generates 24 random notes (or as many as
22 required), based on the current time (or any randomish number specified
23 instead, in order to obtain the same random notes each time): i.e., to
24 get different random note patterns, just change this number.
25
26 "
27   doctitle = "Generating random notes"
28 } % begin verbatim
29
30 \score {
31   {
32     #(let ((random-state (seed->random-state (current-time))))
33        (ly:export
34         (make-sequential-music
35          (map (lambda (x)
36                 (let ((idx (random 12 random-state)))
37                   (make-event-chord
38                    (list
39                     (make-music 'NoteEvent
40                                 'duration (ly:make-duration 2 0 1 1)
41                                 'pitch (ly:make-pitch
42                                         (quotient idx 7)
43                                         (remainder idx 7)
44                                         0))))))
45               (make-list 24)))))
46   }
47 }