def orchestral_oboe(length, freq): vox = make_simple_base(length, freq, 0.25) vox = sf.Multiply( sf.LinearShape((0, 0), (sf.Period(freq) / 2.0, 1), (length, 1)), vox) vox = polish(vox, freq) vox = sf.Finalise(sf.Power(vox, 1.5)) vox = polish(vox, freq) vox = sf.Finalise(sf.Power(vox, 1.5)) vox = polish(vox, freq) vox = sf.RBJPeaking(vox, freq * 5, 0.5, 5) vox = sf.RBJPeaking(vox, freq * 7, 1, 5) vox = sf.RBJNotch(vox, freq * 2, 0.5, 1) vox = sf.FixSize(vox) res = 512 * math.ceil(float(freq) / 256.0) vox = mix( sf.RBJPeaking(+vox, res, 1, 8), sf.RBJPeaking(vox, res * 4.0, 1, 8), ) vox = sf.ButterworthLowPass(vox, freq * 4, 4) vox = sf.FixSize(vox) nos = sf.Multiply( +vox, sf.Multiply( clean_noise(length, freq), sf.ExponentialShape((0, -60), (64, 0), (128, -9), (length, -9)))) vox = mix(vox, sf.Pcnt10(sf.FixSize(nos))) vox = polish(vox, freq) return sf.FixSize(vox)
def plucked_glass(length, freq): sig = mix( sf.Pcnt50(stretched_bass(length, freq, z=3.5, s=1.005, d=1.00, at=3000)), sf.Pcnt50(stretched_bass(length, freq, z=3.5, s=1.005, d=1.00, at=1500))) sig = sf.Multiply(sig, sf.LinearShape((0, 0.5), (16, 1), (length, 1))) sig = sf.BesselLowPass(sig, freq * 5, 1) sig = sf.Multiply( sig, sf.DirectMix(1, sf.Pcnt5(sf.SineWave(length, 16 + random.random() * 8.0)))) sig = sf.RBJPeaking(sig, freq * 5, 0.5, 5) start = sf.Multiply( mix(sf.FixSize(sf.MakeSawTooth(sf.SineWave(length, 120))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length, freq * 0.75))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length, freq**0.5)))), sf.ExponentialShape((0, 1.0), (16, -30), (32, -60), (length, -99))) start = sf.Multiply( start, sf.LinearShape((0, 0), (16, 1), (length, 0), (length * 0.5, 0))) start = sf.Clean(start) conv = clean_noise(64, 32) conv = sf.Multiply(sf.ExponentialShape((0, -12), (60, -60), (66, -60)), conv) conv = sf.Multiply(conv, sf.LinearShape((0, 0), (60, 1), (66, 0))) conv = reverberate(start, conv) conv = sf.Multiply( conv, sf.ExponentialShape((0, 1.0), (16, -30), (32, -60), (length, -99))) sig = mix(sf.FixSize(sig), sf.Pcnt50(sf.FixSize(conv))) sig = sf.Cut(0, length, sig) return sf.FixSize(polish(sig, 64))
def mute_oboe(length, freq): sig = sf.FixSize( sf.Power( sf.Clean( mix(nice_saw(length, freq), sf.PhasedSineWave(length, freq, random.random()))), 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sig) sig = sf.RBJPeaking(sig, freq * 5, 0.5, 5) sig = sf.RBJPeaking(sig, freq * 7, 1, 5) sig = sf.RBJNotch(sig, freq * 2, 0.5, 1) sig = sf.Clean(sig) sig = mix( sf.FixSize(sig), sf.Multiply( clean_noise(length, freq * 9.0), sf.ExponentialShape((0, -60), (64, -16), (128, -20), (length, -20)))) sig = polish(sig, freq) sig = sf.BesselLowPass(sig, freq * 4, 1) osig = +sig osig = sf.BesselHighPass(sig, freq * 4, 2) sig = sf.BesselLowPass(sig, freq * 6, 1) sig = sf.BesselLowPass(sig, freq * 8, 4) sig = mix(sig, osig) return sf.FixSize(sf.Clean(sig))
def warm_bass(length,freq): sig=mix( sf.FixSize( sf.Power( sf.Clean( mix( [sf.Pcnt25(sf.MakeSquare (sf.PhasedSineWave(length,freq ,random.random()))),0], [sf.Pcnt50(sf.MakeTriangle(sf.PhasedSineWave(length,freq*0.501,random.random()))),32], [sf.Pcnt25(sf.MakeTriangle(sf.PhasedSineWave(length,freq*0.252,random.random()))),64], [sf.Pcnt25(sf.MakeTriangle(sf.PhasedSineWave(length,freq/8.01,random.random()))),64] ) ) ,1.25 ) ), sf.Multiply( clean_noise(length,freq), sf.ExponentialShape((0,-60),(64,-12),(128,-24),(length,-24)) ) ) sh=sf.WhiteNoise(length) sh=sf.Multiply(sh,+sig) sig=mix(sig,sf.Pcnt5(sh)) if freq<128: q=freq*6.0 elif freq<256: q=freq*5 else: q=freq*4.0 sig=sf.BesselLowPass(sig,q,1) return pitch_move(sig)
def orchestral_oboe(length,freq): vox=make_simple_base(length,freq,0.25) vox=sf.Multiply( sf.LinearShape((0,0),(sf.Period(freq)/2.0,1),(length,1)), vox ) vox=polish(vox,freq) vox=sf.Finalise(sf.Power(vox,1.5)) vox=polish(vox,freq) vox=sf.Finalise(sf.Power(vox,1.5)) vox=polish(vox,freq) vox=sf.RBJPeaking(vox,freq*5,0.5,5) vox=sf.RBJPeaking(vox,freq*7,1,5) vox=sf.RBJNotch (vox,freq*2,0.5,1) vox=sf.FixSize(vox) res=512*math.ceil(float(freq)/256.0) vox=mix( sf.RBJPeaking(+vox,res ,1,8), sf.RBJPeaking( vox,res*4.0,1,8), ) vox=sf.ButterworthLowPass(vox,freq*4,4) vox=sf.FixSize(vox) nos=sf.Multiply( +vox, sf.Multiply( clean_noise(length,freq), sf.ExponentialShape((0,-60),(64,0),(128,-9),(length,-9)) ) ) vox=mix( vox, sf.Pcnt10(sf.FixSize(nos)) ) vox=polish(vox,freq) return sf.FixSize(vox)
def trumpet(length, freq): if length > 256: sig1 = trumpe_base(length, freq, -0.25) sig2 = trumpet_base(length, freq, 0.25) env1 = sf.LinearShape((0, 0), (256, 1), (length, 1)) env2 = sf.LinearShape((0, 1), (256, 0), (length, 0)) sig1 = sf.Multiply(sig1, env1) sig2 = sf.Multiply(sig2, env2) sig = mix(sig1, sig2) else: sig = trumpet_base(length, freq, -0.25) sig = sf.FixSize(sig) sig = polish(sig, freq) sig = mix( sig, sf.Multiply( clean_noise(length, freq * 1.0), sf.ExponentialShape((0, -60), (32, -22), (64, -60), (length, -90)))) sig = sf.FixSize(sig) sig = polish(sig, freq) return sf.FixSize(sig)
def simple_oboe(length, freq): sig = sf.FixSize( sf.Power( sf.Clean( mix(nice_saw(length, freq), sf.PhasedSineWave(length, freq, random.random()))), 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sig) sig = sf.RBJPeaking(sig, freq * 5, 0.5, 5) sig = sf.RBJPeaking(sig, freq * 7, 1, 5) sig = sf.RBJNotch(sig, freq * 2, 0.5, 1) sig = sf.Clean(sig) sig = mix( sf.FixSize(sig), sf.Multiply( clean_noise(length, freq * 9.0), sf.ExponentialShape((0, -60), (64, -20), (128, -24), (length, -24)))) sig = sf.ButterworthLowPass(sig, freq * 9, 4) sig = polish(sig, freq) return sf.FixSize(sig)
def make_simple_base(length,frequency,z): p=random.random() if frequency>4000: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),(1.0/2.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),(1.0/3.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),(1.0/4.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),(1.0/5.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),(1.0/6.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),(1.0/7.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),(1.0/8.0)**z) ) else: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),(1.0/2.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),(1.0/3.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),(1.0/4.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),(1.0/5.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),(1.0/6.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),(1.0/7.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),(1.0/8.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p),(1.0/9.0)**z), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p),(1.0/10.0)**z) ) return sf.FixSize(sig)
def trost_posaune(length,freq): b=posaune_pulse(length,freq) b=mix( [b,12], [ sf.LinearShape( (0, -2.0), (4, 2.0), (12,-1.00), (20, 1.00), (28,-1.00), (length,0) ),0] ) b=sf.RBJPeaking(b,freq*2,2,2) b=polish(b,freq) sig=mix( b , sf.Pcnt20(sf.Multiply(+b,sf.WhiteNoise(length))), sf.Multiply( clean_noise(length,freq*0.5), sf.ExponentialShape((0,-60),(64,-14),(128,-28),(length,-24)) ) ) return pitch_move(sig)
def nice_pulse(length,frequency): p=random.random() if frequency>4000: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),1.0/2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),1.0/3.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),1.0/4.0) ) else: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),1.0/2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),1.0/3.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),1.0/4.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p),1.0/6.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p),1.0/10.0) ) return sf.FixSize(sig)
def ophicleide_pulse(length,frequency): p=random.random() if frequency>4000: raise "Too high for ophicleide" elif frequency>1000: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),0.9), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),0.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p),0.6), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p),0.4) ) else: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p),1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p),1.6), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),1.4), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p),1.2), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p),1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p),0.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*11.0,p),0.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*12.0,p),0.3), sf.NumericVolume(sf.PhasedSineWave(length,frequency*13.0,p),0.2), sf.NumericVolume(sf.PhasedSineWave(length,frequency*14.0,p),0.1) ) return sf.FixSize(sig)
def stopped_pulse(length, frequency): p = random.random() if frequency > 3000: sig = mix( sf.PhasedSineWave(length, frequency, p), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 3.0, p), 1.0 / 1.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 5.0, p), 1.0 / 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 7.0, p), 1.0 / 2.0)) else: sig = mix( sf.PhasedSineWave(length, frequency, p), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 3.0, p), 1.0 / 1.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 5.0, p), 1.0 / 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 7.0, p), 1.0 / 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 9.0, p), 1.0 / 4.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 11.0, p), 1.0 / 8.0)) return sf.FixSize(sig)
def trumpet(length,freq): if length>256: sig1=trumpe_base(length,freq,-0.25) sig2=trumpet_base(length,freq, 0.25) env1=sf.LinearShape((0,0),(256,1),(length,1)) env2=sf.LinearShape((0,1),(256,0),(length,0)) sig1=sf.Multiply(sig1,env1) sig2=sf.Multiply(sig2,env2) sig=mix(sig1,sig2) else: sig=trumpet_base(length,freq,-0.25) sig=sf.FixSize(sig) sig=polish(sig,freq) sig=mix( sig, sf.Multiply( clean_noise(length,freq*1.0), sf.ExponentialShape((0,-60),(32,-22),(64,-60),(length,-90)) ) ) sig=sf.FixSize(sig) sig=polish(sig,freq) return sf.FixSize(sig)
def grand_bass(length, freq): sig = mix( mix([sf.Pcnt25(nice_saw(length, freq)), 0], [ sf.Pcnt50( sf.MakeTriangle( sf.PhasedSineWave(length, freq * 0.501, random.random()))), 32 ], [ sf.Pcnt25( sf.MakeTriangle( sf.PhasedSineWave(length, freq * 0.252, random.random()))), 64 ], [ sf.Pcnt25( sf.MakeTriangle( sf.PhasedSineWave(length, freq / 8.01, random.random()))), 64 ]), sf.Multiply( clean_noise(length, freq), sf.ExponentialShape((0, -60), (64, -12), (128, -24), (length, -20)))) sig = sf.BesselLowPass(sig, freq * 3.0, 1) sig = sf.FixSize(polish(sig, freq)) sig = pitch_move(sig) sig = sf.ButterworthLowPass(sig, freq * 9.0, 1) return sf.FixSize(sf.Clean(sig))
def double_bombard(length, freq): sig = mix( mix([sf.Pcnt50(bombard_pulse(length, freq)), 0], [sf.Pcnt50(bombard_pulse(length, freq * 1.5)), 10]), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -10), (128, -24), (length, -20)))) return pitch_move(sig)
def ophicleide_pulse(length, frequency): p = random.random() if frequency > 4000: raise "Too high for ophicleide" elif frequency > 1000: sig = mix( sf.PhasedSineWave(length, frequency, p), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 2.0, p), 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 3.0, p), 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 4.0, p), 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 5.0, p), 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 6.0, p), 1.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 7.0, p), 0.9), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 8.0, p), 0.8), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 9.0, p), 0.6), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 10.0, p), 0.4)) else: sig = mix( sf.PhasedSineWave(length, frequency, p), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 2.0, p), 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 3.0, p), 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 4.0, p), 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 5.0, p), 1.8), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 6.0, p), 1.6), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 7.0, p), 1.4), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 8.0, p), 1.2), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 9.0, p), 1.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 10.0, p), 0.8), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 11.0, p), 0.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 12.0, p), 0.3), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 13.0, p), 0.2), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 14.0, p), 0.1)) return sf.FixSize(sig)
def trost_orchestral_oboe(length,freq): start=sf.Multiply( mix( sf.FixSize(sf.Power(sf.MakeSawTooth(sf.SineWave(length,freq*0.500)),2.0)), sf.FixSize(sf.Power(sf.MakeSawTooth(sf.SineWave(length,freq*0.123)),2.0)) ), sf.LinearShape((0,3.0),(32,0),(length,0)) ) start=polish(start,freq*0.5) sig=mix(orchestral_oboe(length,freq),sf.FixSize(start)) return sf.FixSize(polish(sig,freq))
def bombard(length, freq): b = mix([sf.Pcnt33(bombard_pulse(length, freq)), 0], [sf.Pcnt33(bombard_pulse(length, freq)), 10], [sf.Pcnt33(bombard_pulse(length, freq)), 20]) b = polish(b, freq) sig = mix( b, sf.Pcnt10(sf.Multiply(+b, sf.WhiteNoise(length))), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -14), (128, -28), (length, -24)))) return pitch_move(sig)
def double_bombard(length,freq): sig=mix( mix( [sf.Pcnt50(bombard_pulse(length,freq)),0], [sf.Pcnt50(bombard_pulse(length,freq*1.5)),10] ), sf.Multiply( clean_noise(length,freq*0.5), sf.ExponentialShape((0,-60),(64,-10),(128,-24),(length,-20)) ) ) return pitch_move(sig)
def trost_orchestral_oboe(length, freq): start = sf.Multiply( mix( sf.FixSize( sf.Power(sf.MakeSawTooth(sf.SineWave(length, freq * 0.500)), 2.0)), sf.FixSize( sf.Power(sf.MakeSawTooth(sf.SineWave(length, freq * 0.123)), 2.0))), sf.LinearShape((0, 3.0), (32, 0), (length, 0))) start = polish(start, freq * 0.5) sig = mix(orchestral_oboe(length, freq), sf.FixSize(start)) return sf.FixSize(polish(sig, freq))
def bright_plucked_glass(length, freq): sig = mix( stretched_bass(length, freq, z=1.5, s=1.02, d=1.0, at=4000), sf.Multiply( clean_noise(length, freq * 2.0), sf.ExponentialShape((0, -60), (64, -20), (128, -36), (length, -36)))) sig = sf.RBJPeaking(sig, freq * 5, 0.5, 5) start = sf.Multiply( mix(sf.FixSize(sf.MakeSawTooth(sf.SineWave(length, freq * 0.75))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length, freq**0.5)))), sf.ExponentialShape((0, 1.0), (16, -30), (32, -60), (length, -99))) start = sf.Clean(start) sig = mix(sf.FixSize(sig), sf.FixSize(start)) return sf.FixSize(sf.Clean(sig))
def trost_posaune(length, freq): b = posaune_pulse(length, freq) b = mix([b, 12], [ sf.LinearShape((0, -2.0), (4, 2.0), (12, -1.00), (20, 1.00), (28, -1.00), (length, 0)), 0 ]) b = sf.RBJPeaking(b, freq * 2, 2, 2) b = polish(b, freq) sig = mix( b, sf.Pcnt20(sf.Multiply(+b, sf.WhiteNoise(length))), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -14), (128, -28), (length, -24)))) return pitch_move(sig)
def stopped_reed(length, freq): s1 = stopped_pulse(length, freq * 1.000) s1 = polish(s1, freq) sig = mix( s1, sf.Multiply( clean_noise(length, freq * 2.0), sf.ExponentialShape((0, -60), (64, -16), (128, -20), (length, -20)))) sig = sf.FixSize(sig) sig = mix(sf.Pcnt10(sf.Clean(sf.Saturate(+sig))), sig) sig = polish(sig, freq) return sf.FixSize(sig)
def tuned_wind(length, freq): with SFMemoryZone(): sigs = [] for i in range(1, 3): sig = byquad_filter( 'peak', byquad_filter( 'peak', sf.Mix(clean_noise(length, freq), sf.Pcnt10(sf.SineWave(length, freq))), 1.0, 64), freq, 0.1, 64) sig = byquad_filter('peak', sig, freq, 1.0, 128) sig = sf.FixSize(excite(sig, 1.0, 2.0)) sig = sf.FixSize(sf.Saturate(sf.LinearVolume(sig, 2.0))) sig = create_vibrato(sig, length, longer_than=0.5, rate=2.5, at=0.45, depth=0.5, pitch_depth=0.02) sigs.append(sig) sig = mix(sigs) return sf.FixSize(polish(sig, freq)).keep()
def _vox_filter(vox, freq, a, b, c): length = sf.Length(+vox) vox = sf.FixSize(polish(vox, freq)) vox = do_formant(vox, a, b, c, freq) vox = polish(vox, freq) vox = excite(vox, 0.2, 2.0) vox = polish(vox, freq) notch = (freq + a) / 2.0 vox = mix(sf.Pcnt75(sf.RBJNotch(+vox, notch, 0.5)), sf.Pcnt25(vox)) if length > 1024: vibRate = 3.0 depth = 0.05 pDepth = 0.1 else: vibRate = 2.5 depth = 0.025 pDepth = 0.05 if length > 2048: at = length * 0.75 else: at = length * 0.5 vox = create_vibrato(vox, length, longer_than=512, rate=vibRate, depth=depth, pitch_depth=pDepth, at=at) vox = polish(vox, freq) vox = sf.RBJPeaking(vox, freq, 3, 4) vox = polish(vox, freq) return sf.FixSize(vox)
def folk_flute(length,freq): sig=mix( byquad_filter( 'low', sf.Mix( phasing_triangle(length,freq), sf.Pcnt1(sf.MakeSquare(sf.SineWave(length,freq*0.9))) ), freq*2.0, 2 ), sf.Multiply( byquad_filter( 'peak', clean_noise(length,freq*0.5), freq, 0.5, 16 ), sf.ExponentialShape((0,-60),(64,-28),(128,-40),(length,-40)) ) ) sig=create_vibrato( sig,length, longer_than=512, rate=2.5, at=450, depth=0.5, pitch_depth=0.02 ) return sf.FixSize(polish(sig,freq))
def folk_basson(length,freq): sig=sf.FixSize( sf.Power( phasing_sawtooth(length,freq) , 1.5 ) ) sig=polish(sig,freq) sig=sf.FixSize(sf.Power(sig,1.5)) sig=polish(sig,freq) sig=sf.FixSize(sf.Power(sig,1.5)) sig=polish(sig,freq) sig=sf.FixSize(sig) sig=sf.RBJPeaking(sig,freq*5,0.5,5) sig=sf.RBJPeaking(sig,freq*7,1,5) sig=sf.RBJNotch (sig,freq*2,0.5,1) sig=sf.Clean(sig) sig=mix( sf.FixSize(sig), sf.ButterworthLowPass ( sf.Multiply( sf.MakeSquare(sf.SineWave(length,freq)), sf.ExponentialShape((0,-60),(64,-32),(96,-60),(length,-60)) ), freq*9, 4 ) ) sig=sf.ButterworthLowPass (sig,freq*9,2) sig=polish(sig,freq) return sf.FixSize(sig)
def bombard_pulse(length, frequency): p = random.random() p2 = 1.0 - p if frequency > 4000: raise "Too high for bombard" else: sig = mix( sf.PhasedSineWave(length, frequency, p), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 2.0, p), 2.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 3.0, p), 1.5), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 4.0, p), 1.3), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 5.0, p), 1.2), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 6.0, p), 1.0), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 7.0, p), 0.8), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 8.0, p), 0.6), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 9.0, p), 0.4), sf.LinearVolume(sf.PhasedSineWave(length, frequency * 10.0, p), 0.2)) sig = sf.Multiply(sf.LinearShape((0, 0), (32, 1), (length, 1)), sig) return sf.FixSize(sig)
def _vox_filter(vox, freq, a, b, c): length=sf.Length(+vox) vox=sf.FixSize(polish(vox,freq)) vox=do_formant(vox, a, b, c, freq) vox=polish(vox, freq) vox=excite(vox, 0.2, 2.0) vox=polish(vox, freq) notch=(freq + a) / 2.0 vox=mix( sf.Pcnt75(sf.RBJNotch(+vox, notch, 0.5)), sf.Pcnt25(vox) ) if length>1024: rate = 3.0 depth = 0.05 pDepth = 0.1 else: rt = 2.5 depth = 0.025 pDepth = 0.05 if length > 2048: at = length*0.75 else: at = length*0.5 vox=create_vibrato(vox, length, longer_than=512, rate=rate, depth=depth, pitch_depth=pDepth, at=at) vox=polish(vox, freq) vox=sf.RBJPeaking(vox, freq, 3, 4) vox=polish(vox, freq) return sf.FixSize(vox)
def sing_base(length,freq,z=1.0): voxA=[] hc=1.0 freq=float(freq) while hc*freq<18000: hf=hc*freq # at higher frequencies there is less need to # richen the sound so do only one pass of creating the # waves, but double the volume of each one by two to # avoid filtering effects if freq<5000: x=2 y=1.0 else: x=1 y=2.0 for c in range(0,x): vol = (1.0/hc)**z # cut of at -60 db if vol>0.25e-06: vol*=y voxA.append(sf.NumericVolume(sf.PhasedTableSineWave(length,hf+random.random()*10.0,random.random()),vol)) voxA.append(sf.NumericVolume(sf.PhasedTableSineWave(length,hf-random.random()*10.0,random.random()),vol)) voxA.append(sf.NumericVolume(sf.PhasedTableSineWave(length,hf+random.random()*10.0,random.random()),vol)) voxA.append(sf.NumericVolume(sf.PhasedTableSineWave(length,hf-random.random()*10.0,random.random()),vol)) hc+=1 vox=mix(voxA) vox=sf.Clean(vox) vox=polish(sf.FixSize(vox),freq) return sf.FixSize(vox)
def granular_reverberate(signal, ratio, delay, density, length=50, stretch=1, vol=1, rand=1.0, spread=1.0): with SFMemoryZone(): c_log("Granular reverb: ratio:", ratio, " delay:", delay, " density", density, " length:", length, " stretch:", stretch, " volume:", vol, "rand:", rand, "spread", spread) out = [] for grain in sf.Granulate(signal, length, 10): with SFMemoryZone(): (signal_i, at) = grain signal_i = sf.Realise(signal_i) signal_i = sf.Realise( sf.DirectRelength( signal_i, ratio - 0.01 * spread + (0.02 * spread * random.random()))) signal_i.keep() for x in range(0, density): time = delay * ( (random.random() + random.random()) * rand + (1.0 - rand)) time = abs(time) out.append((signal_i, int((at + time) * stretch))) out = mix(out) out = sf.LinearVolume(out, vol) return out.keep()
def granular_reverberate(signal,ratio,delay,density,length=50,stretch=1,vol=1,rand=1.0,spread=1.0): with SFMemoryZone(): c_log("Granular reverb: ratio:",ratio," delay:",delay," density",density," length:",length," stretch:",stretch," volume:",vol,"rand:",rand,"spread",spread) out=[] for grain in sf.Granulate(signal,length,10): with SFMemoryZone(): (signal_i,at)=grain signal_i=sf.Realise(signal_i) signal_i=sf.Realise(sf.DirectRelength(signal_i,ratio-0.01*spread+(0.02*spread*random.random()))) signal_i.keep() for x in range(0,density): time=delay*( (random.random()+random.random())*rand+ (1.0-rand) ) time=abs(time) out.append( ( signal_i, int((at + time)*stretch) ) ) out = mix(out) out = sf.LinearVolume(out,vol) return out.keep()
def folk_basson(length, freq): sig = sf.FixSize(sf.Power(phasing_sawtooth(length, freq), 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sf.Power(sig, 1.5)) sig = polish(sig, freq) sig = sf.FixSize(sig) sig = sf.RBJPeaking(sig, freq * 5, 0.5, 5) sig = sf.RBJPeaking(sig, freq * 7, 1, 5) sig = sf.RBJNotch(sig, freq * 2, 0.5, 1) sig = sf.Clean(sig) sig = mix( sf.FixSize(sig), sf.ButterworthLowPass( sf.Multiply( sf.MakeSquare(sf.SineWave(length, freq)), sf.ExponentialShape((0, -60), (64, -32), (96, -60), (length, -60))), freq * 9, 4)) sig = sf.ButterworthLowPass(sig, freq * 9, 2) sig = polish(sig, freq) return sf.FixSize(sig)
def vox_humana_femail_soprano_ah(length,freq): vox = vox_humana_inner(length,freq,850,1200,2800,2.0,3.0) a = sf.BesselLowPass(+vox,freq ,2) b = sf.Power(sf.BesselHighPass(vox,freq*4.0,2),1.25) b = sf.Clean(b) b = sf.ButterworthHighPass(b,freq*1.5 ,6) a = sf.ButterworthHighPass(a,freq*0.75,6) return sf.Realise(mix(sf.Pcnt75(a),sf.Pcnt25(b)))
def vox_humana_femail_soprano_a(length,freq): vox = vox_humana_inner(length,freq,860,2050,2850,1.8,2.5) a = sf.BesselLowPass(+vox,freq ,2) b = sf.Power(sf.BesselHighPass(vox,freq*4.0,2),1.35) b = sf.Clean(b) b = sf.ButterworthHighPass(b,freq*1.5 ,6) a = sf.ButterworthHighPass(a,freq*0.75,6) return mix(sf.Pcnt75(a),sf.Pcnt25(b))
def post_process_tremolate(notes, rate=3.5, magnitude=0.25): count=0 tnsl=[] tnsr=[] for note in notes: nlr,atl,atr = note c_log("Trem phase 1 done: ",count) notel, noter = nlr tnsl.append([notel,atl]) tnsr.append([noter,atr]) count+=1 tnl=mix(tnsl) tnr=mix(tnsr) tnl=tremolate(tnl, rate, magnitude) tnr=tremolate(tnr, rate, magnitude) c_log("Trem phase 3 done") return tnl,tnr
def ophicleide(length, freq): b = mix([sf.Pcnt10(ophicleide_pulse(length, freq * 0.25 - 1)), 0], [sf.Pcnt20(ophicleide_pulse(length, freq)), 15], [sf.Pcnt20(ophicleide_pulse(length, freq)), 10], [sf.Pcnt20(ophicleide_pulse(length, freq * 2.0)), 5], [sf.Pcnt20(ophicleide_pulse(length, freq * 3.0)), 0]) b = mix(sf.Power(+b, 2.0), sf.Pcnt10(sf.Raise(+b, 2.0)), sf.Pcnt50(b)) b = polish(b, freq) sig = mix( sf.Pcnt90(b), sf.Pcnt10(sf.FixSize(sf.Multiply(+b, clean_noise(length, freq * 2.0)))), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -16), (128, -20), (length, -22)))) return sig
def single_bombard(length, freq): sig = mix( sf.Pcnt33(bombard_pulse(length, freq)), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -16), (128, -24), (length, -20)))) return pitch_move(sig)
def post_process(notes): count=0 tnsl=[] tnsr=[] all_left=[] all_right=[] for note in notes: nlr,atl,atr=note c_log("Mix phase 1 done: ",count,atl,atr) notel,noter=nlr tnsl.append([notel,atl]) tnsr.append([noter,atr]) count+=1 tnl=mix(tnsl) tnr=mix(tnsr) c_log("Mix phase 2 done") return tnl,tnr
def post_process_tremolate(notes, rate=3.5, magnitude=0.25): count = 0 tnsl = [] tnsr = [] for note in notes: nlr, atl, atr = note c_log("Trem phase 1 done: ", count) notel, noter = nlr tnsl.append([notel, atl]) tnsr.append([noter, atr]) count += 1 tnl = mix(tnsl) tnr = mix(tnsr) tnl = tremolate(tnl, rate, magnitude) tnr = tremolate(tnr, rate, magnitude) c_log("Trem phase 3 done") return tnl, tnr
def vox_humana_femail_soprano_ah(length, freq): vox = vox_humana_inner(length, freq, 850, 1200, 2800, 2.0, 3.0) a = sf.BesselLowPass(+vox, freq, 2) b = sf.Power(sf.BesselHighPass(vox, freq * 4.0, 2), 1.25) b = sf.Clean(b) b = sf.ButterworthHighPass(b, freq * 1.5, 6) a = sf.ButterworthHighPass(a, freq * 0.75, 6) return sf.Realise(mix(sf.Pcnt75(a), sf.Pcnt25(b)))
def post_process(notes): count = 0 tnsl = [] tnsr = [] all_left = [] all_right = [] for note in notes: nlr, atl, atr = note c_log("Mix phase 1 done: ", count, atl, atr) notel, noter = nlr tnsl.append([notel, atl]) tnsr.append([noter, atr]) count += 1 tnl = mix(tnsl) tnr = mix(tnsr) c_log("Mix phase 2 done") return tnl, tnr
def plucked_glass(length,freq): sig=mix( sf.Pcnt50(stretched_bass(length,freq,z=3.5,s=1.005,d=1.00,at=3000)), sf.Pcnt50(stretched_bass(length,freq,z=3.5,s=1.005, d=1.00,at=1500)) ) sig=sf.Multiply( sig, sf.LinearShape((0,0.5),(16,1),(length,1)) ) sig=sf.BesselLowPass(sig,freq*5,1) sig=sf.Multiply( sig, sf.DirectMix(1,sf.Pcnt5(sf.SineWave(length,16+random.random()*8.0))) ) sig=sf.RBJPeaking(sig,freq*5,0.5,5) start=sf.Multiply( mix( sf.FixSize(sf.MakeSawTooth(sf.SineWave(length,120))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length,freq*0.75))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length,freq**0.5))) ), sf.ExponentialShape((0,1.0),(16,-30),(32,-60),(length,-99)) ) start=sf.Multiply( start, sf.LinearShape((0,0),(16,1),(length,0),(length*0.5,0)) ) start=sf.Clean(start) conv =clean_noise(64,32) conv =sf.Multiply( sf.ExponentialShape((0,-12),(60,-60),(66,-60)), conv ) conv=sf.Multiply( conv, sf.LinearShape((0,0),(60,1),(66,0)) ) conv=reverberate(start,conv) conv=sf.Multiply( conv, sf.ExponentialShape((0,1.0),(16,-30),(32,-60),(length,-99)) ) sig=mix(sf.FixSize(sig),sf.Pcnt50(sf.FixSize(conv))) sig=sf.Cut(0,length,sig) return sf.FixSize(polish(sig,64))
def bombard(length,freq): b=mix( [sf.Pcnt33(bombard_pulse(length,freq)),0], [sf.Pcnt33(bombard_pulse(length,freq)),10], [sf.Pcnt33(bombard_pulse(length,freq)),20] ) b=polish(b,freq) sig=mix( b , sf.Pcnt10(sf.Multiply(+b,sf.WhiteNoise(length))), sf.Multiply( clean_noise(length,freq*0.5), sf.ExponentialShape((0,-60),(64,-14),(128,-28),(length,-24)) ) ) return pitch_move(sig)
def posaune_pulse(length,frequency): p1 =random.random() p2=1.0-p1 if frequency>4000: raise "Too High for pasaune" elif frequency>1000: sig=mix( sf.PhasedSineWave(length,frequency,p1), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p1),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p1),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p1),1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p1),1.3), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p1),1.1), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p1),0.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p1),0.6), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p1),0.4), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p1),0.2) ) else: sig=mix( sf.PhasedSineWave(length,frequency,p1), sf.NumericVolume(sf.PhasedSineWave(length,frequency*2.0,p1),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p2),2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*4.0,p1),1.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p2),1.6), sf.NumericVolume(sf.PhasedSineWave(length,frequency*6.0,p1),1.4), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p2),1.2), sf.NumericVolume(sf.PhasedSineWave(length,frequency*8.0,p1),1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p2),0.8), sf.NumericVolume(sf.PhasedSineWave(length,frequency*10.0,p1),0.6), sf.NumericVolume(sf.PhasedSineWave(length,frequency*11.0,p2),0.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*12.0,p1),0.4), sf.NumericVolume(sf.PhasedSineWave(length,frequency*13.0,p2),0.3), sf.NumericVolume(sf.PhasedSineWave(length,frequency*14.0,p1),0.2), sf.NumericVolume(sf.PhasedSineWave(length,frequency*15.0,p2),0.1), sf.NumericVolume(sf.PhasedSineWave(length,frequency*16.0,p1),0.05), sf.NumericVolume(sf.PhasedSineWave(length,frequency*16.0,p2),0.05), sf.NumericVolume(sf.PhasedSineWave(length,frequency*17.0,p1),0.05), sf.NumericVolume(sf.PhasedSineWave(length,frequency*18.0,p2),0.05), sf.NumericVolume(sf.PhasedSineWave(length,frequency*19.0,p1),0.01) ) sig=sf.Multiply( sf.NumericShape((0,0),(32,1),(length,1)), sig ) return sf.FixSize(sig)
def vox_humana_femail_soprano_a(length, freq): vox = vox_humana_inner(length, freq, 860, 2050, 2850, 1.8, 2.5) a = sf.BesselLowPass(+vox, freq, 2) b = sf.Power(sf.BesselHighPass(vox, freq * 4.0, 2), 1.35) b = sf.Clean(b) b = sf.ButterworthHighPass(b, freq * 1.5, 6) a = sf.ButterworthHighPass(a, freq * 0.75, 6) return mix(sf.Pcnt75(a), sf.Pcnt25(b))
def femail_soprano_a_filter(vox,length,freq): vox = _vox_filter(vox, freq, 860, 2050, 2850) a = sf.BesselLowPass(+vox,freq ,2) b = sf.Power(sf.BesselHighPass(vox,freq*4.0,2),1.35) b = sf.Clean(b) b = sf.ButterworthHighPass(b,freq*1.5 ,6) a = sf.ButterworthHighPass(a,freq*0.75,6) return mix(sf.Pcnt75(a),sf.Pcnt25(b))
def celest_flute(length, freq): sig = mix( sf.Pcnt50(sweet_flute_base(length, freq)), sf.Pcnt50(sweet_flute_base(length, freq + 1.0)), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -28), (128, -40), (length, -40)))) return pitch_move(sig)
def grand_bass(length,freq): sig=mix( mix( [sf.Pcnt25(nice_saw(length,freq)),0], [sf.Pcnt50(sf.MakeTriangle(sf.PhasedSineWave(length,freq*0.501,random.random()))),32], [sf.Pcnt25(sf.MakeTriangle(sf.PhasedSineWave(length,freq*0.252,random.random()))),64], [sf.Pcnt25(sf.MakeTriangle(sf.PhasedSineWave(length,freq/8.01,random.random()))),64] ), sf.Multiply( clean_noise(length,freq), sf.ExponentialShape((0,-60),(64,-12),(128,-24),(length,-20)) ) ) sig=sf.BesselLowPass(sig,freq*3.0,1) sig=sf.FixSize(polish(sig,freq)) sig=pitch_move(sig) sig=sf.ButterworthLowPass(sig,freq*9.0,1) return sf.FixSize(sf.Clean(sig))
def post_process_echo(notes): count=0 tnsl=[] tnsr=[] for note in notes: nlr,atl,atr=note c_log("Echo phase 1 done: ",count) notel,noter=nlr tnsl.append([notel,atl]) tnsr.append([noter,atr]) count+=1 tnl=mix(tnsl) tnr=mix(tnsr) c_log("Echo phase 2 done") tnl=echo_division(tnl) tnr=echo_division(tnr) c_log("Echo phase 3 done") return tnl,tnr
def femail_soprano_ah_filter(vox, length, freq): print length, freq vox = _vox_filter(vox, freq, 850, 1200, 2800) lower = sf.BesselLowPass(+vox,freq ,2) higher = sf.Power(sf.BesselHighPass(vox, freq*4.0, 2), 1.25) higher = sf.Clean(higher) higher = sf.ButterworthHighPass(higher, freq*1.5 ,6) lower = sf.ButterworthHighPass(lower, freq*0.75 ,6) return sf.Realise(mix(sf.Pcnt95(lower), sf.Pcnt5(higher)))
def bright_flute(length, freq): sig = mix( bright_flute_base(length, freq), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -28), (128, -40), (length, -40)))) sig = sf.FixSize(polish(sig, freq)) return pitch_move(sig)
def post_process_echo(notes): count = 0 tnsl = [] tnsr = [] for note in notes: nlr, atl, atr = note c_log("Echo phase 1 done: ", count) notel, noter = nlr tnsl.append([notel, atl]) tnsr.append([noter, atr]) count += 1 tnl = mix(tnsl) tnr = mix(tnsr) c_log("Echo phase 2 done") tnl = echo_division(tnl) tnr = echo_division(tnr) c_log("Echo phase 3 done") return tnl, tnr
def viola(length, freq): sig = mix( viola_base(length, freq), sf.Multiply( clean_noise(length, freq * 0.5), sf.ExponentialShape((0, -60), (64, -20), (128, -36), (length, -36)))) sig = sf.FixSize(polish(sig, freq)) return pitch_move(sig)
def viola(length,freq): sig=mix( viola_base(length,freq), sf.Multiply( clean_noise(length,freq*0.5), sf.ExponentialShape((0,-60),(64,-20),(128,-36),(length,-36)) ) ) sig=sf.FixSize(polish(sig,freq)) return pitch_move(sig)
def trost_sweet_flute(length, freq): sig = sweet_flute_base(length, freq) wind = sf.Multiply( clean_noise(length, freq), sf.ExponentialShape((0, -60), (64, -16), (128, -20), (length, -20))) sig = sf.Multiply(sf.LinearShape((0, 0), (32, 1), (length, 1)), sig) start = sf.Multiply( mix( sf.FixSize( sf.Power(sf.MakeSawTooth(sf.SineWave(length, freq * 0.500)), 2.0)), sf.FixSize( sf.Power(sf.MakeSawTooth(sf.SineWave(length, freq * 0.123)), 2.0))), sf.LinearShape((0, 3.0), (32, 0), (length, 0))) start = polish(start, freq * 0.5) sig = mix(sig, start, wind) sig = sf.FixSize(polish(sig, freq)) return pitch_move(sig)
def stopped_pulse(length,frequency): p=random.random() if frequency>3000: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),1.0/2.0) ) else: sig=mix( sf.PhasedSineWave(length,frequency,p), sf.NumericVolume(sf.PhasedSineWave(length,frequency*3.0,p),1.0/1.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*5.0,p),1.0/1.5), sf.NumericVolume(sf.PhasedSineWave(length,frequency*7.0,p),1.0/2.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*9.0,p),1.0/4.0), sf.NumericVolume(sf.PhasedSineWave(length,frequency*11.0,p),1.0/8.0) ) return sf.FixSize(sig)
def stopped_reed(length,freq): s1=stopped_pulse(length,freq*1.000) s1=polish(s1,freq) sig=mix( s1, sf.Multiply( clean_noise(length,freq*2.0), sf.ExponentialShape((0,-60),(64,-16),(128,-20),(length,-20)) ) ) sig=sf.FixSize(sig) sig=mix( sf.Pcnt10(sf.Clean(sf.Saturate(+sig))), sig ) sig=polish(sig,freq) return sf.FixSize(sig)
def bright_plucked_glass(length,freq): sig=mix( stretched_bass(length,freq,z=1.5,s=1.02,d=1.0,at=4000), sf.Multiply( clean_noise(length,freq*2.0), sf.ExponentialShape((0,-60),(64,-20),(128,-36),(length,-36)) ) ) sig=sf.RBJPeaking(sig,freq*5,0.5,5) start=sf.Multiply( mix( sf.FixSize(sf.MakeSawTooth(sf.SineWave(length,freq*0.75))), sf.FixSize(sf.MakeSawTooth(sf.SineWave(length,freq**0.5))) ), sf.ExponentialShape((0,1.0),(16,-30),(32,-60),(length,-99)) ) start=sf.Clean(start) sig=mix(sf.FixSize(sig),sf.FixSize(start)) return sf.FixSize(sf.Clean(sig))
def single_bombard(length,freq): sig=mix( sf.Pcnt33(bombard_pulse(length,freq)) , sf.Multiply( clean_noise(length,freq*0.5), sf.ExponentialShape((0,-60),(64,-16),(128,-24),(length,-20)) ) ) return pitch_move(sig)