|
From: | Flaming Hakama by Elaine |
Subject: | Re: Generate Random Pitches and Accidentals? |
Date: | Mon, 8 Jan 2018 17:47:57 -0800 |
On 1/8/2018 12:44 PM, Joshua Nichols wrote:
I'm looking for a resource that can generate pitches at different octaves, using different spellings, including accidentals.
Has someone already implemented this? I'm trying not to reinvent the wheel.
--Josh
#(define myList (list #{ b2 #} #{ c'2 #} #{ d'2 #} #{ e'2 #})) mySchemeFunction = #(define-music-function (parser location) () (list-ref myList (random (length myList)))) mySetSeed = #(define-void-function (parser location) () (let ((time (gettimeofday))) (set! *random-state* (seed->random-state (+ (car time) (cdr time)))))) { \mySetSeed c'4 \mySchemeFunction c' \mySchemeFunction c' \mySchemeFunction c' \mySchemeFunction c' \mySchemeFunction c' }
[Prev in Thread] | Current Thread | [Next in Thread] |