Skip to content

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

Description

@fpiesik

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions