Posted June 3, 20177 yr 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
June 3, 20177 yr When you suggest something please in context of a function: input (var) and output (result). This will enhance the communication.
June 4, 20177 yr Author 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))
Create an account or sign in to comment