You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The partials oscillator stores each set of partial trajectories by a sequence of partial_breakpoint_t elements in partial_breakpoints[]. The last three elements of a partial_breakpoint_t are ms_delta, amp_delta, freq_delta, which are redundant with the ms_offset, amp and freq of the next breakpoint entry for that oscillator (specifically, ms_delta is the increment in the ms_offset, and amp_delta and freq_delta are multiplicative scales to transform the current amp and freq into the next ones).
We could save three fields for each breakpoint entry by, instead, scanning ahead to the next entry for the current oscillator, reading its ms_offset, amp, freq, and calculating the deltas on-the-fly. This would also simplify adding partials, since the partial-construction system would not have to calculate the deltas.
The text was updated successfully, but these errors were encountered:
Would it make sense to also compress the remaining fields to uint16_t fixed-point values too?
It would still be easy to get back to the original floating point values at runtime, with a relatively minor loss of precision.
I mean, something like this:
frequency: 8.8 split, where MSB is semitones (same as midi note, but extended beyond 127), and LSB 256ths of a semitone.
amplitude: 0.16 no sign and fractional part only (since I presume it's always < 1.0 right?)
phase: 1.2.13 with sign, so with a range of -2.0000 to 1.9999 (and still allow for that -2.0 terminator thing)
The partials oscillator stores each set of partial trajectories by a sequence of
partial_breakpoint_t
elements inpartial_breakpoints[]
. The last three elements of apartial_breakpoint_t
arems_delta, amp_delta, freq_delta
, which are redundant with thems_offset, amp
andfreq
of the next breakpoint entry for that oscillator (specifically,ms_delta
is the increment in thems_offset
, andamp_delta
andfreq_delta
are multiplicative scales to transform the currentamp
andfreq
into the next ones).We could save three fields for each breakpoint entry by, instead, scanning ahead to the next entry for the current oscillator, reading its
ms_offset, amp, freq
, and calculating the deltas on-the-fly. This would also simplify adding partials, since the partial-construction system would not have to calculate the deltas.The text was updated successfully, but these errors were encountered: