How to embarrass yourself with a piece of Python code
Posted: Sat Mar 01, 2008 1:09 am
0. Keep you monitor system switched on the whole day (as usual) and forget about it.
1. Make sure it's in the middle of the night and that all your neighbors are home.
2. Dip your toes into SndObj and write the simplest thing that could possibly work:
3. Run it.
(I'm actually glad I didn't use any headphones.)
1. Make sure it's in the middle of the night and that all your neighbors are home.
2. Dip your toes into SndObj and write the simplest thing that could possibly work:
Code: Select all
import sndobj
import time
tab = sndobj.HarmTable()
osc = sndobj.Oscili(tab, 440, 16000)
outp = sndobj.SndJackIO("example")
outp.SetOutput(1, osc)
mod = sndobj.Oscili(tab, 2, 44)
osc.SetFreq(440, mod)
thread = sndobj.SndThread()
thread.AddObj(mod)
thread.AddObj(osc)
thread.AddObj(outp, sndobj.SNDIO_OUT)
thread.ProcOn()
time.sleep(30)
thread.ProcOff()
(I'm actually glad I didn't use any headphones.)