Skip to content

Commit 00ec920

Browse files
committed
more
1 parent 56df7dd commit 00ec920

File tree

2 files changed

+160
-23
lines changed

2 files changed

+160
-23
lines changed

dev/src/dsp-definitions/49-alchemist-prototype-3.ts

Lines changed: 88 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ synth(gate) = ba.midikey2hz : os.triangle : *(gate) : *(0.2);
1717
gtr_synth = tunePlayer(tune1) : synth;
1818
bass_synth = tunePlayer(tune2) : synth;
1919
20-
// alchemist.dsp
2120
//
22-
// B
23-
// A C
24-
// D
21+
// alchemist.dsp - bass compressor only
22+
//
2523
2624
// utils
2725
@@ -62,34 +60,37 @@ layerValue(l,i,t,x) = return with {
6260
return = x : sAndHWithDefault(0.5, (l == i) & layerIsAwake(l,x,t));
6361
};
6462
65-
sine(rate) = os.osc(rate) + 1. * .5;
66-
6763
// consts
6864
69-
chorus_voice_count = 5;
70-
// ...
71-
7265
// input
66+
//
67+
// B
68+
// A C
69+
// D
7370
74-
// lag_param = hslider("lag[OWL:A]", 0.5, 0.0, 1.0, 0.001) : reject_noise(0.05, 1.0) : si.smoo;
75-
// shape_param = hslider("shape[OWL:B]", 0, 0, shape_count, 1) : int;
76-
// trem_param = hslider("trem[OWL:D]", 0.5, 0.0, 1.0, 0.001) : reject_noise(0.05, 1.0) : si.smoo;
77-
// depth_param = hslider("depth[OWL:C]", 0.5, 0.0, 1.0, 0.001) : reject_noise(0.05, 1.0) : si.smoo;
78-
// width_button = button("width[OWL:B1]");
79-
// alt_button = button("alt[OWL:B2]");
71+
detune_param = hslider("detune[OWL:A]", 0., 0., .2, .001) : si.smoo;
72+
wet_param = hslider("wet[OWL:B]", 0., 0., 1., .01) : si.smoo;
8073
81-
// effects
74+
// TODO trem
75+
// TODO autopan / width options
76+
// TODO chorus width?
77+
// TODO parked reverb?
78+
// TODO modulate pitch shift?
79+
// TODO adjust relative pitch shift?
8280
83-
// chorus_offset(i) = sine(5.0 + i) + sine(2.3 + i * .5) + sine(5.7 + i * .2) : /(3.);
81+
// foo_button = button("foo[OWL:B1]");
82+
// bar_button = button("bar[OWL:B2]");
8483
85-
chorus_offset(i) = sine(5.0 + i);
86-
chorus_voice(i) = de.fdelay(3000, chorus_offset(i * .1) * 10.) <: _,_;
87-
chorus(x) = x <: par(i, chorus_voice_count, chorus_voice(i)) :> /(chorus_voice_count),/(chorus_voice_count);
84+
// fx
8885
89-
// routing
86+
fx = ef.transpose(ma.SR * .003, ma.SR * .003 * .9, -detune_param);
87+
fx2 = ef.transpose(ma.SR * .0041, ma.SR * .0041 * .9, -detune_param * .5);
88+
gtr = *(wet_param) <: fx,fx2 : _,_;
9089
91-
gtr = _ : chorus : _,_;
92-
bass = _ <: _,_;
90+
bass_gate = ef.gate_mono(-64., .005, 0., 1.);
91+
bass_comp = co.compressor_mono(32., -34., 0., .4);
92+
bass_makeup = *(5.);
93+
bass = bass_gate : bass_comp : bass_makeup <: _,_;
9394
9495
amp = *(3.0);
9596
process = gtr_synth,bass_synth : gtr,bass :> amp,amp;
@@ -104,3 +105,67 @@ const dspDefinition: DspDefinition = {
104105
};
105106

106107
export default dspDefinition;
108+
109+
/**
110+
* PARAMS:
111+
*
112+
* detune = - vol 20%: depth 0 ... 100%
113+
* - vol 50%: depth 0 ... 100%
114+
* - vol 100%: depth 0 ... 100%
115+
*
116+
* trem = - depth 50%: rate .2Hz ... 10Hz
117+
* - depth 100%: rate .2Hz ... 10Hz
118+
* - ??? randomise depth?
119+
*
120+
* width = - straight: mono ... stereo
121+
* - autopan: slow ... fast
122+
* - offset: 0ms ... 500ms
123+
* - ping pong: 0ms ... 500ms
124+
*
125+
* sidechain = - volume decrease: 0 ... 100%
126+
*
127+
* BUTTONS:
128+
*
129+
* A:
130+
* - tap: enable / disable chorus
131+
* - hold + B: select sidechain mode?
132+
* - volume
133+
* - low pass
134+
* - high pass
135+
* - reverb swell ??????
136+
*
137+
* B:
138+
* - tap: enable / disable trem
139+
* - hold + A:
140+
*
141+
*
142+
*
143+
*
144+
*
145+
*
146+
*
147+
*
148+
*
149+
*
150+
*
151+
*
152+
*
153+
*
154+
*
155+
*
156+
*
157+
*
158+
*
159+
*
160+
*
161+
*
162+
*
163+
*
164+
*
165+
*
166+
*
167+
*
168+
*
169+
*
170+
*
171+
* */

dev/src/snippets/alchemist-5.dsp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//
2+
// alchemist.dsp - bass compressor only
3+
//
4+
5+
import("stdfaust.lib");
6+
7+
// utils
8+
9+
counter(trig) = upfront(trig) : + ~ _ with { upfront(x) = x > x'; };
10+
11+
lerp(a, b, x) = a + (b - a) * x;
12+
13+
constantPowerPan(p, x) = x*gainLeft, x*gainRight
14+
with {
15+
theta = ma.PI*p/2.;
16+
gainLeft = cos(theta)/sqrt(2.);
17+
gainRight = sin(theta)/sqrt(2.);
18+
};
19+
20+
reject_noise(slack, move_time, x) = return with {
21+
loop(prev_out, prev_timer, x) = loop_return with {
22+
trig = abs(prev_out - x) > slack;
23+
timer = ba.if(trig, 0, prev_timer + 1);
24+
out = ba.if(trig | timer < ma.SR * move_time, x, prev_out);
25+
loop_return = out,timer;
26+
};
27+
return = x : loop ~ (_,_) : (_,!);
28+
};
29+
30+
isFirstTick = ba.time == 0;
31+
sAndHWithDefault(default, trig, x) = ba.sAndH(isFirstTick | trig, select2(isFirstTick, x, default));
32+
33+
changed(x) = x != x';
34+
35+
layerIsAwake(l,x,t) = return with {
36+
layerChange = l : changed;
37+
startPos = x : ba.sAndH(layerChange);
38+
nudged = abs(x - startPos) > t;
39+
return = layerChange,nudged : ba.on_and_off : _ == 0;
40+
};
41+
42+
layerValue(l,i,t,x) = return with {
43+
return = x : sAndHWithDefault(0.5, (l == i) & layerIsAwake(l,x,t));
44+
};
45+
46+
// consts
47+
48+
// input
49+
//
50+
// B
51+
// A C
52+
// D
53+
54+
detune_param = hslider("detune[OWL:A]", 0., 0., .2, .001) : si.smoo;
55+
wet_param = hslider("wet[OWL:B]", 0., 0., 1., .01) : si.smoo;
56+
57+
// foo_button = button("foo[OWL:B1]");
58+
// bar_button = button("bar[OWL:B2]");
59+
60+
// fx
61+
62+
fx = ef.transpose(ma.SR * .003, ma.SR * .003 * .9, -detune_param);
63+
fx2 = ef.transpose(ma.SR * .0041, ma.SR * .0041 * .9, -detune_param * .5);
64+
gtr = *(wet_param) <: fx,fx2 : _,_;
65+
66+
bass_gate = ef.gate_mono(-64., .005, 0., 1.);
67+
bass_comp = co.compressor_mono(32., -34., 0., .4);
68+
bass_makeup = *(5.);
69+
bass = bass_gate : bass_comp : bass_makeup <: _,_;
70+
71+
amp = *(3.);
72+
process = gtr,bass :> amp,amp;

0 commit comments

Comments
 (0)