lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating random notes


From: Philip Rhoades
Subject: Re: Generating random notes
Date: Mon, 13 Jan 2014 23:31:49 +1100
User-agent: Roundcube Webmail/0.9.2

David,


On 2014-01-13 22:06, David Kastrup wrote:
Philip Rhoades <address@hidden> writes:

People,

I am doing my own Alternative Notation for Classical Guitar and with a
lot of help from Paul Morris am making good progress.  I was about to
write a little Ruby script to generate random notes (400 == 100 bars)
within different ranges to practise jumping around the fretboard but
it occurred to me that I might be able to do this in Scheme - which
would help further the cause of learning for Lilypond.  Is this a
sensible thing to do or should I just do it with ruby and plug the
results into a .ly file?

A bit sloppy:

\new Voice {
$@(let ((notes (ly:music-property #{ <c des d es e f fis g gis a bes b> #}
                                    'elements)))
(map (lambda (x) (list-ref notes (random (length notes)))) (iota 400)))
}


Amazing!  OK, now to try and understand it . .

Thanks!

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW      2001
Australia
E-mail:  address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]