Page 1 of 1

How to embarrass yourself with a piece of Python code

Posted: Sat Mar 01, 2008 1:09 am
by dahnielson
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:

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()
3. Run it.

:oops:

(I'm actually glad I didn't use any headphones.)

Re: How to embarrass yourself with a piece of Python code

Posted: Sat Mar 01, 2008 2:02 am
by Consul
I'm going to take a guess and say that the neighbors a half-mile down heard it? :D

Re: How to embarrass yourself with a piece of Python code

Posted: Sat Mar 01, 2008 2:15 am
by dahnielson
:D

I realized that "amplifier" is a misnomer in any synthesis signal path, what the above is missing is an attenuator since 1.0f is 0db and I don't have any volume control sitting between my audio interface and the monitors. At least I now know that I can get near maximum volume without distortion for any 440 Hz tone.

All I wanted to know was if it showed up in QJackCtl...