Jump to content
Sign in to follow this  
AM

copy-omn-seq

Recommended Posts

could be an interesting idea for OPMO? (or already existing?)

greetings

andré

 

;;; a function (a sketch - i needed it for my momentary work) which filters 
;;; an OMN-sequence in a specific bar, from a specific beat, with a specific
;;; span. (in such a basic version all in quarters (bars/...))


(defun copy-omn-seq (omnseq bar/beat-list &key (measure '(4/4)) (span nil))
  (loop for i in bar/beat-list
    collect (loop repeat (if (null span)
                           (- (/ (car measure) 1/4) (1- (cadr i)))
                           span)
              for x = (1- (cadr i)) then (incf x)
              append (nth x (omn-to-measure (nth (1- (car i)) (omn-to-measure omnseq measure)) '(1/4))))))



(setf mat '((e c4 cs4 d4 ds4 e4 f4 fs4 g4) 
            (e c3 cs3 d3 ds3 e3 f3 fs3 g3) 
            (e c6 cs6 d6 ds6 e6 f6 fs6 g6)))



(copy-omn-seq mat '((2 3))) ;; bar 2 from beat 3 until end of bar
=> ((e e3 f3 e fs3 g3))

(copy-omn-seq mat '((1 1)) :span 2) ;; bar 1 from beat 1 for 2 quarters
=> ((e c4 cs4 e d4 ds4))

(copy-omn-seq mat '((1 2) (2 3) (3 4))) ;; same thing with more then ONE filterings
=> ((e d4 ds4 e e4 f4 e fs4 g4) (e e3 f3 e fs3 g3) (e fs6 g6))

(copy-omn-seq mat '((1 2) (2 3) (3 4)) :span 1) ;; same - every filtering with span 1
=> ((e d4 ds4) (e e3 f3) (e fs6 g6))

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×