【问题标题】:Capture USB-microphone in clojure overtone在 clojure 泛音中捕获 USB 麦克风
【发布时间】:2017-04-11 17:31:19
【问题描述】:

如何在 Overtone 中使用 USB 麦克风? 以下是使用普通 3.5 毫米麦克风的示例:

(ns insane-noises.vocoder)
(use 'overtone.live)

(def a (buffer 2048))
(def b (buffer 2048))

(demo 5
      (let [input  (sound-in 0); mic
            src    (white-noise) ; synth - try replacing this with other sound sources
            formed (pv-mul (fft a input) (fft b src))
            audio  (ifft formed)]
          (pan2 (* 0.1 audio))))

当我尝试 (sound-in 0) 时,将 0 更改为 1、2、3... - 没有任何效果。 我的麦克风在 skype 等所有应用程序中都能正常工作。

【问题讨论】:

  • 大家都明白了吗?

标签: clojure usb microphone overtone


【解决方案1】:

我刚刚尝试复制它。它只是间歇性地工作。我跑了

(event-debug-on) 

在 REPL 中,让我看到 Overtone 和 SuperCollider 之间的 OSC 通信。

根据我是使用 overtone.core 并连接到外部服务器,还是使用 overtone.live,它会以两种不同的方式失败。

使用 overtone.live,我可以很好地分配缓冲区,但是当我运行演示函数时,我得到:

event:  [:overtone :osc-msg-received] (:msg {:path "/done", :type-tag "s", :args ("/d_recv")}) 

event:  "/done" (:path "/done" :args ("/d_recv")) 

event:  [:overtone :osc-msg-received] (:msg {:path "/synced", :type-tag "i", :args (18)}) 

event:  "/synced" (:path "/synced" :args (18)) 

zombified - calling shutdown handler
event:  [:overtone :osc-msg-received] (:msg {:path "/n_go", :type-tag "iiiii", :args (34 7 -1 -1 0)}) 

event:  "/n_go" (:path "/n_go" :args (34 7 -1 -1 0)) 

event:  [:overtone :node-created 34] ({:node #<synth-node[live]: beatboxchad-l394/audition-synth 34>}) 

...随后是一堆与 Overtone 相关的事件,清理其默认节点和组,例如关闭的一部分。如果您从 overtone.live 中没有得到相同的输出,我会知道我有一些关于 JACK 设置或其他问题的问题。

使用 overtone.core 连接到外部服务器,它会间歇性地工作。

当它工作时,我得到以下事件:

event:  [:overtone :osc-msg-received] (:msg {:path "/d_removed", :type-tag "s", :args ("beatboxchad-l394/audition-synth"), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/d_removed" (:path "/d_removed" :args ("beatboxchad-l394/audition-synth")) 

event:  [:overtone :osc-msg-received] (:msg {:path "/done", :type-tag "s", :args ("/d_recv"), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/done" (:path "/done" :args ("/d_recv")) 

event:  [:overtone :osc-msg-received] (:msg {:path "/synced", :type-tag "i", :args (71), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/synced" (:path "/synced" :args (71)) 

event:  [:overtone :osc-msg-received] (:msg {:path "/n_go", :type-tag "iiiii", :args (114 7 -1 -1 0), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/n_go" (:path "/n_go" :args (114 7 -1 -1 0)) 

event:  [:overtone :node-created 114] ({:node #<synth-node[live]: beatboxchad-l394/audition-synth 114>}) 

event:  [:overtone :osc-msg-received] (:msg {:path "/n_end", :type-tag "iiiii", :args (114 7 -1 -1 0), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/n_end" (:path "/n_end" :args (114 7 -1 -1 0)) 

event:  [:overtone :node-destroyed 114] ({:node #<synth-node[destroyed]: beatboxchad-l394/audition-synth 114>}) 

当它失败时,我得到这些:

event:  [:overtone :osc-msg-received] (:msg {:path "/d_removed", :type-tag "s", :args ("beatboxchad-l394/audition-synth"), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/d_removed" (:path "/d_removed" :args ("beatboxchad-l394/audition-synth")) 

event:  [:overtone :osc-msg-received] (:msg {:path "/done", :type-tag "s", :args ("/d_recv"), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/done" (:path "/done" :args ("/d_recv")) 

event:  [:overtone :osc-msg-received] (:msg {:path "/synced", :type-tag "i", :args (72), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/synced" (:path "/synced" :args (72)) 

event:  [:overtone :osc-msg-received] (:msg {:path "/fail", :type-tag "ss", :args ("/s_new" "duplicate node ID"), :src-host "localhost.localdomain", :src-port 57110}) 

event:  "/fail" (:path "/fail" :args ("/s_new" "duplicate node ID")) 

这看起来像是 OSC 与服务器的通信出现故障 - 某处节点 ID 未正确递增。

当你尝试时,你在事件方面得到了什么?

【讨论】:

  • 抱歉,这个“答案”应该是评论吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-04-03
  • 1970-01-01
  • 1970-01-01
  • 2014-01-02
  • 2010-10-05
  • 2013-06-28
  • 2016-10-13
相关资源
最近更新 更多