davy7125/polyphone

local preset zone modulator override only working for modulator #1

mrbumpy409 opened this issue · 3 comments

For both instruments and presets, local zone modulators should override global zone modulators if they share the same source, destination, amount source and transform (see SoundFont 2.4 spec, section 9.5.1). Polyphone handles this correctly in instruments, but in presets, the override is only successful if it involves the first modulator listed in the preset global zone.

Here is a test SoundFont containing two presets that exhibit this bug. The instrument used by both presets cancels the default velocity-to-attenuation modulator, disabling velocity sensitivity. Both presets set the following modulators at the global zone and then cancel them at the local zone:

  • Source: Note-On Velocity; Transform: negative unipolar concave; Amount: 960; Destination: Attenuation (dB)
  • Source: Note-On Velocity; Transform: negative unipolar linear; Amount: -10000; Destination: Filter, cutoff (x)

In preset 0 "test 1", the velocity→filter_cutoff modulator is listed first.
In preset 1 "test 2", the velocity→attenuation modulator is listed first.

Both presets should have the same result: no velocity-based dynamic response and no velocity-based filtering. However, in Polyphone, these are the results I get:

  • Preset 0 "test 1": Only the velocity→filter_cutoff modulator is canceled. The global zone velocity→attenuation modulator remains in effect.
  • Preset 1 "test 2": Only the velocity→attenuation modulator is canceled. The global zone velocity→filter_cutoff modulator remains in effect.

Preset 0 and 1 now behaves the same way: no difference if you reverse the order of modulators.

However, according to my understandings you can only cancel a default modulator at the instrument level.
The modulator specified at the preset level and related to the filter_cutoff can be described by:
multiply, with a value ranging from 1 to 1 (so no changes), the value of the filter cutoff at the instrument level

I'm closing this issue and you can reopen it if I'm wrong.

Yes, you are correct about only being able to cancel default modulators at the instrument level. I will test out your fix. Thank you!

So far in my testing, all my preset modulators are working as they should.