Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def ex3():
from pyo import Disto, SfPlayer, Clean_objects, DEMOS_PATH
print """
Multiband distortion:
o_ex1 = SfPlayer(DEMOS_PATH + "/transparent.aif", loop=True, mul=.5)
o_ex2 = BandSplit(o_ex1, num=4, min=250, max=5000, q=2)
o_ex3 = Disto(o_ex2, drive=[0.98, 0, 0, 0.99], mul=.06125).out()
"""
o_ex1 = SfPlayer(DEMOS_PATH + "/transparent.aif", loop=True, mul=.5)
o_ex2 = BandSplit(o_ex1, num=4, min=250, max=5000, q=2)
o_ex3 = Disto(o_ex2, drive=[0.98, 0, 0, 0.99], mul=.06125).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3)
c.start()
def ex1():
from pyo import LinTable, Metro, TrigEnv, Clean_objects
print """
Simple plucked string:
t_ex1 = LinTable([(0,0), (2,1), (5,0), (8191,0)])
o_ex1 = Metro().play()
o_ex2 = TrigEnv(o_ex1, t_ex1, 1)
o_ex3 = Waveguide(o_ex2, freq=[200,200.5], dur=20, minfreq=20, mul=.5).out()
"""
t_ex1 = LinTable([(0,0), (2,1), (5,0), (8191,0)])
o_ex1 = Metro().play()
o_ex2 = TrigEnv(o_ex1, t_ex1, 1)
o_ex3 = Waveguide(o_ex2, freq=[200,200.5], dur=20, minfreq=20, mul=.5).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3, t_ex1)
c.start()
print """
Simple plucked string, with vibrato:
t_ex1 = LinTable([(0,0), (2,1), (5,0), (8191,0)])
o_ex1 = Metro().play()
o_ex2 = TrigEnv(o_ex1, t_ex1, 1)
o_ex3 = Sine(3, 0, 3, [200, 200.5])
o_ex4 = Waveguide(o_ex2, freq=o_ex3, dur=20, minfreq=20, mul=.5).out()
"""
t_ex1 = LinTable([(0,0), (2,1), (5,0), (8191,0)])
o_ex1 = Metro().play()
o_ex2 = TrigEnv(o_ex1, t_ex1, 1)
o_ex3 = Sine(3, 0, 3, [200, 200.5])
o_ex4 = Waveguide(o_ex2, freq=o_ex3, dur=20, minfreq=20, mul=.5).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3, o_ex4, t_ex1)
c.start()
def ex1():
from pyo import Noise, Clean_objects
print """
Amplitude fadein and fadeout:
o_ex1 = Fader(fadein=.75, fadeout=.75, dur=4, mul=.5).play()
o_ex2 = Noise(mul=o_ex1).out()
"""
o_ex1 = Fader(fadein=.75, fadeout=.75, dur=4, mul=.5).play()
o_ex2 = Noise(mul=o_ex1).out()
c = Clean_objects(4, o_ex1, o_ex2)
c.start()
def ex5():
from pyo import Noise, Sine, Clean_objects
print """
Bandpass filter with moving Q:
o_ex1 = Noise()
o_ex2 = Sine(freq=1, mul=10, add=11)
o_ex3 = Biquad(o_ex1, freq=1000, q=o_ex2, type=2).out()
"""
o_ex1 = Noise()
o_ex2 = Sine(freq=1, mul=10, add=11)
o_ex3 = Biquad(o_ex1, freq=1000, q=o_ex2, type=2).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3)
c.start()
def ex3():
from pyo import Sine, Clean_objects
print """
Ring modulation on input signal:
o_ex1 = Sine([150, 300])
o_ex2 = Input(chnl=0, mul=o_ex1).out()
"""
o_ex1 = Sine([150, 300])
o_ex2 = Input(chnl=0, mul=o_ex1).out()
c = Clean_objects(4, o_ex1, o_ex2)
c.start()
def ex3():
from pyo import Sine, SfPlayer, Clean_objects, DEMOS_PATH
print """
Reverb with changing room size:
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5)
o_ex2 = Sine(freq=0.75, mul=0.5, add=0.5)
o_ex3 = Freeverb(o_ex1, size=o_ex2, damp=1, bal=.5).out()
"""
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5)
o_ex2 = Sine(freq=0.75, mul=0.5, add=0.5)
o_ex3 = Freeverb(o_ex1, size=o_ex2, damp=1, bal=.5).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3)
c.start()
def ex2():
from pyo import SfPlayer, Clean_objects, DEMOS_PATH
print """
Delay with feedback:
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5).out()
o_ex2 = Delay(o_ex1, .250, 0.75, 1).out()
"""
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5).out()
o_ex2 = Delay(o_ex1, .250, 0.75, 1).out()
c = Clean_objects(4, o_ex1, o_ex2)
c.start()
def ex1():
from pyo import SfPlayer, Clean_objects, DEMOS_PATH
print """
Small romm:
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5)
o_ex2 = Freeverb(o_ex1, size=.25, damp=.7, bal=.4).out()
"""
o_ex1 = SfPlayer(DEMOS_PATH + '/transparent.aif', loop=True, mul=.5)
o_ex2 = Freeverb(o_ex1, size=.25, damp=.7, bal=.4).out()
c = Clean_objects(4, o_ex1, o_ex2)
c.start()
def ex3():
from pyo import Sine, Clean_objects
print """
Frequency attack and decay:
o_ex1 = Fader(fadein=.15, fadeout=.15, dur=4, mul=100, add=900).play()
o_ex2 = Fader(fadein=.05, fadeout=.05, dur=4, mul=.5).play()
o_ex3 = Sine(freq=o_ex1, mul=o_ex2).out()
"""
o_ex1 = Fader(fadein=.15, fadeout=.15, dur=4, mul=100, add=900).play()
o_ex2 = Fader(fadein=.05, fadeout=.05, dur=4, mul=.5).play()
o_ex3 = Sine(freq=o_ex1, mul=o_ex2).out()
c = Clean_objects(4, o_ex1, o_ex2, o_ex3)
c.start()