Avoiding multiplexer

For general discussion related FlowStone
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Avoiding multiplexer

Post 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;
...


RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Avoiding multiplexer

Post by RJHollins »

hm ... tried to put this in the circuit ... did not pass audio.

I changed spelling:

Code: Select all

streamut out0;

to

Code: Select all

streamout out0;


still not work.

You said this should follow the 'multiplexer' module ?
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Avoiding multiplexer

Post by KG_is_back »

RJHollins wrote:hm ... tried to put this in the circuit ... did not pass audio.

I changed spelling:

Code: Select all

streamut out0;

to

Code: Select all

streamout out0;


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).
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Avoiding multiplexer

Post 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 :oops:

still .... thx KG
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Avoiding multiplexer

Post 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.
"There lies the dog buried" (German saying translated literally)
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Avoiding multiplexer

Post 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 :o
We're talking more than a 10dB drop.

Curious minds wonder WHY :|
Post Reply