[CM] markov-analyze allowing :period keyword
andersvi@extern.uio.no
andersvi@extern.uio.no
Mon, 19 Mar 2007 20:25:29 +0100
Heres a diff allowing 'markov-analyze to accept a :period keyword to
let resulting pattern-object have arbitrary period-length.
(Its useful in some cases of 'markov-analyze where the output is
included in various 'join, 'copier or similar)
-anders
Index: src/data.scm
===================================================================
RCS file: /cvsroot/commonmusic/cm/src/data.scm,v
retrieving revision 1.15
diff -u -r1.15 data.scm
--- src/data.scm 4 Sep 2006 00:55:59 -0000 1.15
+++ src/data.scm 19 Mar 2007 19:21:25 -0000
@@ -1056,6 +1056,7 @@
(pattern? #t) ; #f or pattern
sort?
(print-decimals 3)
+ (period nil)
key)
(let ((len (length seq))
(labels '()) ; the set of all outcomes
@@ -1194,7 +1195,7 @@
(pprint `(new markov of ', pat)))
(if pattern?
;; patterns not defined yet, cant use new or <markov>
- (make (find-class* 'markov) :of pat)
+ (make (find-class* 'markov) :of pat :for period)
(values))))))
(define (histogram numbers lo hi slots)