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

[plugins] EnvGen: fix initialization #6175

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

mtmccrea
Copy link
Member

@mtmccrea mtmccrea commented Jan 2, 2024

Purpose and Motivation

This fixes the initialization of EnvGen as well as improves (but doesn't fully fix) a segment duration bug, #6180.

Additionally:

  • unit tests added to check initialization by the first output sample.
  • fix an Env.circle startup behavior

This PR is part of an ongoing effort to fix UGen initializations, the progress of which is tracked here.

Note: I did some cleanup of extraneous print statements and stray comments, as a standalone commit. If this isn't preferred, I can remove it. I think it's helpful to clean up as we go.

Types of changes

  • Bug fixes
  • Breaking change - changes are technically breaking for the first output sample (or, e.g., a one-sample phase change from previously)

To-do list

@mossheim

This comment was marked as resolved.

@mtmccrea

This comment was marked as resolved.

@mtmccrea mtmccrea force-pushed the topic/init-sample-lfugens-pt3 branch from d604626 to 564317a Compare January 2, 2024 21:38
@mtmccrea

This comment was marked as resolved.

@mossheim

This comment was marked as outdated.

@mtmccrea

This comment was marked as outdated.

@mtmccrea mtmccrea force-pushed the topic/init-sample-lfugens-pt3 branch 2 times, most recently from 97e8a83 to 79c3099 Compare January 6, 2024 20:44
@mtmccrea mtmccrea changed the title Fix UGen initialization: LFUGens pt. 3/3 - EnvGen, IEnvGen Fix UGen initialization: LFUGens pt. 3/3 - EnvGen Jan 6, 2024
@mtmccrea mtmccrea changed the title Fix UGen initialization: LFUGens pt. 3/3 - EnvGen EnvGen: fix UGen initialization Jan 12, 2024
@mtmccrea

This comment was marked as resolved.

@mtmccrea mtmccrea force-pushed the topic/init-sample-lfugens-pt3 branch from 79c3099 to 035ba2f Compare January 18, 2024 12:54
@mtmccrea

This comment was marked as outdated.

@mtmccrea mtmccrea force-pushed the topic/init-sample-lfugens-pt3 branch from 035ba2f to b276450 Compare June 27, 2024 07:00
@telephon
Copy link
Member

Should we have some more tests for envelope?

@dyfer
Copy link
Member

dyfer commented Sep 1, 2024

@mtmccrea thanks for this! Are you considering adding tests for this or would should we pull this in as is?

@mtmccrea

This comment was marked as outdated.

@mtmccrea

This comment was marked as outdated.

@mtmccrea mtmccrea changed the title EnvGen: fix UGen initialization [plugins] EnvGen: fix initialization Sep 20, 2024
@mtmccrea
Copy link
Member Author

mtmccrea commented Sep 20, 2024

I've now added a few tests for the initialization of EnvGen.
I also tested the circle methods, which I found had broken when the interface to Delay1.kr had changed, so that's fixed and docs touched up as well.

wrt the env duration bug, #6180, this PR mostly fixes it, though there's an edge case regarding the last sample of the last segment, which should be handled in a separate PR, since this PR is primarily concerned with proper initialization.

@mtmccrea mtmccrea force-pushed the topic/init-sample-lfugens-pt3 branch 4 times, most recently from c459080 to 83b6f54 Compare September 24, 2024 08:19
Delay1.kr hew behavior as of supercollider#6110, in which the predelay sample needs to be specified if not equal to the first input value.
Previously, this value didn't matter because the erroneous UGen initialization swallowed it and it was never output. Now that that's fixed, it gets output for a single sample on account of the construction of the `first0Then1` initial time mechanism. So better to start at (and repeat) the first level, rather than arbitrarily start at `0.0`, which could be destructive if the SynthDef graph isn't designed around the env having a value of 0 (e.g. a freq arg.)
@mtmccrea
Copy link
Member Author

There was a spurious test timeout failure in the pitch tracker (macOS), which I can't recreate on my machine and doesn't fail after re-running, so I think it's ok...

Otherwise I think I've addressed all the issues raised by commenters so far and it's ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for review
Development

Successfully merging this pull request may close these issues.

5 participants