X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=cf2bfb23e93e8b7465c1065c24de01b8c1d2718f;hb=b88d1612f79e1934a26f5d02d538e5fba3b06879;hp=99832b9263a349d4c6f0f938b119e4ea4c569db8;hpb=904b46b9fa8fc5c189087058cdf977383a4580d7;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index 99832b9263..cf2bfb23e9 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.14.0" +\version "2.17.11" \header { - lsrtags = "pitches" - -%% Translation of GIT committish: 615cbf212fdaf0b220b3330da417d0c3602494f2 - 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,21 +19,21 @@ 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 (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)))) } }