August 13, 20232 yr (setf mat1 '(e g4 f leg gs4 fs4 mf ped a4 s f4 p bb4 e4 b4 eb4 c5 d4 cs5)) (setf matz '(h^e g4 f leg gs4 fs4 mf ped a4 q^s f4 p bb4 e4 b4 eb4 c5 d4 cs5)) (omn :duration mat1) ;=>(1/8 1/8 1/8 1/8 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16) (disassemble-omn mat1) ;=>(:length (1/8 1/8 1/8 1/8 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16) :pitch (g4 gs4 fs4 a4 f4 bb4 e4 b4 eb4 c5 d4 cs5) :velocity (f f mf mf p p p p p p p p) :articulation (- - - - - - - - - - - -) :leg (1 -11) :ped (-2 1 -9)) ; :duration missing (omn :duration matz) ;=>(1/8 1/2 1/2 1/2 1/16 1/4 1/4 1/4 1/4 1/4 1/4 1/4) (disassemble-omn matz) ;=>(:length (1/2 1/2 1/2 1/2 1/4 1/4 1/4 1/4 1/4 1/4 1/4 1/4) :pitch (g4 gs4 fs4 a4 f4 bb4 e4 b4 eb4 c5 d4 cs5) :velocity (f f mf mf p p p p p p p p) :duration (1/8 1/2 1/2 1/2 1/16 1/4 1/4 1/4 1/4 1/4 1/4 1/4) :articulation (- - - - - - - - - - - -) :leg (1 -11) :ped (-2 1 -9)) (omn-replace :duration '(1/8 1/8 1/8 1/8 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16) matz ) ;=> Error: There is no type named: :duration. ;Allowed TYPES: :length, :pitch, :velocity and :articulation
August 13, 20232 yr There is no need for :duration here but can be added. For edit etc... we use the dictum function. The omn-replace should be removed from the system. Possibily in the future the function will stop be documented.
August 13, 20232 yr Author I wrote my own little rk_omn-replace to see what could be done with :duration etc. Could you give an example how (rk_omn-replace :duration (rnd-sample 100 '(0.5 0.25 0.75 1.5 2)) (rnd-sample 100 mat)) could be done with dictum. How is :duration addressed in dictum? (defun rk_omn-replace ( type replacel omnl) (let* ( (len (omn :length omnl)) (pit (omn :pitch omnl)) (vel (omn :velocity omnl)) (dur (omn :duration omnl)) (arti (omn :articulation omnl)) (vleg (omn :leg omnl)) (vped (omn :ped omnl)) (rlen (if (equal type :length) replacel len)) (rpit (if (equal type :pitch) replacel pit)) (rvel (if (equal type :velocity) replacel vel)) (rdur (if (equal type :duration) replacel (if (equal 0 (search len dur )) (span pit rlen) dur))) (rarti (if (equal type :articulation) replacel arti)) (rleg (if (equal type :leg) replacel vleg)) (rped (if (equal type :ped) replacel vped)) ) (make-omn :length rlen :pitch rpit :velocity rvel :duration rdur :articulation rarti :leg rleg :ped rped :span (if (equal type :length) :pitch :length)) ) ) (setf mat1 '(e g4 f leg gs4 fs4 mf ped a4 s f4 p bb4 e4 b4 eb4 c5 d4 cs5)) (setf mat2 '((e g4 f leg gs4 fs4 mf ped a4) (s f4 p bb4 e4 b4 eb4 c5 d4 cs5))) (setf mat3 '(h^e g4 f leg gs4 fs4 mf ped a4 q^s f4 p bb4 e4 b4 eb4 c5 d4 cs5)) (setf mat mat1) (rk_omn-replace :length '(1/16 1/2 1/4 1 1/32 1/16 1/16 1/16 1/16 1/16 1/16 1/16 1/64 1/64) mat) (rk_omn-replace :length '(1/16 ) mat) (rk_omn-replace :pitch '(c4 d4) mat) (rk_omn-replace :duration '(0.5 0.25 0.75 2) mat) (rk_omn-replace :duration (rnd-sample 100 '(0.5 0.25 0.75 1.5 2)) (rnd-sample 100 mat)) (rk_omn-replace :duration (gen-noise 100) (rnd-sample 100 mat)) (rk_omn-replace :articulation '(stacc pizz) mat) (rk_omn-replace :leg '(-1 1 -3 1) mat) (rk_omn-replace :ped '(1) mat)
August 13, 20232 yr The new version works with :duration in omn-replace. :duration values are ratios and must be positive.
Create an account or sign in to comment