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
11 posts
• Page 1 of 2 • 1, 2
feature request - accurate trig functions in blue
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?
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.
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
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:
Here's an example of a sine wave generated in Ruby:
- Attachments
-
- Ruby mono to frame sine example.fsm
- (7.17 KiB) Downloaded 1107 times
-
support - Posts: 151
- Joined: Fri Sep 07, 2012 2:10 pm
Re: feature request - accurate trig functions in blue
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).
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.
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
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
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
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: feature request - accurate trig functions in blue
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.
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.
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
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
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
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: feature request - accurate trig functions in blue
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.
...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.
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
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.
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
In the Tan, you have fstp twice per line; is there a reason for this please?MyCo wrote:ASM Workaround.
- 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
infuzion wrote:In the Tan, you have fstp twice per line; is there a reason for this please?MyCo wrote:ASM Workaround.
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
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
11 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 70 guests