%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************



\paper {
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
}

\layout {
  
}





% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "snippets/generating-random-notes.ly"
\sourcefileline 0
%% 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.21.2"

\header {
%% Translation of GIT committish: a8a85e19654e46d725563e6deba44083ef137a2c
  texidocja = "
この Scheme ベースのスニペットは、24 の (あるいは必要な分の) ランダムな@c
音符を、現在の時間から (あるいは毎回同じ結果を得るために指定した数から)
生成します。別の音符列を生成したい場合は、数字を変更します。
"
  doctitleja = "ランダムな音符を生成する"

%% Translation of GIT committish: 40c8c21afe3d623ddd4b6a131dce9fe8409dc9e9
  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"

%% Translation of GIT committish: 8ffecf6be17c6ec2ff87cf31873121a8cce29b09
  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
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))))
       (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))))
  }
}



% ****************************************************************
% end ly snippet
% ****************************************************************
