Jump to content

Featured Replies

Posted

have fun...

greetings

andré

 

;;; here is a MULTI-GEN-SORT -------------------------
;;; you could interlace different processes of SORTING


(defun multi-gen-sort (lists &key (types nil) (sorts '>)  (steps nil) (seed nil))
  (let* ((sorted-lists (loop 
                        for i in lists
                        for cnt = 0 then (incf cnt)
                        collect (gen-sort i 
                                          :type (if (listp types)
                                                  (nth cnt types)
                                                  types)
                                          :sort (if (listp sorts)
                                                  (nth cnt sorts)
                                                  sorts)
                                          :step (if (listp steps)
                                                  (nth cnt steps)
                                                  steps)
                                          :seed seed))))

    (flatten (loop repeat (find-max (loop for i in sorted-lists collect (length i)))
               for cnt = 0 then (incf cnt)
               collect (loop for i in (reverse sorted-lists)
                         collect (nth cnt i))))))
    

;;; some examples


(pitch-list-plot
 (flatten 
  (multi-gen-sort (list (expand-tonality '(c5 'chromatic)) 
                        (expand-tonality '(c3 'chromatic))
                        (expand-tonality '(c4 'chromatic))
                        (expand-tonality '(c6 'chromatic)))
                  :types '(selection insertion min-max selection)
                  :sorts '(> > > >)
                  :steps '(7 6 7 3)))
 :join-points t :point-radius 0 :style :fill)


(pitch-list-plot
 (flatten 
  (multi-gen-sort (list (rnd-order (expand-tonality '(c5 'chromatic))) 
                        (rnd-order (expand-tonality '(c3 'chromatic)))
                        (rnd-order (expand-tonality '(c6 'chromatic)))
                        (rnd-order (expand-tonality '(c4 'chromatic))))
                  :types '(insertion selection min-max selection)
                  :sorts '(> < < >)
                  :steps '(5 3 7 nil)))
 :join-points t :point-radius 0 :style :fill)



(pitch-list-plot
 (flatten 
  (multi-gen-sort (list (rnd-order (expand-tonality '(c6 'chromatic))) 
                        (rnd-order (expand-tonality '(c5 'chromatic)))
                        (rnd-order (expand-tonality '(c4 'chromatic)))
                        (rnd-order (expand-tonality '(c3 'chromatic))))
                  :types '(selection nil insertion min-max)
                  :sorts '(< > < >)
                  :steps '(4 4 4 4)))
 :join-points t :point-radius 0 :style :fill)



(pitch-list-plot
 (filter-repeat 1
                (flatten 
                 
                 (multi-gen-sort (list (rnd-order (expand-tonality '(c4 'chromatic))) 
                                       (rnd-order (expand-tonality '(cs4 'chromatic)))
                                       (rnd-order (expand-tonality '(d4 'chromatic)))
                                       (rnd-order (expand-tonality '(ds4 'chromatic))))
                                 :types '(insertion selection min-max selection)
                                 :sorts '(> < > <)
                                 :steps '(5 5 5 5))))
                :join-points t :point-radius 0 :style :fill)

                                   
                                   
;;; a SORT2 :-)

(pitch-list-plot
 (flatten 
  (gen-sort
   (flatten 
    (multi-gen-sort (list (rnd-order (expand-tonality '(c6 'chromatic))) 
                          (rnd-order (expand-tonality '(c5 'chromatic)))
                          (rnd-order (expand-tonality '(c4 'chromatic)))
                          (rnd-order (expand-tonality '(c3 'chromatic))))
                    :types '(selection nil insertion min-max)
                    :sorts '(< > > >)
                    :steps '(3 3 3 3)))
   :type 'insertion
   :step 7
   :sort '>))
 :join-points t :point-radius 0 :style :fill)

 

some examples:

 

exp1.jpeg

 

exp2.jpeg

 

exp4.jpeg

 

 

 

a sorted mulit-gen-sort:

 

exp3.jpeg

 

 

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy