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

Keyword-only UGen parameters #371

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

josiah-wolf-oberholtzer
Copy link
Contributor

@josiah-wolf-oberholtzer josiah-wolf-oberholtzer commented Feb 18, 2024

  • Stronger typing
  • Support keyword-only arguments when no param default specified
  • Implement overridableUGen._postprocess_kwargs() to replace messy custom UGen.__init__() implementations
  • Use UGen._postprocess_kwargs() everywhere
  • Implement a UGenSerializable protocol for things that can be serialized into one or more UGens, e.g. Envelope

@josiah-wolf-oberholtzer
Copy link
Contributor Author

TODO (in another PR...):

  • Separate UGenMethodMixin into UGenOperable (anything you can operate against) and UGenNode (a single UGen-ish thing in the graph)
  • Make param() respect existing type hints e.g. EnvGen.envelope
  • Make param() generate stricter UGen.__init__ type hints: expanded params can only take SupportsFloat | OutputProxy while unexpanded can anything.
  • Re-implement OutputProxy as a non-sequence to reinforce the concept that it lies at the bottom of the tree

@josiah-wolf-oberholtzer josiah-wolf-oberholtzer changed the title Tighten UGen Implementation Keyword-only UGen parameters Mar 1, 2024
@josiah-wolf-oberholtzer josiah-wolf-oberholtzer merged commit 135265a into main Mar 1, 2024
11 checks passed
@josiah-wolf-oberholtzer josiah-wolf-oberholtzer deleted the keyword-only-ugen-methods branch March 1, 2024 21:02
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

Successfully merging this pull request may close these issues.

1 participant