Page 2 of 2
Re: Avoiding multiplexer
Posted: Sat Dec 26, 2015 3:10 am
by KG_is_back
RJHollins wrote:How would it be to add a type of crossfade when switching outputs ?
You can make an dezipper for each output, which will be fed in with 0s if the output is deselected and 1s when it is selected. The dezipper is especially a low-pass filter, giving a smooth transition between 0 and 1. The output from the envelope follower will then be multiplied by input and fed into respective output.
Code: Select all
streamin in;
streamin index;
streamut out0;
streamout out1;
...
float py0,py1,py2,...
float ind;
float b0=0.9995; //1-pole lowpass coefficient for dezipper.
//envelope follower for zeroth output
ind=1&(index==0);
py0=(py0-ind)*b0+ind;
//output selector
out0=in*py0;
//envelope follower for first output
ind=1&(index==1);
py1=(py1-ind)*b0+ind;
//output selector
out1=in*py1;
...
Re: Avoiding multiplexer
Posted: Sat Dec 26, 2015 3:49 am
by RJHollins
hm ... tried to put this in the circuit ... did not pass audio.
I changed spelling:
to
still not work.
You said this should follow the 'multiplexer' module ?
Re: Avoiding multiplexer
Posted: Sat Dec 26, 2015 4:01 am
by KG_is_back
RJHollins wrote:hm ... tried to put this in the circuit ... did not pass audio.
I changed spelling:
to
still not work.
You said this should follow the 'multiplexer' module ?
sorry for the typo... No, this is a replacement for a multiplexer. It has one input "in" which is being multiplexed between the outputs, based on the "index" input. Also note, that I've put "..." in the code, to indicate, where you should repeat the pattern to add new outputs. Namely the first "..." denotes that you may add additional "streamout out2;". Second one indicates that for each new output you have to add additional "py3" variable (don't forget to end the line with ";"). And finally the last "..." indicates that you have to copy the code and edit respective names of variables (according to the pattern - I've provided two examples, so you can recognize it).
Re: Avoiding multiplexer
Posted: Sat Dec 26, 2015 4:14 am
by RJHollins
mmm ... ok.
I copied the code, made the spelling change, and just tried to pass audio [pink noise] to a VU meter
using only the dezipper code [module].
On the 2nd input [INDEX], I placed a toggle switch [boolean].
Nothing

I will need to come back to this ... hope to figure out.
Not having done any DSP coding, it's easy for me to goof up
still .... thx KG
Re: Avoiding multiplexer
Posted: Sat Dec 26, 2015 7:53 pm
by tulamide
KG, that's an awesome replacement for the multiplexer. Thank you for all the versions. Can't wait to see it in action.
Re: Avoiding multiplexer
Posted: Sun Dec 27, 2015 12:08 am
by RJHollins
not to derail ...
but I mentioned the de-zipper.
I just placed a [green] de-zipper after the new ruby multiplexer, and the volume level dropped significantly
We're talking more than a 10dB drop.
Curious minds wonder WHY
