Jump to content

add tuning float to single-events?


Recommended Posts

i need something like this 

((t b4 mp nr0 0.3) (-he.) (-whe..) (s. eb4 ppp nr3 0.5) (s g4 pp nr4 0) (t fs3 fff mute 0.3) (s. gs4 ppp nr6 0) (-e..))

so it's possible keep the overview which PITCH is TUNED and which is not... this way i can make precise assignments.

for example: i code a score with no microtonal structures, but afterwards i want to INSERT/OVERWRITE some pitches/liitle sections with microtonal... 

so the EVENT-thing seems better for me to keep the overview/control, then to have ALWAYS a seperate list. so i will write TUNING-float into  EVENTS, and a function GENERATES afterwards the correct LIST for tuning.

 

i will post the FUNCTIONS later..

 

Link to comment
Share on other sites

here is a solution - on attributes-level. next step will be to do/code it with "JOINED-attributes"... 

thanxs for tests and hints! 🙂

 



;;; -------------------------------------------------------------------------------------------------------------------
;;; -------------------------------------------------------------------------------------------------------------------
;;; -------------------------------------------------------------------------------------------------------------------
;;; this function adds CENTS or FLOATS to text-attributes, in this way you can notate 
;;; - have a look how ii's written in the score
;;; 

(defun add-cents-tuning-to-text-atrributes (&key (centlist nil) (type nil))
  (loop for i in (loop for x in (if (null centlist)
                                  (append (loop for i from 1 upto 99 collect i) (loop for i from 1 upto 99 collect (neg! i)))
                                  centlist)
                   collect (compress (list x 'ct)))
    append (add-text-attributes (list i (write-to-string (if (equal type :float) 
                                                           (float (/ (append (compress (if (equal (car (explode i)) '-)
                                                                                         (if (= (length (explode i)) 5)
                                                                                           (filter-first 3 (explode i))
                                                                                           (filter-first 2 (explode i)))
                                                                                         (if (= (length (explode i)) 4)
                                                                                           (filter-first 2 (explode i))
                                                                                           (filter-first 1 (explode i)))
                                                                                         ))) 100))
                                                           i))))))


;;; EXAMPLES

(add-cents-tuning-to-text-atrributes :type :float)
;; have a look to notation: cmd3
(-q -q  e c4 fff q c4 mf 50ct e c4 mf -40ct e c5 ff)


(add-cents-tuning-to-text-atrributes :type :cents) ;; cents are written
;; have a look to notation: cmd3
(-q -q  e c4 fff q c4 mf 50ct e c4 mf -40ct e c5 ff)


;;; -------------------------------------------------------------------------------------------------------------------
;;; -------------------------------------------------------------------------------------------------------------------
;;; -------------------------------------------------------------------------------------------------------------------
;;; this function get out all notated microtones for TUNING ;;; if there is nothing written it will be 0 cents (0)

(defun memberp (n liste)
  (not (equal 'nil (member n liste))))

(defun get-tuning-from-events (omnlist centlist)
  (loop for i in (single-events (length-rest-remove omnlist))
    when (memberp (car (last i)) centlist)
    do (setf n  (float (/ (append (compress (remove-if-not #'numberp (explode (car (last i)))))) 100)))
    and collect (if (equal (car (explode (car (last i)))) '-)
                  (* -1 n)
                  n)
    else collect 0))


(setf centlist (add-cents-tuning-to-text-atrributes :type :float))

;;; evaluate this and you will get the tuning-list
(get-tuning-from-events '(-q -q  e c4 fff q c4 mf 50ct e c4 mf -40ct e c5 ff) centlist)
=> (0 0.5 -0.4 0)  


 

Link to comment
Share on other sites

> Check the GET-RUNNING function. This will explain as well how to use floats in tuning.

 
Is that a new function? It is not available in my image.
 
Best,
Torsten

 

--------------------------

Unfortunately, evaluating add-cents-tuning-to-text-atrributes results in an error for me. 

 

> Error: ((= (length (explode i)) 5) (filter-first 3 (explode i))  (filter-first 2 (explode i))) can't be destructured against the lambda list (ccl::test true &optional false), because it contains 4 elements, and at most 3 are expected.
> While executing: (:internal ccl::nx1-compile-lambda), in process Listener-2(9).

Link to comment
Share on other sites

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