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

Clicking Sounds When Abruptly Changing Sample Position (PLOF, Slice, RTRG) in the Sample Player #112

Open
fpiesik opened this issue Sep 8, 2024 · 0 comments

Comments

@fpiesik
Copy link

fpiesik commented Sep 8, 2024

Whenever the sample player makes abrupt changes to the sample position (e.g., using PLOF, slice, or RTRG commands), an audible click sound can occur due to the instant change in amplitude.

Steps to Reproduce:

  1. Load a loop into the Sample Player.
  2. Use the PLOF command to jump to different positions within the loop.

Expected Behavior:

Position hopping should work without any audible clicking sounds, by implementing smoother transitions or a mechanism to avoid abrupt waveform changes.

Possible Solutions:

  • Zero-Crossing Detection: Ensure that samples are triggered at points where the waveform crosses zero to avoid discontinuities.
  • Fade-In/Fade-Out: Apply very short fades (at the start or end of the sample) to eliminate abrupt amplitude changes.
  • Crossfading Between Slices: Smooth the transitions between different sample slices to reduce clicks.

Code Hints:

In the code, I found some indications that an anti-click mechanism may have been partially implemented by the original authors:

In SampleInstrument.cpp:
Line 25: #define SHOULD_KILL_CLICKS true
Lines 344, 1119, 1334: rp->couldClick_ = SHOULD_KILL_CLICKS;

However, the couldClick_ variable does not seem to be used elsewhere in the code. It appears this feature is still a work in progress.

It would be fantastic if this work could be completed, as the presence of these clicks significantly detracts from the experience of sample mangling in LGPT.

System Information:

  • Version: 1.4.1
  • Platform: Miyoo Mini, x64
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