X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fgenerating-random-notes.ly;h=2ff76a4ed4fd6ece2a4ea9c5f43b497c8efbf687;hb=061c50f352513cc942c1741d5b9429de5ae52b1d;hp=983823ba4a2ad50ee5beec33d776500c0e274dfa;hpb=f86f00c1a8de0f034ba48506de2801c074bd5422;p=lilypond.git diff --git a/Documentation/snippets/generating-random-notes.ly b/Documentation/snippets/generating-random-notes.ly index 983823ba4a..2ff76a4ed4 100644 --- a/Documentation/snippets/generating-random-notes.ly +++ b/Documentation/snippets/generating-random-notes.ly @@ -4,12 +4,12 @@ %% and then run scripts/auxiliar/makelsr.py %% %% This file is in the public domain. -\version "2.12.2" +\version "2.15.40" \header { - lsrtags = "pitches" + lsrtags = "pitches, scheme-language, really-cool" -%% Translation of GIT committish: 91eeed36c877fe625d957437d22081721c8c6345 +%% 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 @@ -21,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 @@ -31,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 @@ -46,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)))) } }