swh / ladspa

The SWH Plugins package for the LADSPA plugin system
http://plugin.org.uk/
GNU General Public License v2.0
228 stars 52 forks source link

Fix floating point errors #57

Closed tresf closed 4 years ago

tresf commented 6 years ago

Cherry-pick from https://github.com/LMMS/lmms/commit/88b940fa05fc39b0f4c8bf9fa7b24ef6bf2881b1.

@zonkmachine, a second set of eyes would be nice :)

swh commented 6 years ago

Sorry, I'm away on business at the moment, and don't have time to review the changes in context. Should this be merged in its current state, or are there still open questions?

tresf commented 6 years ago

Should this be merged in its current state, or are there still open questions?

We're changing the 0.0000001 out of the control and fixing it computational-side. It's cleaner. We'll send an updated commit shortly. Thanks!

tresf commented 6 years ago

@swh I think this new logic is better.

          [IN]                      [OUT]
  BEFORE: release_time: 0.25        rgainfilter: 176400.000000
  AFTER:  release_time: 0.25        rgainfilter: 176400.000000

  BEFORE: release_time: 0.001250    rgainfilter: 35280000.000000
  AFTER:  release_time: 0.001250    rgainfilter: 35280000.000000

- BEFORE: release_time: 0           rgainfilter: inf
+ AFTER:  release_time: 0           rgainfilter: 441000001536.000000

Edit: Updated input from ms (lmms), to secs (swh).

Should be good to squash and merge.

zonkmachine commented 4 years ago

Looks good to me.