modulator = subp.obj('osc~', modulator_freq) mult = subp.obj('*~', width) vline[0].to(mult[0]) modulator[0].to(mult[0]) add = subp.obj('+~', carrier_freq) mult[0].to(add[0]) outlet = subp.obj('outlet~') add[0].to(outlet[0]) return subp dac = patch.obj('dac~') freeverb = patch.obj('freeverb~') freeverb[0].to(dac[0]) freeverb[1].to(dac[1]) #carrier_freq = 220 #mod_freq = 400 carrier_freq = 220 mod_freq = 333 oscs = 12 for i in range(oscs): #modulator = get_modulator(carrier_freq, mod_freq, carrier_freq / 3.0) modulator = get_modulator(carrier_freq, carrier_freq * 3, carrier_freq * 2.1)
floor[0].to(scaling[0]) inlet = subp.obj('inlet~') env_mult = subp.obj('*~') inlet[0].to(env_mult[0]) scaling[0].to(env_mult[1]) add = subp.obj('+~', actual_carrier) env_mult[0].to(add[0]) outlet = subp.obj('outlet~') add[0].to(outlet[0]) return subp dac = patch.obj('dac~') #freqs = [(67, 1.0), (134, 0.8), (402, 0.8), (804, 0.2), (335 * 2, 0.35)] # http://www.acoustics.asn.au/journal/1997/1997_25_3_McLachlan.pdf #freqs = [(370 / 2, 1.0), (540 / 2, 0.8), (723 / 2, 0.8), (1080 / 2, 0.55), (1380 / 2, 0.65)] freqs = [] #base_freq = 293 base_freq = 200 freqs.append((base_freq, 1.0)) freqs.append((base_freq * 7 / 4, 0.2)) freqs.append((base_freq * 19 / 9, 0.25)) oscs_per_freq = 4 oscs = len(freqs) * oscs_per_freq low_cutoff = min(freq for freq, _ in freqs) * 0.8 hip_l = patch.obj('hip~', low_cutoff)
from pdgen import PdPatch, RenderVisitor from utils import get_sequence, get_portamento import math patch = PdPatch() dac = patch.obj("dac~") freqs = [200, 210, 250, 289, 295] min_freq = min(freqs) hip = patch.obj("hip~", min_freq * 0.9) base_ratios = [f / min_freq for f in freqs] seq_ratios = [1.0, 1.025, 1.5, 1.08, 1.55, 1.125, 1.66, 1.33] am_mod = None for i, freq in enumerate(freqs): base_ratio = base_ratios[i] seq_freqs = [freq * ratio * base_ratio for ratio in seq_ratios] seq = get_sequence(patch, 120, seq_freqs) patch.loadbang(seq[0]) osc = patch.obj("osc~") portamento = get_portamento(patch, 15 * (1000 / freq)) seq[0].to(portamento[0]) portamento[0].to(osc[0])