Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/amy.c: Naming an oscillator as a mod_source clears its amp[VEL]. #171

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

dpwe
Copy link
Collaborator

@dpwe dpwe commented Aug 18, 2024

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.

@bwhitman bwhitman merged commit d0fccf4 into main Aug 19, 2024
1 check passed
dpwe added a commit that referenced this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants