def hit?

13 views
Skip to first unread message

joa...@verona.se

unread,
May 4, 2013, 6:31:50 PM5/4/13
to over...@googlegroups.com
Hello,

I was looking at overtone.music.drums
and noticed an error on this expression: (hit voice :pitch 50 :dur
200)

I can't seem to find the definiton of "hit" anywhere, but it is
referenced a couple of times in the src tree.

Am I missing some bits?
--
Joakim Verona

Sam Aaron

unread,
May 5, 2013, 1:03:03 AM5/5/13
to over...@googlegroups.com
Hi Joakim,

thanks for finding this - hit was deprecated a long time ago - I'll update this before the next release.

Instead of using hit, you can just call synths you've defined with defsynth as a function to trigger them.

Sam

---
http://sam.aaron.name
> --
> You received this message because you are subscribed to the Google Groups "Overtone" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to overtone+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

joa...@verona.se

unread,
May 5, 2013, 4:26:56 AM5/5/13
to over...@googlegroups.com
Sam Aaron <sama...@gmail.com> writes:

> Hi Joakim,
>
> thanks for finding this - hit was deprecated a long time ago - I'll update this before the next release.
>
> Instead of using hit, you can just call synths you've defined with defsynth as a function to trigger them.

Yes, I changed the "drums.clj" around a bit like this:

(def amen-beat
{
:C '[ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - X - - - - - ]
:R '[ x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - x - X - x - x - x - x - x - x - x - - - x - x - ]
:S '[ - - - - o - - o - o - - o - - o - - - - o - - o - o - - o - - o - - - - o - - o - o - - - - o - - o - - o - - o - o - - - - o - ]
:B '[ o - o - - - - - - - o o - - - - o - o - - - - - - - o o - - - - o - o - - - - - - - o - - - - - - - o o - - - - - - o - - - - - ]
}
)

(definst psybass2
[note 60 amp 0.7 attack 0.001 release 0.2 numharm 200]
(let [freq (midicps note)
env (env-gen (perc attack release) :action FREE)
f-env (+ freq (* 3 freq (env-gen (perc 0.012 (- release 0.1)))))
bfreq (/ freq 2)
sig (apply +
(concat
(g-verb
(blip [freq note ] :numharm numharm))))
audio (* amp env sig)]
audio))


(def my-drums
{:C (fn [x] (hat-demo))
:R (fn [x] (psybass2 60 :numharm (rand-int-range 10 200))(closed-hat) (haziti-clap))
:S (fn [x] (noise-snare)(dub-kick))
:B (fn [x] (kick)(tom)(quick-kick))
}
)

(comment
(inst-fx! psybass2 fx-chorus)
(inst-fx! psybass2 fx-reverb)
(inst-fx! psybass2 fx-echo)
(clear-fx psybass2)

(inst-fx! hat-demo fx-echo)
)

;;(ref-set *drums amen-beat)

(def *drums (ref amen-beat))
(def *drum-count (ref 0))

(defn drum [voice pattern]
(dosync (alter *drums conj [voice pattern])))

(defn clear-drums []
(dosync (ref-set *drums [])))

(defn play-drums [tempo beat-count]
(periodic tempo
(fn []

(drum-fn beat-count)
)))

(defn drum-fn [beat-count]
(let [num (rand)
i @*drum-count]
(doseq [[voice pattern] amen-beat ;@*drums
]
(println voice (nth pattern i))

(if (not (= '- (nth pattern i)))
(do
;(kick)
(apply (get my-drums voice) [(nth pattern i)])
)
)

)

(dosync (ref-set *drum-count (mod (inc i) beat-count)))))



>
> Sam
>
> ---
> http://sam.aaron.name
>
> On 4 May 2013, at 23:31, joa...@verona.se wrote:
>
>> Hello,
>>
>> I was looking at overtone.music.drums
>> and noticed an error on this expression: (hit voice :pitch 50 :dur
>> 200)
>>
>> I can't seem to find the definiton of "hit" anywhere, but it is
>> referenced a couple of times in the src tree.
>>
>> Am I missing some bits?
>> --
>> Joakim Verona
>>
>> --
>> You received this message because you are subscribed to the Google Groups "Overtone" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to overtone+u...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.>
>>

--
Joakim Verona
Reply all
Reply to author
Forward
0 new messages