Old 01-20-2023, 03:46 AM   #1
drsamjoseph
Human being with feelings
 
Join Date: Jan 2023
Location: india
Posts: 2
Default jsfx writing - crossfeed for headphones (error?)

what's the error in following lines

desc:Crossfeed for Headphones

slider1:1000<20,20000>Low Pass Cutoff (Hz)
slider2:0<-60,60,0.1>Make-Up Gain (dB)

in_pin:left input
in_pin:right input
out_pin:left output
out_pin:right output

@init
ext_tail_size = -1;
log2db = 8.6858896380650365530225783783321; // 20 / ln(10)
db2log = 0.11512925464970228420089957273422; // ln(10) / 20
delay = 0.17;
fc = 0;
q = 1;
gain = 1;

@slider
lowpasscutoff = slider1;
gain = exp(slider2 * db2log);
fc = 2 * sin(lowpasscutoff / (2 * srate));

@sample
left = left_input;
right = right_input;
crossfeedl = spl1 * fc;
crossfeedr = spl0 * fc;
spl0 = left + (delay * crossfeedl);
spl1 = right + (delay * crossfeedr);
spl0 *= gain;
spl1 *= gain;
drsamjoseph is offline   Reply With Quote
Old 01-20-2023, 04:22 AM   #2
souk21
Human being with feelings
 
souk21's Avatar
 
Join Date: Mar 2021
Posts: 482
Default

left_input and right_input are never defined and always equal 0
souk21 is offline   Reply With Quote
Old 01-22-2023, 03:24 PM   #3
Steviekeys
Human being with feelings
 
Join Date: Jun 2016
Location: UK
Posts: 285
Default

Left=spl0;
Right=spl1;

?
Steviekeys is offline   Reply With Quote
Old 01-22-2023, 03:49 PM   #4
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
Default

That's not how you do a lowpass or a delay.
ErBird is offline   Reply With Quote
Old 01-23-2023, 12:49 PM   #5
Steviekeys
Human being with feelings
 
Join Date: Jun 2016
Location: UK
Posts: 285
Default

I assumed it wasn't finished.

I have some code for oversampled state variable filter, which would work up to about 14Khz, 12dB per octave I think.
I couldn't get my head around biquads.

Is the delay coefficient in mS?
It will need to be converted to number of samples, then used in some buffer code.
Borrow some from another plugin. There will probably be redundant code in it that may need removing.
Steviekeys is offline   Reply With Quote
Old 01-23-2023, 03:39 PM   #6
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,793
Default

I don't get the slightest idea about what this is supposed to do...
Moreover there are lots of filter and volume control JSFXes, that might be combined to do this (whatever it is). Either by using instances of those or be copying the appropriate code snippets (with reference notes) .
-Michael
mschnell is offline   Reply With Quote
Old 01-24-2023, 01:26 AM   #7
Steviekeys
Human being with feelings
 
Join Date: Jun 2016
Location: UK
Posts: 285
Default

If this is for sending a delayed lowpass to the opposite channel, I think readelay will do this. Set the width to -100 and delay time and lowpass to taste. Then save as preset.
Steviekeys is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.