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 src_set_ratio to fix artifacts in Sample playback #7321

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

sakertooth
Copy link
Contributor

Makes use of the function src_set_ratio to allow for smoother transitions in the resampling ratio when playing back a Sample, removing the artifacts heard when de-tuning notes for instruments like the AFP down rapidly.

@sakertooth sakertooth changed the title Use src_set_ratio for smoother transitions of resampleRatio Use src_set_ratio for smoother resampling ratio transitions in Sample Jun 15, 2024
Copy link
Member

@DomClark DomClark left a comment

Choose a reason for hiding this comment

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

According to the documentation, the point of src_set_ratio is to avoid a smooth transition, not to create one. However, if this fixes artefacts in playback, then it's fine by me.

@sakertooth
Copy link
Contributor Author

According to the documentation, the point of src_set_ratio is to avoid a smooth transition, not to create one. However, if this fixes artefacts in playback, then it's fine by me.

Ah, I must've misread the documentation. It does fix the artifacts from my testing though, so I guess a step-like change in the ratio is what was needed. Ideally, we should move away from using libsamplerate in Sample playback altogether in the future though. Using the functions in interpolation.h instead provides simpler code and avoids us having do a heap allocation to feed into libsamplerate, and of course helps to avoid problems like these.

@sakertooth sakertooth changed the title Use src_set_ratio for smoother resampling ratio transitions in Sample Use src_set_ratio to fix artifacts in Sample playback Jun 15, 2024
@sakertooth sakertooth merged commit 01ffa95 into LMMS:master Jun 15, 2024
10 checks passed
@sakertooth sakertooth deleted the fix-sample-artifacts branch June 15, 2024 22:34
Rossmaxx pushed a commit to Reflexe/lmms that referenced this pull request Jul 16, 2024
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.

None yet

2 participants