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

Normalization by default #151

Open
stefan-balke opened this issue Oct 22, 2018 · 3 comments
Open

Normalization by default #151

stefan-balke opened this issue Oct 22, 2018 · 3 comments

Comments

@stefan-balke
Copy link

Hey,

currently there is a default normalization when using fluidsynth:
https://github.com/craffel/pretty-midi/blob/master/pretty_midi/pretty_midi.py#L940

Could we make this optional? This way different MIDI velocities are ignored...

Fluidsynth is producing 16-bit integer values...this normalization scales it such that the values lie in [-1, 1]. I would rather say we divide the fluidsynth output by 2^16 plus making the normalization optional.

What do folks think?

@craffel
Copy link
Owner

craffel commented Oct 22, 2018

The normalization is a lazy way of addressing the fact that we may be summing together the synthesis of many instruments, so the output of the PrettyMIDI.fluidsynth method (before normalization) is [-len(self.instruments)*2^15, len(self.instruments)*2^15 - 1]. I am fine with making the normalization disable-able via a keyword argument but I would still advocate for hard-normalizing to [-1, 1] when normalization is enabled.

@yawjalik
Copy link
Contributor

Hello there, is this issue still up for grabs?

@craffel
Copy link
Owner

craffel commented Feb 19, 2024

Yep!

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

No branches or pull requests

3 participants