Page 2 of 3

Re: Stream Router.

Posted: Thu Oct 31, 2013 11:44 pm
by Nubeat7
you re welcome nix!

you can still optimize 3 movaps in assembler
here the optimized one

Code: Select all

streamin index;
streamin v1;
streamin v2;
streamin v3;
streamout value;

float F0=0;
float F1=1;
float F2=2;

movaps xmm0,index;
cmpps xmm0,F0,0;
andps xmm0,v1;
movaps xmm1,index;
cmpps xmm1,F1,0;
andps xmm1,v2;
orps xmm0,xmm1;
movaps xmm1,index;
cmpps xmm1,F2,0;
andps xmm1,v3;
orps xmm0,xmm1;
movaps value,xmm0;

Re: Stream Router.

Posted: Thu Oct 31, 2013 11:56 pm
by nix
nice one!
I will use the DSP code one coz I can follow it better,
but I see you shuffling registers there,
will remember and file this piece of code if I care to delve into ASM.

Joe may very well be interested to see what you've done there.
We have been internet mates for years-
it's only recently he has started developing himself.

Re: Stream Router.

Posted: Sat Nov 02, 2013 11:31 am
by joejoe
nubeat7,

Thanks a lot your code appears to be useful also. Using the | or as you say equivalent to "or" would that be how one could merge two signals down a single bus but not necessarily performing an addition to two or more the signals?

Re: Stream Router.

Posted: Sat Nov 02, 2013 11:34 am
by joejoe
Where could I get a full list of expressions for the DSP code component?

What language is the DSP code, technically?

Re: Stream Router.

Posted: Sun Nov 03, 2013 12:37 am
by Nubeat7
hi joejoe,

you are welcome,
the language is fs/sm`s own dsp language , you can find some words in the user guide (s.222) including a list of possible expressions and some words about buffers, hopping and stages ..
sadly there is not much more info or tutorials to find somewhere ..

just here a little bit :
http://www.synthmaker.co.uk/dokuwiki/do ... ssignments

Re: Stream Router.

Posted: Sun Nov 03, 2013 1:12 am
by strangeChild
What's wrong with using the selector primitive? :?
capture.png
capture.png (8.37 KiB) Viewed 13815 times

Re: Stream Router.

Posted: Sun Nov 03, 2013 1:41 am
by Nubeat7
if i understood it right routing via the selector prim does a recompile of the code which has its issues in some situations (audiodropouts or crackles)

Re: Stream Router.

Posted: Sun Nov 03, 2013 2:11 am
by strangeChild
I've used it extensively with audio steams and as long as the there are no discontinuities in the signal (i.e. the streams f(t) and g(t+1) are near each other) then there is no problem. If they are not either method will have a problem.

Edit = hmm was going to post 'proof' but there's an audible click where there shouldn't be.
I could have sworn this worked before. :oops:

Re: Stream Router.

Posted: Sun Nov 03, 2013 2:30 am
by strangeChild
I think I've figured out when it's OK and not OK to use selector.

As long as the stream you're turning off is still being called somewhere it will work fine. If not there's an audible click as it shuts down, even if the new stream is in sync with it.

In many routing applications this is not a problem as the signal is still getting calculated. But I can see going with the coded variety to avoid the potential problem.

Re: Stream Router.

Posted: Sun Nov 03, 2013 4:41 am
by trogluddite
It's often more of a problem with white poly streams than the blue ones - the switching has a nasty habit of resetting all the envelopes etc. of any playing notes (calls to stage(0) = code/assembly intialisation stage).