Wim Dijkgraaf Posted December 4, 2016 Share Posted December 4, 2016 Can't find the Opusmodus function to do the following: input: '(c4 e4 g4 bb4 c5) input: '(0 127) -> from - to range in midi note numbers output:'(c-1 e-1 g-1 bb-1 c0 e0 g0 bb0 c1 e1 g1 bb1 c2 e2 g2 bb2 ... c9 e9 g9) Many thanks in advance :-) Quote Link to comment Share on other sites More sharing options...
AM Posted December 4, 2016 Share Posted December 4, 2016 (gen-sieve '(c0 c9) (pitch-to-interval '(c4 e4 g4 bb4 c5)) :type :pitch) (gen-sieve (midi-to-pitch '(12 127)) (pitch-to-interval '(c4 e4 g4 bb4 c5)) :type :pitch) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; putted in a little function ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun gen-sequence (pitch-sequence midi-ambitus) (gen-sieve (midi-to-pitch midi-ambitus) (pitch-to-interval pitch-sequence) :type :pitch)) ;; eval (gen-sequence '(c4 e4 g4 bb4 c5) '(12 127)) ;; => (c0 e0 g0 bb0 c1 e1 g1 bb1 c2 e2 g2 bb2 c3 e3 g3 bb3 c4 e4 g4 bb4 c5 e5 g5 bb5 c6 e6 g6 bb6 c7 e7 g7 bb7 c8 e8 g8 bb8 c9 e9 g9) Quote Link to comment Share on other sites More sharing options...
AM Posted December 4, 2016 Share Posted December 4, 2016 version in (almost) pure lisp (only "midi-to-pitch" is OM) (defun gen-sieve-userdefined (ambitus.midi intervals) (midi-to-pitch (loop with interval.cnt = -1 for pitch = (first ambitus.midi) then (setq pitch (+ (nth interval.cnt intervals) pitch)) when (<= pitch (second ambitus.midi)) collect pitch into bag else return bag do (incf interval.cnt) when (= interval.cnt (length intervals)) do (setq interval.cnt 0)))) (gen-sieve-userdefined '(12 72) '(4 2 3)) Quote Link to comment Share on other sites More sharing options...
Wim Dijkgraaf Posted December 5, 2016 Author Share Posted December 5, 2016 Thanks for the inspiring answers!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.