Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: chorus #28

Merged
merged 5 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions packages/chorus-t/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# @synthlet/chorus-t

## 0.1.0
## 0.1.x

Initial release
- Initial release
- Fix registration name
2 changes: 1 addition & 1 deletion packages/chorus-t/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@synthlet/chorus-t",
"version": "0.1.0",
"version": "0.1.1",
"description": "A chorus (based on Tagu Audio Line) audio effect in a worklet",
"keywords": [
"chorus",
Expand Down
2 changes: 1 addition & 1 deletion packages/chorus-t/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type ChorusTWorkletNode = AudioWorkletNode & {
setBypass(value: boolean): void;
};

export const registerChorusTWorklet = createRegistrar("CHORUS", PROCESSOR);
export const registerChorusTWorklet = createRegistrar("CHORUS-T", PROCESSOR);

export const ChorusT = createWorkletConstructor<
ChorusTWorkletNode,
Expand Down
5 changes: 5 additions & 0 deletions packages/chorus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @synthlet/chorus

## 0.1.0

- Initial release
5 changes: 5 additions & 0 deletions packages/chorus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @synthlet/chorus

> Chorus effect written in Faust and ported to the web

Part of [Synthlet](https://github.com/danigb/synthlet)
34 changes: 34 additions & 0 deletions packages/chorus/dsp/chorus.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

import("stdfaust.lib");

voices = 8; // MUST BE EVEN
process = chorus_mono(dmax,curdel,rate,sigma,do2,voices);

dmax = 4096; // 8192;
curdel = dmax * vslider("[0] Delay [midi:ctrl 4] [style:knob]", 0.5, 0, 1, 0.001) : si.smooth(0.999);
rateMax = 7.0; // Hz
rateMin = 0.01;
rateT60 = 0.15661;
rate = vslider("[1] Rate [midi:ctrl 2] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001)
: si.smooth(ba.tau2pole(rateT60/6.91));

depth = vslider("[4] Depth [midi:ctrl 3] [style:knob]", 0.5, 0, 1, 0.001) : si.smooth(ba.tau2pole(depthT60/6.91));

depthT60 = 0.15661;
delayPerVoice = 0.5*curdel/voices;
sigma = delayPerVoice * vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001) : si.smooth(0.999);

periodic = 1;

do2 = depth; // use when depth=1 means "multivibrato" effect (no original => all are modulated)

chorus_mono(dmax,curdel,rate,sigma,do2,voices)
= _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+
with {
angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2;
voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i));
del(i) = curdel*(i+1)/voices + dev(i);
rates(i) = rate/float(i+1);
dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices);
};

Loading
Loading