AM Posted June 3, 2017 Share Posted June 3, 2017 an idea/extension could be to "filter-events" not only by singular pitches/lengths... but also by motifs, means sequences => "filter a PATTERN" function-name: filter-pattern Quote Link to comment Share on other sites More sharing options...
opmo Posted June 3, 2017 Share Posted June 3, 2017 When you suggest something please in context of a function: input (var) and output (result). This will enhance the communication. Quote Link to comment Share on other sites More sharing options...
AM Posted June 4, 2017 Author Share Posted June 4, 2017 violà, take it as a sketch... ;;; like this, but the question is how to structure the input-values ;;; the kind of structure decides about output... (defun filter-pattern (pattern omn-list) (progn (if (atom (car pattern)) (setf pattern (mapcar #'list pattern))) (flatten (loop for i in (single-events omn-list) with cnt = 0 when (pattern-matchp i (nth cnt pattern)) collect i and do (incf cnt) else collect (neg! (omn :length i)) when (= cnt (length pattern)) do (setf cnt 0))))) (setf seq '(e c4 mp -e fermata e. d4 -h e. c4 e e4)) (filter-pattern (rnd-sample-seq 2 (single-events seq)) '(e c4 mp -e fermata e. d4 -h e. c4 e e4)) (filter-pattern '((e. c4) (e4)) '(e c4 mp -e fermata e. d4 -h e. c4 e e4)) (filter-pattern '((c4) (e4)) '(e c4 mp -e fermata e. d4 -h e. c4 e e4)) (filter-pattern '(c4 e4) '(e c4 mp -e fermata e. d4 -h e. c4 e e4)) 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.