Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Adding Polystreams

DSP related issues, mathematics, processing and techniques

Adding Polystreams

Postby tulamide » Mon May 15, 2017 5:12 pm

Since I only read rumours about it, I would like to get a definitive answer (MyCo? Martin?). Two screenshots below, and it is only about the wiring. So please ignore that you see three times the same osc, or that they all are at the same frequency. Just assume different oscillators or different frequencies. The question is if either of these are valid connections? If not, please explain why not. This question is important for me, since I will have a whole bunch of oscillators that will produce sound on the same midi input, and will all share the same effects. I magining that I would have to build a seperate filter for each oscillator, etc., until I convert to mono streams is horrifying.

streams_01.PNG
Is this a valid connection of streams?
streams_01.PNG (29.56 KiB) Viewed 35834 times

stream_02.PNG
And what about this? Still valid?
stream_02.PNG (26.98 KiB) Viewed 35834 times
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Adding Polystreams

Postby adamszabo » Mon May 15, 2017 6:14 pm

Yes its perfectly valid, but using it like that, you are just adding three different waveforms together producing a new waveform. On that pic, it will simply become a three times louder sine.
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Adding Polystreams

Postby tulamide » Mon May 15, 2017 7:18 pm

adamszabo wrote:Yes its perfectly valid, but using it like that, you are just adding three different waveforms together producing a new waveform. On that pic, it will simply become a three times louder sine.

Thank you, Adam! I really needed this confirmation. I will be playing around with 30-40 oscillators, so that was a big issue of uncertainty for me!

Regarding your objection, please notice that I said:
tulamide wrote:So please ignore that you see three times the same osc, or that they all are at the same frequency. Just assume different oscillators or different frequencies.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Adding Polystreams

Postby adamszabo » Tue May 16, 2017 6:41 am

tulamide wrote:So please ignore that you see three times the same osc, or that they all are at the same frequency. Just assume different oscillators or different frequencies.


Hehe, yes I am well aware of that, I just wanted to explain what would happen if you would use that pic to actually create your synth. If you were to have one of them as a square, then a saw, then a sine. it would be like creating a new waveform adding all of them together, and that waveform goes into the filter.
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: Adding Polystreams

Postby Nubeat7 » Tue May 16, 2017 12:09 pm

I remember that in the old sm forum there was a recommendation to use the add primitives. But i cant remember why and i normally don't do it.

btw. When you plan to put some parts into asm for optimizing it can be very helpful to use the add primitives, like this it is easier to translate it to code.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Adding Polystreams

Postby tulamide » Tue May 16, 2017 4:30 pm

Nubeat7 wrote:I remember that in the old sm forum there was a recommendation to use the add primitives. But i cant remember why and i normally don't do it.

btw. When you plan to put some parts into asm for optimizing it can be very helpful to use the add primitives, like this it is easier to translate it to code.

I wouldn't be able to do any assembler code. But if I find somebody willing to do it, it might be helpful for that one to use the primitives. Thanks for the heads-up!

adamszabo wrote:
tulamide wrote:So please ignore that you see three times the same osc, or that they all are at the same frequency. Just assume different oscillators or different frequencies.


Hehe, yes I am well aware of that, I just wanted to explain what would happen if you would use that pic to actually create your synth. If you were to have one of them as a square, then a saw, then a sine. it would be like creating a new waveform adding all of them together, and that waveform goes into the filter.

I see. Yes, that's my intent. I'm playing around with additive synth. The uncertainty came from reports I remembered, where we got warned never to cross the individual streams. That gave me a headache, since it would prohibit the purpose of additive synthesis.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Adding Polystreams

Postby KG_is_back » Tue May 16, 2017 11:03 pm

Nubeat7 wrote:I remember that in the old sm forum there was a recommendation to use the add primitives. But i cant remember why and i normally don't do it.


It might be because with add primitive you can parallelize the adding. If you just use plain connections the resulting code is equivalent with: out=((a+b)+c)+d
With add primitives you can arrange the additions into a tree: out=(a+b)+(c+d)
processor can then execute (a+b) in parallel with (c+d). However, the improvement will be rather insignificant - you save about as many CPU cycles as you have connectors, since float addition is only 2-4 cycles to begin with...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Adding Polystreams

Postby tulamide » Wed May 17, 2017 7:34 pm

KG_is_back wrote:
Nubeat7 wrote:I remember that in the old sm forum there was a recommendation to use the add primitives. But i cant remember why and i normally don't do it.


It might be because with add primitive you can parallelize the adding. If you just use plain connections the resulting code is equivalent with: out=((a+b)+c)+d
With add primitives you can arrange the additions into a tree: out=(a+b)+(c+d)
processor can then execute (a+b) in parallel with (c+d). However, the improvement will be rather insignificant - you save about as many CPU cycles as you have connectors, since float addition is only 2-4 cycles to begin with...

That's some interesting info I wasn't aware of. Thank you!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Adding Polystreams

Postby stw » Wed May 17, 2017 9:39 pm

KG_is_back wrote:It might be because with add primitive you can parallelize the adding. If you just use plain connections the resulting code is equivalent with: out=((a+b)+c)+d
With add primitives you can arrange the additions into a tree: out=(a+b)+(c+d)
processor can then execute (a+b) in parallel with (c+d). However, the improvement will be rather insignificant - you save about as many CPU cycles as you have connectors, since float addition is only 2-4 cycles to begin with...


Are you sure?
Parallel processing on poly stream is always acting on the packed 4 mono streams and not on doing equal operation from different places. In fact using add prims is introducing some overhead because it has to store the interim results and therefore should be slightly slower (as you can see in the image).

capture.png
capture.png (45.78 KiB) Viewed 35744 times
stw
 
Posts: 111
Joined: Tue Jul 13, 2010 11:09 am

Re: Adding Polystreams

Postby KG_is_back » Thu May 18, 2017 10:14 am

stw wrote:Are you sure?
Parallel processing on poly stream is always acting on the packed 4 mono streams and not on doing equal operation from different places.


Modern processors use pipeline. Each instruction is executed in stages. Processor can start executing next instruction before the last one has finished, unless the next one expects input from the last one. Also, they load instructions in chunks and execute them in the most favourable order, to maximize the usage of the pipeline.

stw wrote:In fact using add prims is introducing some overhead because it has to store the interim results and therefore should be slightly slower (as you can see in the image).


Yes you are correct about that one. I forgot that flowstone does that...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia


Return to DSP

Who is online

Users browsing this forum: No registered users and 26 guests