Skip to content

Commit

Permalink
huh
Browse files Browse the repository at this point in the history
  • Loading branch information
dxinteractive committed Jun 24, 2024
1 parent 422714f commit 37417cf
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 11 deletions.
15 changes: 4 additions & 11 deletions dev/src/dsp-definitions/39-autosampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ env_on = env_active : ba.impulsify;
gated = input * env_active;
env_active_timer = env_active : invert_boolean : ba.countup(table_size);
env_active_forever = env_on : ba.on_and_off(_, 0) : >(0);
env_active_sweep = env_active_timer : ba.sweep(table_size);
record_head = env_active_sweep * (env_active_sweep <= sampling_time * 2);
Expand All @@ -33,9 +32,7 @@ vol(v) = cos(v * ma.PI * 2.0) * -0.5 + 0.5;
table(pb, x) = rwtable(table_size, 0.0, record_head(x), x, pb(x)) * vol(pb(x) / sampling_time);
fx(x) = table(playback_head, x) + table(playback_head2, x) + (x * max(0.0, 1.0 - (env_active_sweep / sampling_time) * 2.0));
repeat = fx;
process = fx;
`;

const dspDefinition: DspDefinition = {
Expand All @@ -47,13 +44,9 @@ const dspDefinition: DspDefinition = {
inputFile: "/audio/cycfi-q-pitch-test/GLines3.wav",
channels: 1,
sampleRate: 48000,
outputLength: 48000 * 5,
output: ["gated", "playback_head", "playback_head2", "repeat"],
inputOffset: 18000 + 13000,
output: ["env_active", "process"],
outputLength: 48000 * 20,
inputOffset: 18000 + 13000 + 300000,
};

export default dspDefinition;

//
// playback_head_double = ((env_active_sweep - 1) % sampling_time_2) + 1;
// playback_head2(x) = ba.if(playback_head_double(x) <= sampling_time, playback_head_double(x), sampling_time_2 - playback_head_double(x) + 1);
46 changes: 46 additions & 0 deletions dev/src/dsp-definitions/40-pulse-delay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type { DspDefinition } from "../types";

const dsp = `
import("stdfaust.lib");
delay_max = ma.SR * 5;
wet_param = 1.0;
dry_param = 0.7;
fb_param = 0.9;
time_param = 0.2 * ma.SR;
squash(x) = 1.0 - (1.0 / (x + 1.0));
stretch(mn, mx, x) = (x - mn) / (mx - mn) : min(1.0) : max(0.0);
env = *(10.0) : an.amp_follower_ar(0.1, 0.1) : squash : stretch(0.2, 0.7);
swell(x) = x * env(x);
mod_speed_param = 3.0;
mod_depth_param = 0.0002;
mod = 1.0 - ((os.osc(mod_speed_param) * 0.5 + 0.5) * mod_depth_param);
delay(time, fb, x) = x + fb : de.fdelay(delay_max, time * mod) : fi.highpass(2, 200.0) : fi.lowpass(2, 5000.0);
fb = *(fb_param);
echo(time) = delay(time) ~ fb;
wet = swell <: echo(time_param) :> _;
dry(x) = x * dry_param * (1.0 - env(x) * 0.9);
process = _ <: (dry,wet) :> _;
`;

const dspDefinition: DspDefinition = {
id: "pulse-delay",
name: "Pulse delay",
description: "Smooth off transients before high feedback clean delay",
dsp,
type: "offline",
inputFile: "/audio/cycfi-q-pitch-test/GLines3.wav",
channels: 1,
sampleRate: 48000,
outputLength: 48000 * 20,
inputOffset: 18000 + 13000,
};

export default dspDefinition;
2 changes: 2 additions & 0 deletions dev/src/dsp-definitions/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import wizardDelay from "./36-wizard-delay";
import filterBank from "./37-filter-bank";
import cloudify from "./38-cloudify";
import autosampler from "./39-autosampler";
import pulseDelay from "./40-pulse-delay";

export const all: DspDefinition[] = [
sineWave,
Expand Down Expand Up @@ -80,4 +81,5 @@ export const all: DspDefinition[] = [
filterBank,
cloudify,
autosampler,
pulseDelay,
];

0 comments on commit 37417cf

Please sign in to comment.