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

Add normalize parameter to synthesize and fluidsynth methods #243

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

yawjalik
Copy link
Contributor

@yawjalik yawjalik commented Feb 20, 2024

Added normalize parameter such that when set to True, hard-normalizes the synthesized output wave to [-1, 1]. Otherwise, divide the wave by len(self.instruments) * 2^15 to prevent clipping, and lets the user handle accordingly. It is set to False by default. This serves as a starting point for tackling #151 and #158.

@yawjalik
Copy link
Contributor Author

This is probably my first ever contribution. Any comments or advice will be greatly appreciated!

@craffel
Copy link
Owner

craffel commented Feb 21, 2024

Thanks for this. Since the original behavior was equivalent to normalize=True, that should probably be the default to avoid breaking existing code.

@yawjalik
Copy link
Contributor Author

Got it, I've changed them to True by default.

@craffel craffel merged commit 8f70108 into craffel:main Feb 23, 2024
@craffel
Copy link
Owner

craffel commented Feb 23, 2024

Thanks!

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