0

I'm currently creating a small Program with Python and pyo that should use the microphone input as a source and then add several effects and filters provided by pyo. I couldn't find anything in the docs, is there a way to use the microphone input as a source, are there any alternatives to pyo?

Here's the basic example I have so far:

from pyo import *

s = Server().boot()

s.start()

s.amp = 0.1

# use microphone input here
sf = Sig(1).out()

# Passes the sine wave through an harmonizer.
h1 = Harmonizer(sf).out()

s.gui(locals())

I know there's a function to set the input device, like s.setInputDevice(5), but I can not figure out how to actually use it.

Thanks for the help!

1 Answer 1

1

It looks like you aren't actually creating an input stream. Something like this (no gui) will output your microphone input:

from pyo import *                                                                                                                                                                                                                                                                                    
s = Server().boot() 
s.start()                                                                                                                                 
miccheck = Input().play().out()  

Or, to modify the harmonizer default example:

from pyo import *
s = Server().boot()

mic = Input().play().out()


env = WinTable(8)
wsize = .1
trans = -7

ratio = pow(2., trans/12.)
rate = -(ratio-1) / wsize

ind = Phasor(freq=rate, phase=[0,0.5])
win = Pointer(table=env, index=ind, mul=.7)
snd = Delay(mic, delay=ind*wsize, mul=win).mix(1).out(1)

s.gui(locals())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.