-
-
-
-
-
-
How can I apply the ambitus function to specific measures?
How about functions with more than one argument? Jesper
-
-
How can I apply the ambitus function to specific measures?
There's also a more generic option. Jesper (maybe-section (lambda (x) (ambitus '(c7 c8) x)) mat '(23 24 30)) (maybe-section (lambda (x) (pitch-transpose 12 x)) mat '(23 24 30))
-
-
How can I apply the ambitus function to specific measures?
Like this, I think. Jesper (setf test (ambitus '(c7 c8) mat :section '(23 24 30)))
-
-
-
harmonics function
Don't know if this simple function will be of use for now. Jesper ;; for single pitches (defun harmonics2 (start-pitch length &key (partial 1) quantize) (let ((sp (pitch-to-hertz start-pitch)) (part (max partial 1)) res) (setf res (loop for i from part to (+ length (1- part)) collect (* i sp))) (if quantize (pitch-to-hertz (micro-quantize (hertz-to-pitch res) :quantize quantize)) res))) (harmonics2 'a2 8) =>(110.0 220.0 330.0 440.0 550.0 660.0 770.0 880.0) (harmonics2 'a2 8 :partial 4) =>(440.0 550.0 660.0 770.0 880.0 990.0 1100.0 1210.0) (harmonics2 'a2 8 :partial 1 :quantize 1/8) =>(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0) (mapcar (lambda (x) (harmonics2 x 4)) '(a2 c3 d3)) =>((110.0 220.0 330.0 440.0) (130.81278 261.62555 392.43832 523.2511) (146.83238 293.66476 440.49713 587.3295))
-
Bach Chorale
Can't you use merge-voices? From the doc: (setf voice1 '(w c2) voice2 '(h c4 d4) voice3 '(q g5 g5 g5 g5)) (merge-voices voice1 voice2 voice3) =>(z^w c2 z^h c4 q g5 g5 z^h d4 q g5 g5) Jesper
- harmonics function
-
Stephane Boussuge reacted to a post in a topic:
A fast fastway to count how many pitches are present in an omn list
-
A fast fastway to count how many pitches are present in an omn list
(get-count omn :length :note :sum t) If you don't want to count all notes in a tie-chain, you could do this first. (setf tst (omn-merge-ties (flatten-omn omn))) (get-count tst :length :note :sum t) Jesper
-
- harmonics function
- harmonics function
-
-
Looking for a function which could divide a serie of length into a defined time signature
Does this work for you? Jesper (omn-to-time-signature '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/2 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/4 1/2 1/2 ) '(4 4)) Or perhaps rather this. (setf foo (omn-to-time-signature '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/2 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/4 1/2 1/2) '(1 4))) (setf quux (omn-to-time-signature foo '(4 4))) Or a simple function. (defun divide-by (seq div &optional (time-sig '(4 4))) (flet ((div-by (val div) (let ((len (floor val div))) (if (> val div) (gen-repeat len (/ val len)) val)))) (omn-to-time-signature (loop for x in (omn-encode (flatten seq)) collect (div-by x div)) time-sig))) (setf mat '(1/4 1/8 1/8 1/2 1/4 1/8 1/8 1/1 1/4 1/4 -1/8 1/8 1/8 1/8 1/8 1/8 1/4 -1/2 1/2)) (divide-by mat 1/4 '(4 4)) =>((1/4 1/8 1/8 1/4 1/4) (1/4 1/8 1/8 1/4 1/4) (1/4 1/4 1/4 1/4) (-1/8 1/8 1/8 1/8 1/8 1/8 1/4) (-1/2 1/4 1/4)) (divide-by mat 1/6) =>((1/4 1/8 1/8 1/6 1/6 1/6) (1/4 1/8 1/8 1/6 1/6 1/6) (1/6 1/6 1/6 1/4 1/4) (-1/8 1/8 1/8 1/8 1/8 1/8 1/4) (-1/2 1/6 1/6 1/6))
-
-
4.0.30748
Thanks, Janusz. Jesper
-
4.0.30748
-
david reacted to a post in a topic:
Display Issues with Quintuplets and Septuplets with Rests in OMN
-
Display Issues with Quintuplets and Septuplets with Rests in OMN
As a function. Jesper (defun foo (pitches max &optional (div 3)) (let (res) (loop for i from 1 to max collect (gen-repeat i (cons (/ 1/4 i) (make-list (1- div) :initial-element '-))) into rhy collect (butlast pitches (- max i)) into mel finally (setf res (make-omn :length rhy :pitch mel)) (return (omn-to-time-signature (append res (reverse res)) (list div 4)))))) (foo '(e4 fs4 g4 fs4 g4 a4 g4 a4) 8 3) (foo '(e4 fs4 g4 fs4 g4 a4 g4 a4) 6 4) (foo '(e4 fs4 g4 fs4 g4 a4 g4 a4) 7 5)
-
david reacted to a post in a topic:
Display Issues with Quintuplets and Septuplets with Rests in OMN
-
david reacted to a post in a topic:
Display Issues with Quintuplets and Septuplets with Rests in OMN
-
david reacted to a post in a topic:
Display Issues with Quintuplets and Septuplets with Rests in OMN
-
Display Issues with Quintuplets and Septuplets with Rests in OMN
-
Display Issues with Quintuplets and Septuplets with Rests in OMN
Same with this. Jesper (setf accent (loop for i from 1 to 8 collect (gen-repeat i (list (/ 1/4 i) (/ -1/2 i)))))
jesele
Members
-
Joined
-
Last visited