X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=43b32ca530775c86c530516556f1554cddd3d34b;hb=a229fafa17dfdc0638326fab4368fffcfbf38d2a;hp=322e23a3996f24f092930a022eb28a2f3a987f85;hpb=92782fde87fb68e945b9eb60cacab6c01d0397df;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index 322e23a399..43b32ca530 100644 --- a/Documentation/snippets/generating-random-notes.ly +++ b/Documentation/snippets/generating-random-notes.ly @@ -1,22 +1,13 @@ -%% Do not edit this file; it is automatically +%% DO NOT EDIT this file manually; it is automatically %% generated from LSR http://lsr.dsi.unimi.it +%% Make any changes in LSR itself, or in Documentation/snippets/new/ , +%% and then run scripts/auxiliar/makelsr.py +%% %% This file is in the public domain. -\version "2.13.4" +\version "2.15.40" \header { - lsrtags = "pitches" - -%% Translation of GIT committish: b2d4318d6c53df8469dfa4da09b27c15a374d0ca - 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 @@ -28,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 @@ -43,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)))) } }