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

use of filter Q should incur sample attenuation #192

Open
mrbumpy409 opened this issue Apr 26, 2024 · 0 comments
Open

use of filter Q should incur sample attenuation #192

mrbumpy409 opened this issue Apr 26, 2024 · 0 comments

Comments

@mrbumpy409
Copy link
Contributor

In section 9.1.3 of the SoundFont spec, regarding the filter resonance (Q): "The resonance is measured as a dB ratio of the resonant peak to the DC gain. The DC gain at any resonance is half of the resonance value below the DC gain at zero resonance; hence the peak height is half the resonance value above DC gain at zero resonance."

Basically this means that setting a sample to 6 dB filter resonance should result in 3 dB of attenuation. Setting it to 8 dB should result in 4 dB attenuation, etc., and this is how other SoundFont synths (e.g., FluidSynth, BASSMIDI, Audigy) behave.

Polyphone is not doing this, which can lead to some huge differences in playback between Polyphone and other SoundFont synths.

Here is a SoundFont for testing this. In preset 0, MIDI notes 60-71 play a sine wave with the filter cutoff set well above the frequency of the sine wave. Each note from 61 through 71 increases the filter resonance, though since the filter cutoff value is so high, no emphasis will be heard. However, the attenuation that accompanies the filter emphasis increase should be easily measurable.

Here is a table of each MIDI note in the test, its amount of filter emphasis, and the expected attenuation amount:

Note# Emphasis Expected Attenuation
60 0 dB 0 dB
61 5 dB 2.5 dB
62 10 dB 5 dB
63 15 dB 7.5 dB
64 20 dB 10 dB
65 25 dB 12.5 dB
66 30 dB 15 dB
67 35 dB 17.5 dB
68 40 dB 20 dB
69 50 dB 25 dB
70 70 dB 35 dB
71 96 dB 48 dB

Result

All of the MIDI notes sound at the same volume in Polyphone.

Expected Result

The MIDI notes should sound with the expected attenuation values from the table above.

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

1 participant