Veit Posted June 20, 2023 Posted June 20, 2023 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 Quote
AM Posted June 20, 2023 Posted June 20, 2023 ;;; 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 Veit 1 Quote
opmo Posted June 20, 2023 Posted June 20, 2023 (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) Stephane Boussuge, Veit and AM 3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.