X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=af7d81868d807c443683a6388c3c3ce47c1af727;hb=c31ee4f97786151cdc92d2d45e2b759eb54cd5fd;hp=560d85fe85eadfa0c45aa7cbd751711a15378d6a;hpb=129ef378c53f80d45f40af27ba80ad0fb5e0a53c;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index 560d85fe85..af7d81868d 100644 --- a/Documentation/snippets/generating-random-notes.ly +++ b/Documentation/snippets/generating-random-notes.ly @@ -4,22 +4,10 @@ %% and then run scripts/auxiliar/makelsr.py %% %% This file is in the public domain. -\version "2.12.2" +\version "2.17.6" \header { - lsrtags = "pitches" - -%% Translation of GIT committish: fa19277d20f8ab0397c560eb0e7b814bd804ecec - texidoces = " -Este fragmento de código basado en Scheme genera -24 notas aleatorias (o tantas como se necesiten), basándose en la -hora actual (o en cualquier número pseudo-aleatorio que se -especifique en su lugar, para obtener las mismas notas aleatorias -cada vez): es decir, para obtener distintos patrones de notas, -sólo tiene que modificar este número. - -" - doctitlees = "Generación de notas aleatorias" + lsrtags = "pitches, really-cool, scheme-language" texidoc = " This Scheme-based snippet generates 24 random notes (or as many as @@ -31,11 +19,11 @@ get different random note patterns, just change this number. doctitle = "Generating random notes" } % begin verbatim + \score { { - #(let ((random-state (seed->random-state (current-time)))) - (ly:export - (make-sequential-music + $(let ((random-state (seed->random-state (current-time)))) + (make-sequential-music (map (lambda (x) (let ((idx (random 12 random-state))) (make-event-chord @@ -46,6 +34,6 @@ get different random note patterns, just change this number. (quotient idx 7) (remainder idx 7) 0)))))) - (make-list 24))))) + (make-list 24)))) } }