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

Implement freq2cv only via binary op ugens #16

Open
capital-G opened this issue Apr 30, 2022 · 3 comments
Open

Implement freq2cv only via binary op ugens #16

capital-G opened this issue Apr 30, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@capital-G
Copy link
Owner

If the freq to cv coversion could be done on the server and the language we could completely disguise the eurorack module in supercollider as a normal synthdef.

I think it is feasible but ugly as the current code is also really messy. Biggest obstacle should be the morphing between the cv values in a dynamic array [albeit it is not dynamic at runtime]

@capital-G capital-G added the enhancement New feature or request label Apr 30, 2022
@capital-G capital-G added this to the v 0.1 milestone Apr 30, 2022
@capital-G capital-G self-assigned this Apr 30, 2022
@capital-G capital-G removed this from the v 0.1 milestone Apr 30, 2022
@capital-G
Copy link
Owner Author

Maybe it is as easy as using a SelectX as we have a linerar composition where we always have the same distance.

@capital-G
Copy link
Owner Author

a first sketch

(
SynthDef(\foo, {|out, freq, tuningX=#[200, 300, 400, 500], tuningY=#[0.1, 0.5, 0.6, 0.7]|
	var sig;
	var foo;
	var which;
	
	which = LinLin.kr(
		in: freq, 
		srclo: tuningX[0], 
		srchi: tuningX.reverse[0], 
		dstlo: 0, 
		dsthi: tuningY.size
	).poll(label: "linlin");
	
	foo = Select.kr(freq>tuningX[0], [
		// if lower boundary crossed
		DC.kr(tuningY[0]) * (freq/tuningX[0]),
		Select.kr(which <= tuningY.size, [
			// if tuning matches range
			SelectX.kr(which, tuningY),
			// if upper boundary is crossed
			DC.kr(tuningY.reverse[0]) * (freq/tuningX.reverse[0]),
		]);
	]);
	foo.poll(label: "foo");
	sig = SinOsc.ar;
	Out.ar(out, sig*0.01);
}).add
)

a = Synth(\foo);

a.set(\freq, 200);

a.set(\freq, 500)

a.set(\freq, 200)

@capital-G
Copy link
Owner Author

Pro:

  • would allow for modulation from the server (e.g. applying a tremolo)

Con:

  • Must use Pmono as otherwise we will have overlapping CVs

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

No branches or pull requests

1 participant