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

README.md: Fix the FM example to clear amp[VEL]. #221

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

dpwe
Copy link
Collaborator

@dpwe dpwe commented Sep 24, 2024

The example that plays a couple of FM tone by directly configuring the individual sine oscillators had been broken since we made the change that unspecified ControlCoefficients are left unchanged (rather than being cleared to zero). Because FM component oscs do not see the velocity of their parent note, it's important to include amp={'vel': 0} (to clear the default weight of 1), otherwise the operator oscs will always have zero output, because they see a velocity of zero.

Doing this, I realize that ratio is really just a special case of ControlCoefficients. Instead of ratio=0.2 (and the associated explanation), that's really just freq={'const': 52.326, 'note': 1}, i.e. it follows the note frequency, but relative to 0.2 x the default frequency (of 261.63 Hz). We could change that. Would it make things easier to understand?

@dpwe
Copy link
Collaborator Author

dpwe commented Sep 24, 2024

I realize using the "dict" form of specifying ControlCoefficients will weird-out people unfamiliar with Python. At the same time, it's actually a lot more comprehensible than '1,0,0,1' once you learn the syntax.

@bwhitman bwhitman merged commit 371fc25 into main Sep 25, 2024
1 check passed
@bwhitman bwhitman deleted the fm_example branch September 25, 2024 15:09
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