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

Effect "dj-filter" should be inactive when value is 0.5 #293

Open
jarmitage opened this issue Jun 28, 2023 · 7 comments
Open

Effect "dj-filter" should be inactive when value is 0.5 #293

jarmitage opened this issue Jun 28, 2023 · 7 comments

Comments

@jarmitage
Copy link

jarmitage commented Jun 28, 2023

Currently # djf 0.5 is audible, ideally it would not be

SynthDef("dj-filter" ++ ~dirt.numChannels, { |out, djf|
var signal;
var lpfCutoffFreq = djf.linexp(0, 0.5, 20, 10000);
var hpfCutoffFreq = djf.linexp(0.5, 1, 20, 10000);
signal = In.ar(out, ~dirt.numChannels);
signal = RHPF.ar(
RLPF.ar(
signal,
lpfCutoffFreq
),
hpfCutoffFreq
);
ReplaceOut.ar(out, signal)
}, [\ir]).add;

This could be achieved using perhaps some kind of control structure (incorrect code below)

signal = Select.ar(djf != 0.5, [
	signal,
	RHPF.ar(
		RLPF.ar(
			signal,
			lpfCutoffFreq
		),
		hpfCutoffFreq
	)
]);

An alternative might be # djf "-1"

@yaxu
Copy link
Collaborator

yaxu commented Jun 28, 2023

Agreed, 0.5 should be 100% dry signal.
Hwoever when mapping a midi controller to this parameter (which is very handy to do), you might want a bigger central range that turns the effect off, as finding 0.5 in the range can be difficult. But this would be better on the tidal side?
(This control would be a bit easier in a -1 to 1 (bipolar) range, where 0 is no effect.. But somehow in tidal we've long standardised in 0-1.)

@yaxu
Copy link
Collaborator

yaxu commented Jun 28, 2023

This solves it on the tidal side:

import qualified Data.Map.Strict as Map

let djf :: Pattern Double -> ControlPattern
    djf pat = sew ((== 0.5) <$> pat) (pure Map.empty) (pF "djf" pat)

@jarmitage
Copy link
Author

Great, I had tried it on Tidal side, but ran into issues where Pattern Doubles can't use ==, but you've got it there, so probably better than a SuperDirt fix! Thanks

@yaxu
Copy link
Collaborator

yaxu commented Jun 29, 2023

I wonder if tweaking the ranges on the SC side would be a better fix, e.g.:

 	SynthDef("dj-filter" ++ ~dirt.numChannels, { |out, djf| 
 		var signal; 
 		var lpfCutoffFreq = djf.linexp(0, 0.499, 20, 10000); 
 		var hpfCutoffFreq = djf.linexp(0.501, 1, 20, 10000); 
  
 		signal = In.ar(out, ~dirt.numChannels); 
  
 		signal = RHPF.ar( 
 			RLPF.ar( 
 				signal, 
 				lpfCutoffFreq 
 			), 

(probably only one of these ranges needs to be tweaked)

@yaxu yaxu reopened this Jun 29, 2023
@yaxu
Copy link
Collaborator

yaxu commented Jun 29, 2023

If so we could have an 'djfisland' parameter that is added/subtracted from the ranges to make a bigger 'clean' area

@jarmitage
Copy link
Author

Are there other use cases for this pattern? E.g. isn't it the same when setting reverb to 0 that it's still audible? Maybe this is a general feature for SD fx?

@telephon
Copy link
Contributor

I wonder if tweaking the ranges on the SC side would be a better fix, e.g.:

Yes, I think that would be the best.

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

No branches or pull requests

3 participants