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

Shallow Water effect #58

Closed
nebularnoise opened this issue Jun 15, 2018 · 9 comments
Closed

Shallow Water effect #58

nebularnoise opened this issue Jun 15, 2018 · 9 comments
Assignees

Comments

@nebularnoise
Copy link
Contributor

Hey y'all. I figured some sort of shallow water clone would be cool to have.

For reference, here's the original effect: https://www.youtube.com/watch?v=sYWuTmgVU9k

At first I thought I'd try to model it like they did on the pedal, with a repitching delay, but that is not possible with Faust, so I did a rough approximation with Faust's transpose

Here's the code, so far:

import("stdfaust.lib");

// CONSTANTS
nyquist = ma.SR / 2;

lp_min_freq = 10;               //(Hz)
lp_max_freq = 10000;            //(Hz)
lp_default_freq = lp_max_freq;  //(Hz)
lp_env_attack = 0.02;           //(s)
lp_env_release = 0.05;          //(s)
lp_res = 0.4;
noise_filter_order = 2;         //(number of poles)
window_length = 2048;           //(samples)
xfade_duration = 1024;          //(samples)
max_repitch = 3;                //(semitones)
min_rate = 0.02;                //(Hz)
default_rate = min_rate;
max_rate = 20;                  //(Hz)
step_rate = 0.02;               //(Hz)
env_lp_normalizer = 5000;       //(Hz)

//Controls
lpg   = hslider("lpg",lp_max_freq,lp_min_freq,lp_max_freq,0.001) : si.smoo;
rate  = hslider("rate",default_rate,min_rate,max_rate,step_rate) : si.smoo;
depth = hslider("depth",0,0,1,0.001) : si.smoo;
damp  = hslider("damp",0,0,0.999,0.001) : si.smoo;

noise = no.lfnoise(rate) : si.smooth(damp);
repitch = _ : ef.transpose(window_length, xfade_duration, max_repitch * noise * depth) : _;
cutoff(in) = lpg + an.amp_follower_ud(lp_env_attack, lp_env_release,in) * env_lp_normalizer;

process(in) = in : repitch : ve.moog_vcf_2b(lp_res, min(nyquist,cutoff(in))) : _;

It needs refining, like log scale controls and autofilter, but the idea is there

@AlbertSmit
Copy link
Collaborator

Man, it sounds so cool already. Awesome!

@nebularnoise
Copy link
Contributor Author

Thanks, glad you like it :)

@topisani
Copy link
Member

This would be cool to have in v0.0.1, whats the status on it, and do you have any UI ideas @D-I-S-K-U-S?

@AlbertSmit AlbertSmit self-assigned this Jul 26, 2018
@AlbertSmit
Copy link
Collaborator

AlbertSmit commented Jul 26, 2018

So, I'm messing around for the UI.
I was thinking that, even though we talked about using another name, the 'shallow water' name is quite accurate for what the effect 'sounds like'.

I'm trying to make an abstract representation of a reflection in the water.
We could have the 'circle/sun' go 'down' into the sea, making the circle (upper half) smaller, and also reducing the size of the reflection (obviously). Next to that, we could make the 'sea' increase the 'waves' so the reflection goes all floaty and wavey. Any ideas on this regard? I just used two colours, we could include more if we wanted. I do however like the simplicity.

schermafbeelding 2018-07-26 om 16 34 29

What I'd like to know from @nebularnoise , how do the following parameters affect the effect, in the most simple explanation?

  • LPG
  • Rate
  • Depth
  • Damp

Let me know, and let me know what you think!

ps; have also tried other shapes, but a circle has the most dynamics in the reflection, i think.
schermafbeelding 2018-07-26 om 16 41 23

@nebularnoise
Copy link
Contributor Author

Nice design, I like it 👍

Quick explanation:

  • LPG: Cutoff frequency of an enveloppe-follower modulated low pass filter. (low settings will make the effect darker and more expressive, high settings make the filtering more transparent and subtle)
  • Rate: Speed of pitch modulation (from imperceptibly modulated to audio-rate pitch modulation)
  • Depth: Depth of pitch modulation (high settings for very crazy, low settings for chorusey, tape wobbley effect)
  • Damp: Smoothes the pitch modulation (makes it less steppy and more wavey)

My comments:
I'd love to see the LPG being the sun height. However, the ultimate thing would be to have a more transparent sun follow the volume, just like the real filter cutoff.
modulated shallow
It needs refining, obviously, but I think a dynamic UI would be dope.

Depth should make the waves more wavey, with damp making them either sharp or smooth. Rate should increase either the amount of waves, or their vertical spacing, imo.

Here with low rate and high damp:
modulated shallow legend

Here with high rate and low damp:
modulated shallow high mod

PS: Please Pardon my poor photoshop skills

@topisani
Copy link
Member

topisani commented Jul 27, 2018

I'm loving it™

I'll put this on track for v0.0.1, unless anyone thinks they need more time

@nebularnoise
Copy link
Contributor Author

I've heard I ought to make it stereo, so here y'all go: a very naive stereoisation of the effect. No fancy intermodulation of sides or anything.

import("stdfaust.lib");

// CONSTANTS
nyquist = ma.SR / 2;

lp_min_freq = 10;               //(Hz)
lp_max_freq = 10000;            //(Hz)
lp_default_freq = lp_max_freq;  //(Hz)
lp_env_attack = 0.02;           //(s)
lp_env_release = 0.05;          //(s)
lp_res = 0.4;
noise_filter_order = 2;         //(number of poles)
window_length = 2048;           //(samples)
xfade_duration = 1024;          //(samples)
max_repitch = 3;                //(semitones)
min_rate = 0.02;                //(Hz)
default_rate = min_rate;
max_rate = 20;                  //(Hz)
step_rate = 0.02;               //(Hz)
env_lp_normalizer = 5000;       //(Hz)

//Controls
lpg   = hslider("lpg",lp_max_freq,lp_min_freq,lp_max_freq,0.001) : si.smoo;
rate  = hslider("rate",default_rate,min_rate,max_rate,step_rate) : si.smoo;
depth = hslider("depth",0,0,1,0.001) : si.smoo;
damp  = hslider("damp",0,0,0.999,0.001) : si.smoo;

noise = no.lfnoise(rate) : si.smooth(damp);
repitch = _ : ef.transpose(window_length, xfade_duration, max_repitch * noise * depth) : _;
cutoff(in) = lpg + an.amp_follower_ud(lp_env_attack, lp_env_release,in) * env_lp_normalizer;

process(left, right) = left, right : repitch, repitch : ve.moog_vcf_2b(lp_res, min(nyquist,cutoff(left))), ve.moog_vcf_2b(lp_res, min(nyquist,cutoff(right))) : _, _;

@AlbertSmit
Copy link
Collaborator

That's awesome.

I moved the UI chatter for this effect to a new issue for the Alpha.

@topisani
Copy link
Member

This would need to be reimplemented in gamma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants