AM Posted April 9, 2017 Share Posted April 9, 2017 ...an idea to manipulate lists of pitches/rhythms by "sampling" ;;; subfunction (defun sampling-list (liste start-position seq-length) (loop repeat seq-length for cnt = start-position then (incf cnt) when (= cnt (length liste)) do (setf cnt 0) collect (nth cnt liste))) ;;; MAIN: ;;; an value-list will be sampled by start-pos-list in the length of seq-length-list (defun structural-interferences (n value-list start-pos-list seq-length-list) (let ((start-pos-list (remove (length value-list) start-pos-list :test #'<))) (loop repeat n for start-pos = 0 then (incf start-pos) for seq-length = 0 then (incf seq-length) when (= start-pos (length start-pos-list)) do (setf start-pos 1) when (= seq-length (length seq-length-list)) do (setf seq-length 0) append (sampling-list value-list (nth start-pos start-pos-list) (nth seq-length seq-length-list))))) ;;something (list-plot (structural-interferences 21 '(1 2 3 4 5) '(0 1 2 3 4 5 6 7 8 9) '(1 3 2 4 1 2 2 3 1 1 1 1)) :point-radius 1 :style :fill) ;;"self-similar" (list-plot (structural-interferences 21 '(3 2 1 5 4 2) '(2 1 0 4 3 1) '(3 2 1 5 4 2)) :point-radius 1 :style :fill) lviklund 1 Quote Link to comment Share on other sites More sharing options...
opmo Posted April 9, 2017 Share Posted April 9, 2017 SAMPLING-LIST function is missing :-) Quote Link to comment Share on other sites More sharing options...
AM Posted April 9, 2017 Author Share Posted April 9, 2017 edited now :-) Quote Link to comment Share on other sites More sharing options...
opmo Posted April 10, 2017 Share Posted April 10, 2017 Check the GEN-SURROUND function Quote Link to comment Share on other sites More sharing options...
AM Posted April 10, 2017 Author Share Posted April 10, 2017 ... i think sometimes i'm faster when i code it for myself then to search in the library :-) Quote Link to comment Share on other sites More sharing options...
opmo Posted April 10, 2017 Share Posted April 10, 2017 I would advise to search the library, you might find thinks you never thought of Stephane Boussuge 1 Quote Link to comment Share on other sites More sharing options...
AM Posted April 10, 2017 Author Share Posted April 10, 2017 i work in another way... the tools has to follow the ideas and not my ideas are "what the tools can do" ;-) Quote Link to comment Share on other sites More sharing options...
torstenanders Posted April 13, 2017 Share Posted April 13, 2017 > I would advise to search the library, you might find thinks you never thought of What strategies do you suggest for searching the rather large library of existing functions. Though this question sounds a bit simple, it really mean it seriously. The search facility only searches through function names, AFAIK, and a name like gen-surround is not exactly easy to guess. What other strategies could be there for finding relevant functions? Better support for finding relevant functions could perhaps be an important addition of version 2? Best, Torsten added 8 minutes later Dear André, > sampling-list BTW: The built-in Common Lisp function subseq is very similar, see http://www.lispworks.com/documentation/HyperSpec/Body/f_subseq.htm subseq is likely much faster than sampling-list, if that is important: calling nth very often in sampling-list needs to go through the input list again and again. Best, Torsten AM 1 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.