By Avner Dorman
Perhaps it would be possible to make the harmonic progression function have the option of counting the size based on the interval inputted by the user?
Under certain circumstances, it's useful to specify the size, but under other circumstances, it's a bit cumbersome.
I've made my own simple version that does this (but doesn't include all the options of the original function). I called bass-progression.
(defun bass-progression (progression steps scale) (harmonic-progression progression scale :size (loop for i in steps collect (+ (length i) 1)) :step steps))
(bass-progression '(0 1 2 3 4) '((2) (2 3) (2 3 4) (2 3 4 5)) '(c major)) => (c4e4 d4f4b4 e4g4d5g5 f4a4f5c6f6 g4b4)
i coded a little markov-program who changes the LEVEL-size if necessary to generate the number of values you want exactly.
it would be nice if someone could check/test the IDEA, and if it's correct and makes sense :-)
the markov starts on LEVEL 3 and tries to generate a number of output-levels with its TRANSITION-rules (level-3-rules), if it's possible (=generating the size) everything's fine. but if it's not possible, then the programm changes on LEVEL-2-rules ... if this is also not possible (to generate the size) then it changes to LEVEL 1...
here is the code...
;;;FUNCTION (defun gen-multiple-markov (sequence &key size) (let ((transitions-level-1 (gen-markov-transitions sequence :level 1)) ;; gen transition-table level-1 (transitions-level-2 (gen-markov-transitions sequence :level 2)) ;; gen transition-table level-2 (seq (gen-markov-from-transitions (gen-markov-transitions sequence :level 3) :size size))) ;; gen markov-seq on level-3 (if (< (length seq) size) ;; test if seq is too short (/= (length seq) size) (progn ;; if too short -> combine the last seq with a new one (level 2) (setq seq (append seq (gen-markov-from-transitions transitions-level-2 :size (- size (length seq)) :start (last seq)))) (if (< (length seq) size) ;; same test as above (append (append seq (gen-markov-from-transitions transitions-level-1 :size (- size (length seq)) :start (last seq)))) (append seq))) (append seq)))) ;;;TEST (gen-multiple-markov '(1 2 3 2 1 2 3 2 1 2 2 2 2 1 1 1 1 2 2 3 2 1 1 2) :size 36)
best wishes and THANX