|
Post by Rob on May 30, 2018 21:11:17 GMT 1
Cool beans! Btw, you might wanna clip the in/out values to make it end-user proof i.e. if a user inputs +100 into that list, there might be issues. Hmm, I probably should. By list you mean: InLow, InHi, OutLow, OutHi ? I found this clip function:
float vOut, vIn;
float Cup = 100.f; float Clow = -100.f;
float clip(float n, float lower, float upper) { return max(lower, min(n, upper));}
Then I do this: valueIn = frescaler(clip(OutLow, Clow, Cup ), etc etc Or do you mean: valueIn = clip(frescaler( Outlow, etc etc ), Clow, Cup ); I also tried:
vIn = frescaler(OutLow, OutHi, InLow, InHi, valueOut); valueIn = clip(vIn, Clow, Cup); But none seem to really clip the input or output when I try in Synthedit.. Can input large numbers and get a changing output each time ( confused ).
|
|
|
Post by twoifbysea on May 30, 2018 21:19:35 GMT 1
I don't want to push my luck with all of this help, but here's another one. Any idea how to make this bi-directional? ROY Mulitply is set to bi-directional, but I assume that entered values aren't being passed through the float to volt backward conversion? I'm just trying to learn this at a basic level.
|
|
|
Post by Rob on May 31, 2018 19:24:09 GMT 1
Only subcontrol modules are able to have bi-directional communication.
I think you want to do the same as in the previous knob example. Use that then send the output to the float to volts (dsp).
|
|
|
Post by twoifbysea on May 31, 2018 23:59:10 GMT 1
Thanks Rob, that worked.
|
|
Andrew
Developer
Posts: 110
Posts: 110
|
Post by Andrew on Jun 1, 2018 16:39:26 GMT 1
Actually just have to clip the value coming back from the text entry - i.e. right to left. The left to right min/max values is set in stone when saving as VST(automation is normalized) so shouldn't be a problem.
void TD_FloatRescaler::onSetValueOut()//value being passed back by text entry { float clippedValue = min(max(OutLow,valueOut),OutHi);
valueIn = frescaler(OutLow,OutHi,InLow,InHi,clippedValue); }
twoifbysea - patchmem 'Out' modules are for outputs like VUs, LEDs, bar-graphs etc. The regular patchmems are for inputs from the user - like sliders & knobs.
|
|
|
Post by Rob on Jun 1, 2018 19:04:20 GMT 1
|
|
|
Post by twoifbysea on Jun 2, 2018 22:29:21 GMT 1
Rob, I just noticed that the newest version has the scaling values already set. They're set to the same parameters that we were testing.
|
|
|
Post by Rob on Jun 2, 2018 22:33:04 GMT 1
I added those as default values, so when the module is inserted in a project there are some sensible values shown. Any value can be set, is it causing a problem now?
|
|
|
Post by twoifbysea on Jun 3, 2018 4:10:49 GMT 1
No, it’s not causing any problems. For my purposes it’s ideal. It’s already set up for a +/- 12 dB sub control.
|
|