X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=d979660dfa4892e0d2e803ddd54095a70cc28fc3;hb=c4b122bf88e2aff20df5f85130e67aab73f7c5bf;hp=12052ea4beb19314e10795f2f6046a8b7345bced;hpb=2bf520787e5668f22dcf0d5ab3faf74693376d6a;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index 12052ea4be..d979660dfa 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 -%% generated from LSR http://lsr.dsi.unimi.it +%% DO NOT EDIT this file manually; it is automatically +%% generated from LSR http://lsr.di.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.12.2" +\version "2.18.0" \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 @@ -30,19 +21,18 @@ get different random note patterns, just change this number. \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 (list (make-music 'NoteEvent - 'duration (ly:make-duration 2 0 1 1) + 'duration (ly:make-duration 2 0 1/1) 'pitch (ly:make-pitch (quotient idx 7) (remainder idx 7) 0)))))) - (make-list 24))))) + (make-list 24)))) } }