phil jones <
inte...@gmail.com> writes:
> Thanks Joakim,
>
> that looks interesting, but I'm not in a position to move to Docker at the moment.
You dont need docker, thats just for the network audio setup.
>
> And actually I'm trying to do something other than loop-based live-coding. More like sequencing an entire score.
Ok. I'm trying to do that with my sequencer as well. Thats one of the
uses for the interleave. You can have one pattern which does something,
like playing an arpeggio or another sequence, every 64th beat, etc.
But I'm starting to sound like a comercial. I'll stop :)
> I'm wondering if I have a problem with my metronome though :
>
>>(def m1 (metronome 120))
> #'tutorial.core/m1
>> (m1)
> 6
>> (m1)
> 12
>> (m1 20)
> 1.486744099713E12
>> (m1 24)
> 1.486744101713E12
>
> Does this look right for a metronome interaction in Overtone?
>
> What is it that (m1 n) produces? The timestamp of n seconds (or n ticks) ahead of "now" or n ticks ahead of when the metronome was created?
>
> For a program that isn't looping, but just generating a sequence which should be played when I execute the program, how do I know that I'm actually scheduling the events for the future and not, say, the past ...
>
> right now I'm doing something like this :
>
> (doseq [n melody]
> (at (nome (:start n)) (inst (:pitch n)))
> (println (nome (:start n)) (nome 0))
> ) )
> ))
>
> but no sound is coming out. So one thing I'm considering is if the timestamps are being generated correctly.
Heres some tutorial code that maybe explains it.
As an aside, I've tried other approaches than this temporal recursion
aproach, and they dont seem to work well.
(defonce metro (metronome 240))
;; #+END_SRC
;; we use it as follows:
;; #+BEGIN_SRC clojure
(metro) ; current beat number
(metro 3) ; timestamp of beat number 3
;; #+END_SRC
;; if we rewrite loop-beats using a metronome, it would look like
;; this:
;; #+BEGIN_SRC clojure
(defn metro-beats [m beat-num]
(at (m (+ 0 beat-num)) (kick))
(at (m (+ 1 beat-num)) (hat))
(at (m (+ 2 beat-num)) (kick))
(at (m (+ 3 beat-num)) (hat))
(apply-at (m (+ 4 beat-num)) metro-beats m (+ 4 beat-num) [])
)
(comment
(metro-beats metro (metro))
)
Also, I found that rescheduling the actuall voice call improves
jitter. See below.
(defn play-drums-metro2 [m beat-num]
"start playing drums, using m as metro"
;;play drums using a metronome strategy, which has advantages over the periodic strategy
;; 1st reschedule next call to the sequencer
(apply-at (m (+ 1 beat-num))
play-drums-metro2
m
(+ 1 beat-num)
[])
;; 2nd schedule the drum voice
(at (m beat-num)(drum-fn-globalbeat))
;;3d step global counters
(dosync (ref-set *beat-count (inc @*beat-count) ))
)