X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fgenerating-random-notes.ly;h=1611b89b6d4dd32b73621126cc7158b47f1ba86f;hb=3eb1e37e2e0b3966142cd04b85e30ab882308612;hp=d39ed0bfcab12076dbc8a7e5d6bd9935cda2d278;hpb=855e680d327f49088fb2f9f3ca4dbf0875c43bc0;p=lilypond.git diff --git a/input/lsr/generating-random-notes.ly b/input/lsr/generating-random-notes.ly index d39ed0bfca..1611b89b6d 100644 --- a/input/lsr/generating-random-notes.ly +++ b/input/lsr/generating-random-notes.ly @@ -1,29 +1,47 @@ %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it %% This file is in the public domain. -\version "2.11.38" +\version "2.13.1" \header { lsrtags = "pitches" - texidoc = " + +%% Translation of GIT committish: 48f804da6794a7bc8e7fdd4b1649f485b0b09d26 + 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" + + texidoc = " This Scheme-based snippet generates 24 random notes (or as many as -required), based on the current time (or any randomish number you might -wish to specify instead, so you can obtain the same random notes each -time): i.e., to get different random notes patterns, just change this -number. -" } -% begin verbatim +required), based on the current time (or any randomish number specified +instead, in order to obtain the same random notes each time): i.e., to +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-music 'SequentialMusic 'elements - (map (lambda x - (let ((idx (random 12 random-state))) - (make-music 'EventChord - 'elements (list (make-music 'NoteEvent - 'duration (ly:make-duration 2 0 1 1) - 'pitch (ly:make-pitch (quotient idx 7) - (remainder idx 7) - 0)))))) - (make-list 24))))) - } + { + #(let ((random-state (seed->random-state (current-time)))) + (ly:export + (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) + 'pitch (ly:make-pitch + (quotient idx 7) + (remainder idx 7) + 0)))))) + (make-list 24))))) + } }