Am 31.10.21 um 00:54 schrieb Ichthyostega:
When comparing with a build /before/ the "power"-branch, I
see differences around -125dB, ...

But there is again that strange ramp-up (on the sound difference!) on one
single note, while for all other notes the sound difference is basically noise.


Hi Will,
Hi Kristian,

after some more hours of poking around with the debugger
(no, I do not especially like that task...), I consider this case as solved.

Bottom line: in this case, these differences are the unavoidable consequence
of the change from powf(2.0,...) to power<2>(...).

By switching to the latter, we (hopefully) get stable computations from now on.



My findings in detail:

- The AnalogFilter is *not* the root cause.
  But the filter somehow increases the problem, and it adds
  the seemingly random fluctuations on top of the difference

- But the root cause of the differences happens already when
  (pre)computing the note scale frequencies (Part::PnoteMap).

The differences arise in Microtonal::getFixedNoteFreq().

So the seemingly dramatic "ramp-up" is more like an artefact of computing
the difference between a baseline waveform and an actual waveform.
Simply, because the *frequency* on *some notes* is slightly off,
and thus the visible phase drifts away as the note proceeds.

We can completely confirm the differing frequencies by calculating
powf(2.0, ...) vs power<2>(...), for example for the first 10 notes:


note(-64) frequency = 0.202785403 | 0.202785417 Hz  Δ  0.000206379169 cent
note(-63) frequency = 0.21484375  | 0.21484375  Hz  Δ               0 cent
note(-62) frequency = 0.227618977 | 0.227618977 Hz  Δ               0 cent
note(-61) frequency = 0.241153851 | 0.241153896 Hz  Δ  0.000412758313 cent
note(-60) frequency = 0.255493701 | 0.25549373  Hz  Δ  0.000206379169 cent
note(-59) frequency = 0.27068609  | 0.270686179 Hz  Δ  0.000619137432 cent
note(-58) frequency = 0.286781877 | 0.286781818 Hz  Δ -0.000309568799 cent
note(-57) frequency = 0.303834945 | 0.303834856 Hz  Δ -0.000515948029 cent
note(-56) frequency = 0.321901828 | 0.321901798 Hz  Δ -0.000206379193 cent
note(-55) frequency = 0.341043025 | 0.341043025 Hz  Δ               0 cent
note(-54) frequency = 0.361322671 | 0.361322641 Hz  Δ -0.000103189594 cent


Thus some notes turn out exactly the same, while others are off by a very
minute amount, which, by itself, is way below anything audible. However,
it is conceivable that *beating patterns* of some complex textures might
be changed.

So this turns out to be a similar situation as recently, when changing
the denormal handling from hardware based to a stable, software based
implementation: a small change, that can be audible under certain conditions,
as the price for getting a numerically stable and reproducible computation.

-- Hermann


_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel

Reply via email to