src/amy.c: Naming an oscillator as a mod_source clears its amp[VEL]. #171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.