X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=2ff76a4ed4fd6ece2a4ea9c5f43b497c8efbf687;hb=061c50f352513cc942c1741d5b9429de5ae52b1d;hp=f0fae52952c2d604e5d06e6ef1a16cc182e2e3d1;hpb=8f6e4647c475ad911e15fdc26493f77e6c4a6088;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index f0fae52952..2ff76a4ed4 100644 --- a/Documentation/snippets/generating-random-notes.ly +++ b/Documentation/snippets/generating-random-notes.ly @@ -1,12 +1,15 @@ -%% 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.16" +\version "2.15.40" \header { - lsrtags = "pitches" + lsrtags = "pitches, scheme-language, really-cool" -%% Translation of GIT committish: 00ef2ac3dd16e21c9ffdffaa4d6d043a3f1a76e6 +%% Translation of GIT committish: b482c3e5b56c3841a88d957e0ca12964bd3e64fa texidoces = " Este fragmento de código basado en Scheme genera 24 notas aleatorias (o tantas como se necesiten), basándose en la @@ -18,6 +21,17 @@ sólo tiene que modificar este número. " doctitlees = "Generación de notas aleatorias" +%% Translation of GIT committish: 57f9346bb030f49336a858fcbf1519366fe56454 + texidocfr = " +Le fragment de code Scheme ci-dessous génère aléatoirement 24 notes +(ou autant que nécessaire), à partir de l'heure courante (ou un nombre +quelconque donné en argument, afin d'obtenir toujours les mêmes notes +aléatoires). Pour obtenir une autre série de notes, il suffit de +changer ce nombre. + +" + doctitlefr = "Génération de notes aléatoires" + texidoc = " This Scheme-based snippet generates 24 random notes (or as many as required), based on the current time (or any randomish number specified @@ -28,11 +42,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 +57,6 @@ get different random note patterns, just change this number. (quotient idx 7) (remainder idx 7) 0)))))) - (make-list 24))))) + (make-list 24)))) } }