Jump to content

FFTH / length


Recommended Posts

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; subfunction

(defun reset-integer-sequence  (alist &key (offset 0) (flatten nil))
  (let ((min (find-min (flatten alist))))
    (progn 
      (setf alist (cond ((listp (car alist))
                         (loop for j in alist
                           collect (loop for i in j
                                     collect (+ (- i min) offset))))
                        (t (loop for i in alist
                             collect (+ (- i min) offset)))))
      (if (equal flatten t)
        (flatten alist)
        alist))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; check it out
;; command-1

(list-plot (length-staccato (gen-length
                             (reset-integer-sequence
                              (ffth 6 0.075 (x-b (rnd-order '(44 52 22 23 13 44 68 6 22 9 73 28 68)) 3)
                                    :type 'integer))
                             1/64)
                            :value 1/64)
            :point-radius 2 :join-points t)


(list-plot (length-staccato (gen-length
                             (reset-integer-sequence
                              (ffth 4 0.075 (x-b (rnd-order '(44 52 22 23 13 44 68 6 22 9 73 28 68)) 3)
                                    :type 'integer))
                             1/64)
                            :value 1/64)
            :point-radius 2 :join-points t)

 

with 4 voices....

eval -> (command-3)

 

 

(defun reset-integer-sequence  (alist &key (offset 0) (flatten nil))
  (let ((min (find-min (flatten alist))))
    (progn 
      (setf alist (cond ((listp (car alist))
                         (loop for j in alist
                           collect (loop for i in j
                                     collect (+ (- i min) offset))))
                        (t (loop for i in alist
                             collect (+ (- i min) offset)))))
      (if (equal flatten t)
        (flatten alist)
        alist))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setf s1 (make-omn :pitch '(c1)
                   :length (length-staccato (gen-length
                                             (reset-integer-sequence
                                              (ffth 6 0.075 (x-b (rnd-order '(44 52 22 23 68 6 22 9 73 28 68)) 3)
                                                    :type 'integer)
                                              :offset 4)
                                             1/64)
                                            :value 1/32))

      s2 (make-omn :pitch '(cs4)
                        :length (length-staccato (gen-length
                                                  (reset-integer-sequence
                                                   (ffth 6 0.075 (x-b (rnd-order '(44 52 22 23 13 44 68 9 73 28 68)) 3)
                                                         :type 'integer)
                                                   :offset 4)
                                                  1/64)
                                                 :value 1/32))

      s3 (make-omn :pitch '(d5)
                   :length (length-staccato (gen-length
                                             (reset-integer-sequence
                                              (ffth 6 0.075 (x-b (rnd-order '(44 52 22 23 68 6 22 9 73 28 68)) 3)
                                                    :type 'integer)
                                              :offset 4)
                                             1/64)
                                            :value 1/32))

      s4 (make-omn :pitch '(ds7)
                   :length (length-staccato (gen-length
                                             (reset-integer-sequence
                                              (ffth 6 0.075 (x-b (rnd-order '(44 52 22 23 68 6 22 9 73 28 68)) 3)
                                                    :type 'integer)
                                              :offset 4)
                                             1/64)
                                            :value 1/32)))


(omn-to-time-signature (merge-voices s1 s2 s3 s4) '(4 4))

 

Link to comment
Share on other sites

  • opmo changed the title to FFTH / length

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy