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

Select soundfont samples by frequency instead of midi note numbers #932

Merged
merged 4 commits into from
Jul 4, 2021

Conversation

Naturseptime
Copy link
Contributor

For detuned melodic instruments we want to select soundfont samples by pitch instead of midi keys.
See issue #926.

For detuned channels it might be better to use another key for Soundfont sample selection
giving better approximations for the pitch than the original key.
Example: play key 60 on 6370 Hz => use tuned key 64 for sample selection

This feature is only enabled for melodic channels.
For drum channels we always select Soundfont samples by key numbers.
@Naturseptime Naturseptime changed the title Select samples by pitch Select soundfont samples by frequency instead of midi note numbers Jul 2, 2021
Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, much simpler than I expected. And I clearly hear the difference. Nice job, thanks! Some tiny nit-picks below.

@mawe42 Do we need a unit test for it? Or is it simple enough?

src/sfloader/fluid_defsfont.c Outdated Show resolved Hide resolved
src/synth/fluid_chan.c Outdated Show resolved Hide resolved
src/sfloader/fluid_defsfont.c Outdated Show resolved Hide resolved
src/synth/fluid_voice.c Outdated Show resolved Hide resolved
@mawe42
Copy link
Member

mawe42 commented Jul 4, 2021

Wow, much simpler than I expected. And I clearly hear the difference. Nice job, thanks!

I agree, very clean and simple implementation. Great job!

@mawe42 Do we need a unit test for it? Or is it simple enough?

I would say no unit test needed. If something goes wrong in these codepaths, the effect will probably be very noticeable. And testing it would probably be quite difficult to do in a clean way...

@derselbst derselbst added this to the 2.2 milestone Jul 4, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then, ready to go. Thank you!

@derselbst derselbst merged commit e096919 into FluidSynth:master Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants