Pipe stdin to soundcard using SDL
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

orgue.py 456B

123456789101112131415161718192021222324
  1. import sys
  2. from synth import *
  3. base_mod = 1.0
  4. if len(sys.argv) > 1:
  5. base_mod = float(sys.argv[1])
  6. bm = base_mod
  7. while True:
  8. wv0 = sinwave(0.001 * bm)
  9. wv1 = sinwave(0.1*bm)
  10. wv2 = sinwave(0.011*bm)
  11. lfo0 = sinwave(0.01*bm)
  12. lfo1 = sinwave(0.02*bm)
  13. wv2 = vol_lfo(wv2, lfo0)
  14. mix = mixer(wv0, wv1, wv2)
  15. r = vol_lfo(mix, lfo1)
  16. samples = output_sampler(r)
  17. while True:
  18. sys.stdout.buffer.write(next(samples))