Python synthesizer stuff
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

25 lines
802B

  1. from ysynth import *
  2. synth = YSynth()
  3. #synth.set_graph(Sin(440 + 110 * Sin(1)))
  4. #synth.set_graph((Saw(440) + Sin(550)) * 0.25)
  5. #synth.set_graph(Square(220) * 0.5)
  6. #synth.set_graph(Sin(440 + 44 * Sin(4) + 110 * Square(0.5)) * 0.1)
  7. #synth.set_graph(Sin(440 * (Saw(0.5) + 1.0) * 0.5) * 0.05)
  8. #synth.set_graph(Sin(220) * 0.5)
  9. #synth.set_graph(Pulse(220) * 0.25)
  10. #synth.set_graph(Sin(440) * 0.25)
  11. #synth.set_graph(WhiteNoise() * 1.0)
  12. # Should sound vagely similar to a flanged whitenoise signal
  13. #noise = WhiteNoise()
  14. #synth.set_graph((noise + noise[50 + 100 * (Sin(0.1) + 1)]) * 0.5 * (RevSaw(2) + 1) * 0.5)
  15. synth.set_graph(Sin(440) * RevSaw(5) * 0.2)
  16. def harmonics(osc, freq, count):
  17. return reduce(lambda a, b: a + b,
  18. (osc(freq * i) for i in xrange(1, count + 2))) \
  19. / (count + 1)