;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This in v9 would play a 60 note and then random walk either side of that note.
;; Now in v10.2 the note just climbs higher and higher - never comes back.
(*metro* 'set-tempo 80)
;;
(define node1
(lambda (beat pitch dlst)
(println pitch)
(play piano1 pitch (cosr 80 20 8) 2.2 0)
(callback (*metro* (+ beat (* .9 (car dlst))))
'node1
(+ beat (car dlst))
(pc:relative pitch (random '( -1 1 0 )) scale) ;; the -1 results in a 0 !!
(if (null? (cdr dlst))
(make-rhythm 4 2 .9 '(1/3 1/3 1/2 1/2 1/2))
(cdr dlst)))))
(node1 (*metro* 'get-beat 4) 60 '(1/2 1/3 1/3 1/2 1/3 1) )
; Random walk 60, 60, 62, 60, 60, 60, 62, 64, 64, 62, 62, 60, 62, 64, 62, 62, 60, 59, on old version 9
;; But on version 10.2 the pitch just keeps climbing.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Here are some tests
(println scale) ;; (0 2 4 5 6 8 10 11)
(println (pc:relative 68 (random '(-1 1 0)) scale)) ;; 66 68 70 on v9.0 .... but 68 and 70 only on v10.2
(println (random '( -1 1 0 ))) ;; 0 1 -1 on both v9.0 and v10.2
(pc:relative 64 -1 '(0 2 4 5 7 9 11)) ;; 63 on v9.0 .... but 64 on v10.2
(pc:relative 64 -2 '(0 2 4 5 7 9 11)) ;; 60 on v9.0 .... but 64 on v10.2
(pc:relative 64 1 '(0 2 4 5 7 9 11)) ;; 65 on both v9.0 and v10.2
(pc:relative 64 0 '(0 2 4 5 7 9 11)) ;; 64 on both v9.0 and v10.2
;; I note that pc:relative makes use of real->integer in its define. As do most pc:* defs.
(real->integer 4.7) ;; 4 in both v9.0 and v10.2
(real->integer -4.7) ;; -4 in v9.0 but 0 in v10.2
;; Maybe real->integer is the source of problems for other pc:* I haven't yet tested.
;;
Regards
George