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

jclicker needs an option to set click duration #22

Closed
dmeliza opened this issue Feb 4, 2024 · 1 comment
Closed

jclicker needs an option to set click duration #22

dmeliza opened this issue Feb 4, 2024 · 1 comment
Assignees
Milestone

Comments

@dmeliza
Copy link
Member

dmeliza commented Feb 4, 2024

The click is currently a single sample, which may not be long enough to detect downstream. Letting it be more than one sample long introduces some complexity, though, as the click may span periods.

@dmeliza dmeliza added this to the 2.2.0 release milestone Feb 4, 2024
@dmeliza dmeliza self-assigned this Feb 4, 2024
@dmeliza
Copy link
Member Author

dmeliza commented Feb 15, 2024

One fairly simple solution for the period boundary problem is to use a ringbuffer that's at least two periods long. There's the "front" part corresponding to the current period, and a "back" part corresponding to the subsequent one. In each cycle of the process function, the back part is zeroed, and then any pulses that start in the current period are written to the combined front/back buffer. Then we copy the front part to the output buffer and advance the read and write pointers.

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