OK
I have figured most of it out I think:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; THIS WORKS FOR playob:
;(define playloop1
(lambda (beat dur)
(playob 1 4 synth (+ 12 62) 40 dur) ;; first beat of a 4-beat bar
; (playob 2 4 synth 65 40 dur) ;; second beat of a 4-beat bar
; (playob 3 4 synth 69 40 dur) ;; 3rd beat of a 4-beat bar
; (playob 4 4 synth 72 40 dur) ;; 4th beat of a 4-beat bar
(callback (*metro* (+ beat (* 0.5 dur))) 'playloop1 (+ beat dur) dur)))
(playloop1 (*metro* 'get-beat 4) 1/4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This also works for playobs:
;; Although I don't understand the logic of the list numbers - which will play or not play?
(define playloop2
(lambda (beat dur)
(playobs (list 1 3 8) 8 synth 60 80 (* 1.0 dur))
; (playobs (list 2 4 7) 8 synth 67 70 (* 1.0 dur))
; (playobs (list 3 7) 8 synth 67 80 (* 0.2 dur))
; (playobs (list 2 7) 8 synth (random 70 80) 80 (* 1.9 dur))
(callback (*metro* (+ beat (* 0.4 dur))) 'playloop2 (+ beat dur) dur)))
(playloop2 (*metro* 'get-beat 8) 1/8)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; And the midi version mplayob into MicroFreak preset such as Preset 381 "Sardine":
(define *metro* (make-metro 40))
;; Define a loop to play a note on a specified beat:
(define mplayloop_freak1
(lambda (beat dur)
; ofst bar stream note vel dur ch
(mplayob 2 4 *mout_2_freak* 60 20 dur 0) ;; second beat of a 4-beat bar
; (mplayob 1 16 *mout_2_freak* 65 20 dur 0) ;; first beat of each 4th bar
; (mplayob 1 8 *mout_2_freak* 69 20 dur 0) ;; first beat of each 2nd bar
; (mplayob 1 12 *mout_2_freak* 72 20 dur 0) ;; first beat of a each 3rd bar
(callback (*metro* (+ beat (* 0.5 dur))) 'mplayloop_freak1 (+ beat dur) dur)))
(mplayloop_freak1 (*metro* 'get-beat 4) 1/4) ; play a quaver on specified beats of a 4 beat bar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; And the midi version mplayobs
;; This is mplayobs which works too but I can't follow the logic of the list numbers - which will play or not play?
(define freakPad1
(lambda (beat dur)))
(mplayobs '(1 4 5 6 ) 2 *mout_2_freak* (- (random (list 45 48 60 63 65 67 70 74 )) 7) (random '(10 120)) (* 3.2 dur) 0)
(callback (*metro* (+ beat (* 0.5 dur))) 'freakPad1 (+ beat dur) dur)))
(freakPad1 (*metro* 'get-beat 8) 1/4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PS. I had plenty of trouble getting the MicroFreak to respond to extempore velocity messages.
All notes were sounding the same volume whether I sent velocity numbers of 1 or 126.
Eventually with the help of Arturia Support I got the correct setting.
I will put further info on this and also #CC messaging in my Gist site soon.
Regards
George