June 20, 20232 yr Hey everyone, I want to create movement from f1 to c1 in a timeframe of 5 seconds. How can I generate random note values until 5 seconds are reached? Repetitions of notes should also be possible. Here's what I got so far: (make-omn :length (rnd-sample 6 '(s -s e q)) :pitch (midi-to-pitch '(65 64 63 62 61 60))) Thanks in advance, Veit
June 20, 20232 yr ;;; quick-function (defun make-seq (&key (prob 0.5) (possible-pitches (make-scale 'c4 11))) ;; prob = length/rest-weight (make-omn :pitch (rnd-sample 10 possible-pitches) :length (gen-length (loop for i in (rnd-sum-to-size 20 10 '(1 2 3 4 5)) collect (if (probp prob) (* -1 i) i)) '1/16) :span :length)) ;;; EVAL (make-seq) (make-seq :possible-pitches (midi-to-pitch (gen-integer 10 110))) ;; with rnd-pitches of course... with 60bpm
June 20, 20232 yr (setf pitches (rnd-sample 12 (midi-to-pitch '(65 64 63 62 61 60)))) If the tempo is 60 then the span is 5/4 etc... (setf lengths (length-span 5/4 (rnd-sample 6 '(s -s e. q)))) (make-omn :length lengths :pitch pitches)
Create an account or sign in to comment