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

feature request - accurate trig functions in blue

For general discussion related FlowStone

feature request - accurate trig functions in blue

Postby tester » Mon Jan 14, 2013 2:37 pm

Hey support - please add accurate trigonometric functions in "blue" version. sin, cos, tan, atan, and so on.

Green versions are accurate, but they not passing streams.

"In code" versions (not to mention the lack of atan) are based on approximations, and are useless for precise work.

And by the way - can't the smart components be switched between green and blue if they perform similar function? Can't you simply add a "checkbox" that indicates "accurate" (by default) vs "approximate" when it comes to things like trigonometric functions?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: feature request - accurate trig functions in blue

Postby support » Thu Jan 17, 2013 4:32 pm

It is possible to do this in Ruby if you use the mono to frames and frames to Mono.

Here's an example of a sine wave generated in Ruby:

Ruby mono to frame sine example clip-2.png
Ruby mono to frame sine example clip-2.png (105.27 KiB) Viewed 24029 times
Attachments
Ruby mono to frame sine example.fsm
(7.17 KiB) Downloaded 1107 times
User avatar
support
 
Posts: 151
Joined: Fri Sep 07, 2012 2:10 pm

Re: feature request - accurate trig functions in blue

Postby tester » Thu Jan 17, 2013 9:47 pm

Dear support, the problem is also with performance of such functions.
Computers have limited speed ;-)

Ruby version would not be suitable neither to my research project that involves multiple generators (even with built in sine osc - I can't use all units at once) nor to my research projects that involves special modulated filters (blue approximation of green version - eats about 3x time of CPU, and ruby version would eat much much more I guess).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: feature request - accurate trig functions in blue

Postby MyCo » Thu Jan 17, 2013 10:39 pm

ASM Workaround.

BTW: How many sines do you use, that it kills the CPU? On my system, I can do 2400 Sine calculations in SM and come only to 59% CPU usage... And this is my old PC, on my new one, I'll propably have 3 times more CPU Power
Attachments
stream_trig_functions (MyCo).fsm
(126.31 KiB) Downloaded 1031 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: feature request - accurate trig functions in blue

Postby tester » Thu Jan 17, 2013 11:56 pm

In terms of "sine oscillator" - not too many, but I don't remember the detail now. Checking briefly - on my 2GHz unit (laptop), one core is full (and sound starts to break) at various 29 stereo sine outputs (built-in sine osc, SM not FS), so I guess c.a. 60 sine oscs can work at the same time together or a bit more if some of them would serve as modulators at lower frequency. If FS improved the performance, this should be a bit more. Performance is tricky - you get different readings if you feed all oscs with the same input data as far I remember.

In terms of trigonometric calculations - I don't know what to think:
http://synthmaker.co.uk/forum/viewtopic ... =90#p90873
...and this difference seems to be due to change the coeffs from green to blue; blue unit showed similar performance when all other modules (detuning related) were removed.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: feature request - accurate trig functions in blue

Postby MyCo » Fri Jan 18, 2013 12:49 am

In the "2Pole BP" Module you could use hop(128) around the whole code there, to calculate the coeffs only every 128 samples, instead of calculating it every sample. I've tested it, it reduces the the CPU usage down to 2/3.

There are also many other chances to optimize for a special case. Eg. the filter coeffizient b1 is always zero, so it could be removed from the filter code completely.

Converting everything to assembler, and doing further optimization there, would reduce the CPU usage by another 20-30%...

Just use your brain, or money :twisted:
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: feature request - accurate trig functions in blue

Postby tester » Fri Jan 18, 2013 12:52 am

Instead of my brain or money - can I use your help? ;-)

...or if you eager to get some of my music, you should say so on the beginning :-)
It's like money, just in different form.

//edit:
indeed, removing b1 and adding hop(128) made that thing much faster.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: feature request - accurate trig functions in blue

Postby tester » Sun Jan 20, 2013 10:41 pm

Answering to one of your questions - 280 sine oscillators on 2GHz (one core of D2D CPU), in which 32 are carriers (audible sounds), and the rest modulates variety of things ;-) Around that amount - app starts to crackle.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: feature request - accurate trig functions in blue

Postby infuzion » Mon Jan 21, 2013 7:25 am

MyCo wrote:ASM Workaround.
In the Tan, you have fstp twice per line; is there a reason for this please?
infuzion
 
Posts: 109
Joined: Tue Jul 13, 2010 11:55 am
Location: Kansas City, USA, Earth, Sol

Re: feature request - accurate trig functions in blue

Postby MyCo » Mon Jan 21, 2013 1:45 pm

infuzion wrote:
MyCo wrote:ASM Workaround.
In the Tan, you have fstp twice per line; is there a reason for this please?


Yes. fptan opcode pushs its result on the stack and then it pushs "1"... so to get the right result you have to pop a dummy (which is always 1) and then pop the result.

BTW: I've made a mistake on the other SSE channels in the tan function. I've attached the fixed version.
Attachments
stream_trig_functions (MyCo).fsm
(126.32 KiB) Downloaded 1020 times
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Next

Return to General

Who is online

Users browsing this forum: No registered users and 84 guests