def test_waveset_pulsar2d(self): rain = dsp.read('tests/sounds/rain.wav').cut(0, 10) ws = Waveset(rain) ws.normalize() osc = Pulsar2d(ws, windows=['sine'], freq=200.0, amp=0.2) out = osc.play(60) out.write('tests/renders/osc_waveset_pulsar2d.wav')
def test_freq_interpolation_pulsar2d(self): freqs = tune.degrees([1,3,5,9,2,4,6,5,1], octave=3, key='a') * 10 out = Pulsar2d(['sine', 'tri', 'square', 'hann'], ['hann'], freq=freqs, freq_interpolator='trunc', amp=0.2 ).play(10) out.write('tests/renders/osc_pulsar2d_freq_trunc.wav')
def test_create_pulsar2d(self): osc = Pulsar2d(['sine', 'square', 'tri', 'sine'], windows=['sine', 'tri', 'hann'], wt_mod=dsp.wt('saw', 0, 1), win_mod=dsp.wt('rsaw', 0, 1), pulsewidth=dsp.wt('tri', 0, 1), freq=200.0, amp=0.2) length = 30 out = osc.play(length) out.write('tests/renders/osc_pulsar2d.wav') self.assertEqual(len(out), int(length * out.samplerate))
def test_pulsar_from_waveset(self): sound = SoundBuffer(filename='tests/sounds/guitar1s.wav') waveset = Waveset(sound, limit=20, modulo=1) waveset.normalize() osc = Pulsar2d(waveset, windows=['sine'], wt_mod=dsp.wt('saw', 0, 1), win_mod=0.0, pulsewidth=1.0, freq=80.0, amp=0.8) length = 30 out = osc.play(length) out.write('tests/renders/waveset_pulsar2d_wavetables-80hz.wav') self.assertEqual(len(out), int(length * out.samplerate))