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

log10 lookup?

For general discussion related FlowStone

log10 lookup?

Postby R&R » Sat May 25, 2024 9:38 am

The usual. Me and math... :roll:

I'm adding a tiny filter curve visual to my synth. Not representative of the actual filter curve. But...
Kinda feels wrong using log10's for a very rough visual representation only. Even if it's only in green and run at half framerate.

Should I create a LUT array. I guess it would take some comparison, division, subtraction and multiplication.

Any point in LUT to replace 3 instances of log10 (1 used for the arc in the knob dial)... or just a big waste of time?
FilterVisual.jpg
FilterVisual.jpg (32.06 KiB) Viewed 12160 times
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: log10 lookup?

Postby tulamide » Sat May 25, 2024 10:08 am

In green and Ruby it doesn't make sense NOT to use log10. In blue it might be a tradeoff, but even Ruby with its 100Hz max rate can easily calculate it in realtime.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: log10 lookup?

Postby R&R » Sat May 25, 2024 10:26 am

Thanks tulamide good to know...

Felt that FS's CPU consumption seem to increase orders of magnitude when interacting with it's interface and/or it has to redraw... Trying to avoid adding to that cost at all cost :)
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: log10 lookup?

Postby tulamide » Sat May 25, 2024 11:00 am

R&R wrote:Thanks tulamide good to know...

Felt that FS's CPU consumption seem to increase orders of magnitude when interacting with it's interface and/or it has to redraw... Trying to avoid adding to that cost at all cost :)

If its orders of magnitude, then there's an issue in there for you to solve.

In all other cases, no need to hold back. Short peaks are fine and totally normal for an operating system, and Flowstone makes sure that the audio stream is always safe (graphics get delayed and paused in favor of audio)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: log10 lookup?

Postby R&R » Sat May 25, 2024 12:09 pm

tulamide wrote:If its orders of magnitude, then there's an issue in there for you to solve.


Yep no doubt room for improvements :D In 99% of other cases, being my schematic, I would have diagnosed this as an issue caused by myself and shitty schematics... but in this case i'm pretty sure it's FS being a bit slow at drawing or maybe just from the "interaction". Since I see these increases with other creations (btw i'm using i7 built in gfx... I think that is shown/included as CPU load in system task manager for example... which is a bad metric, I know).
That being said, I do use oversized bitmaps for my knobs. But still, they use much less CPU than the toolbox knobs using Ruby only did... or does.

As with everything else I have a lacking knowledge of how FS handles it's transforms (MGUI's) in regards to drawing, and what gets buffered and how it's stacked.
Might be beneficial reducing MGUI's in the schematic if possible? Consolidating into single Ruby boxes and such...

Is there a forum thread somewhere discussing graphic handling?
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: log10 lookup?

Postby juha_tp » Sat May 25, 2024 9:03 pm

R&R wrote:...
Kinda feels wrong using log10's for a very rough visual representation only. Even if it's only in green and run at half framerate.
...


What ranges do you use with these log10's?
Have you tried if a fast approximation is suitable (enough accurate) to replace those functions?
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: log10 lookup?

Postby RJHollins » Sun May 26, 2024 12:27 am

also ... be sure to check the number of 'Triggers' being generated between various sections and components.

Many years back, there was very informative info on 'Triggers' and their management presented by several of the local FS GURUS.

The 'Trigger Counter' PRIM is your friend :mrgreen:
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: log10 lookup?

Postby R&R » Sun May 26, 2024 8:26 am

RJHollins wrote:also ... be sure to check the number of 'Triggers' being generated between various sections and components.

Many years back, there was very informative info on 'Triggers' and their management presented by several of the local FS GURUS.

The 'Trigger Counter' PRIM is your friend


Yup, those nightmare triggers...
Due to the nature of my synth i've become quite familiar with trigger issues.
Always struggling to manage them as best I can :D

Won't affect the interaction with knobs since I believe it has something to do with drag-interaction...
But an overall check for unnecessary triggers in general is probably overdue anyway 8-)
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: log10 lookup?

Postby R&R » Sun May 26, 2024 8:42 am

juha_tp wrote:
R&R wrote:...
Kinda feels wrong using log10's for a very rough visual representation only. Even if it's only in green and run at half framerate.
...


What ranges do you use with these log10's?
Have you tried if a fast approximation is suitable (enough accurate) to replace those functions?


Nope... Wouldn't know how anyway :lol:
Do you mean something like using exp() style calcs and the mantissa stuff like for example MV did in his log math function ASM?

I use an almost normalized output from log10... around -0.15 to 1 (probably ended up using -0.15 as starting point because curve is then out of visible screen-space to the left). Curve shape is far more important than any kind of accuracy.

Can't really comment on math at all, but thinking... wouldn't a LUT be less costly? Just matching a certain range with a some array-entries and calculating an average using like a X and Y?
R&R
 
Posts: 468
Joined: Fri Jul 15, 2022 2:28 pm

Re: log10 lookup?

Postby juha_tp » Sun May 26, 2024 10:12 am

R&R wrote:Nope... Wouldn't know how anyway :lol:
Do you mean something like using exp() style calcs and the mantissa stuff like for example MV did in his log math function ASM?

I use an almost normalized output from log10... around -0.15 to 1 (probably ended up using -0.15 as starting point because curve is then out of visible screen-space to the left). Curve shape is far more important than any kind of accuracy.

Can't really comment on math at all, but thinking... wouldn't a LUT be less costly? Just matching a certain range with a some array-entries and calculating an average using like a X and Y?


Not necessarily exp() based solution ... maybe simple polynomial is enough or lin,log,exp,pow expression but, it depends on what is needed to achieve --> what are the full equations you use these log10's? are you after linear, logarithmic or other type response and if not linear, how many steps is the range -0.15:1 divided to?

BTW, I usually sketch approximation function/polynomial in LibreOffice (Calc) with help of trend line feature found in graphing tool by just entering the 1D or 2D data to Calc table, build a Chart from entered data and finally, in Chart dialog, add trend line w/ show coefficients and R^2.
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Next

Return to General

Who is online

Users browsing this forum: No registered users and 50 guests