overtone

pfeodrippe 2024-10-23T11:45:43.209379Z

One QQ, what would be the equivalent of poll, but for the real value(s) instead of them being printed out into the console? I've tried the naive with-out-str as a quick hack, but I just have a empty string instead

pfeodrippe 2024-10-23T11:47:04.251729Z

Hunnn, ok, maybe listening to the event will work, https://github.com/overtone/overtone/blob/2b60c9b1d6948b53d2f598684f00aa26e9814904/src/overtone/sc/server.clj#L255, nice! Will try it later

diego.videco 2024-10-23T15:54:30.549959Z

I use send-reply coupled with on-event:

(defn run-get-signal-analysis
  [& {:keys [freq input-bus analysis-path]
      :or {freq 60}}]
  (timbre/debug "Initializing signal analyzer on bus:" input-bus)
  ((o/synth
    (let [input (o/in input-bus)]
      (o/send-reply (o/impulse freq) analysis-path
                    ;; TODO Probably use PeakFollower instead of amplitude
                    [(o/amplitude:kr input) (o/pitch:kr input)]
                    1)))))

(defn run-receive-analysis
  "Gets analysis from `in` 0 in almost real time
  and `conj`es the data into`analysis-history.
  NOTE: `run-get-signal-pitches` must be running`"
  [& {:keys [freq input-bus-name-keyword analysis-path]}]
  (let [handler-name (keyword (str (str/replace analysis-path #"/" "")
                                   "-handler"))]
    (o/on-event analysis-path
                (fn [data] (do-receive-analysis input-bus-name-keyword data))
                handler-name)
    handler-name))

pfeodrippe 2024-10-23T16:28:35.935909Z

Nice, thanks o/

pfeodrippe 2024-10-23T21:51:58.208929Z

Thanks for sharing it, I’ve done something similar using poll, https://github.com/pfeodrippe/vybe/commit/53a0d02622f7725cde5cb19b6954d9ac5a696a6f, it’s just for testing, so it’s fine o/