We hit a problem where setting up an oscillator as an LFO using C led to a zero-amplitude modulator unless you explicitly cleared amp_coef[COEF_VEL], the incorporation of the oscillator note velocity into its overall amplitude, which is set to 1.0 by default.
However, modulation oscillators never have a nonzero velocity (that would lead to them being audible), so this dependence is unwanted.
With this change, amp_coef[COEF_VEL] is automatically cleared for a modulator oscillator when it is set as the mod_source for another oscillator. This increases the undesirable magic side effects of amy:play_event(), but I am comfortable with this solution.
If you really wanted the modulating oscillator to depend on velocity, you could rewrite its amp coefficients after naming it as the mod_source for the dependent oscillator.
We hit a problem where setting up an oscillator as an LFO using C led to a zero-amplitude modulator unless you explicitly cleared
amp_coef[COEF_VEL]
, the incorporation of the oscillator note velocity into its overall amplitude, which is set to 1.0 by default.However, modulation oscillators never have a nonzero velocity (that would lead to them being audible), so this dependence is unwanted.
With this change,
amp_coef[COEF_VEL]
is automatically cleared for a modulator oscillator when it is set as themod_source
for another oscillator. This increases the undesirable magic side effects ofamy:play_event()
, but I am comfortable with this solution.If you really wanted the modulating oscillator to depend on velocity, you could rewrite its amp coefficients after naming it as the
mod_source
for the dependent oscillator.