Skip to content

How can I force a waveform to be updated only when it has finished playing #121

@misterbo94

Description

@misterbo94

When using an Oscil, the waveform can simply be a float array, which is not copied but referred to, so in order to swap the waveform it is sufficient to change every element of the array. However, if the waveform needs to be updated frequently, this creates a lot of discontinuities in the signal, resulting in a popping sound for each swap. This happens also for all the wavetable modifiers like flip(), invert(), ... I would like to have a sort of "protection" when updating the waveform, so that it will be effectively changed only when the current one has finished playing. In that way, as long as the last value of a waveform and the first value of the next one are similar, there should be no popping sound. I've left a simple processing sketch to show the problem.
wavetableproblem.txt

Is there a way to do that with existing methods? I've tried with Audiolisteners but without any luck.
If not, how can I solve this problem considering I'm not a super-advanced coder?
Thank you

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