Skip to content

Commit

Permalink
sdkjdsf
Browse files Browse the repository at this point in the history
  • Loading branch information
dxinteractive committed Dec 29, 2023
1 parent 1d5d5d6 commit f580ce1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
36 changes: 36 additions & 0 deletions dev/src/dsp-definitions/34-additive-synth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { DspDefinition } from "../types";

const dsp = `
import("stdfaust.lib");
// osc
a = button("a");
b = button("b");
c = button("c");
gate = a | b | c;
pitch = ba.if(a, 60, ba.if(b, 62, 63));
// env
volA = hslider("attack",0.01,0.01,4,0.01);
volD = hslider("decay",2.6,0.01,8,0.01);
volS = hslider("sustain",1,0,1,0.01);
volR = hslider("release",2.0,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,gate);
osc(f) = os.osc(f) + (os.osc(f * 2.0) * 0.2) + (os.osc(f * 6.0) * 0.1);
fx = osc(pitch : ba.midikey2hz) * envelop * 0.3;
process = fx <: _,_;
`;

const dspDefinition: DspDefinition = {
id: "additive-synth",
name: "Additive synth",
description: "Additive synth",
dsp,
type: "live",
};

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 @@ -33,6 +33,7 @@ import echoloop from "./30-echoloop";
import echoloopLive from "./31-echoloop-live";
import minSince from "./32-min-since";
import pitchtracker3 from "./33-pitchtracker-3";
import additiveSynth from "./34-additive-synth";

export const all: DspDefinition[] = [
sineWave,
Expand Down Expand Up @@ -68,4 +69,5 @@ export const all: DspDefinition[] = [
echoloopLive,
minSince,
pitchtracker3,
additiveSynth,
];

0 comments on commit f580ce1

Please sign in to comment.