Add rate and phase controls to PUnaryFunction#1
Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds rate and phase controls to the PUnaryFunction classes, extending their capabilities for input scaling and phase shifting while updating the pattern library documentation and tests.
- Extend PUnaryFunction with rate and phase modifiers.
- Introduce PCallableUnaryFunction to enforce callable parameters for dynamic control.
- Update documentation and add tests to verify correct behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_pattern_function.py | Added tests to verify new rate, phase, and callable-based functionality. |
| isobar/pattern/function.py | Added support for rate and phase in PUnaryFunction and PCallableUnaryFunction. |
| isobar/pattern/init.py | Updated module exports to include new functionality. |
| docs/patterns/library.md | Documented the new PUnaryFunction and PCallableUnaryFunction options. |
Comments suppressed due to low confidence (1)
isobar/pattern/function.py:62
- Consider adding tests for the edge case where steps is less than or equal to 1 to ensure that the behavior for a single sample is as expected.
if steps <= 1:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces two new pattern classes,
PUnaryFunctionandPCallableUnaryFunction, to theisobarlibrary. These classes allow users to sample unary functions across a range, with support for dynamic and callable parameters. The changes include updates to the documentation, the library's initialization file, the addition of the new classes, and corresponding tests.New Features:
PUnaryFunctionClass: Introduced a pattern class to sample unary functions across a range with configurable parameters such asstart,stop,steps,rate,phase,mul, andoffset. Parameters can be constants, patterns, or callables. (isobar/pattern/function.py, isobar/pattern/function.pyR1-R156)PCallableUnaryFunctionClass: ExtendedPUnaryFunctionto enforce that all parameters are callables, enabling dynamic per-step control of function sampling. (isobar/pattern/function.py, isobar/pattern/function.pyR1-R156)Documentation Updates:
docs/patterns/library.md: Added entries forPUnaryFunctionandPCallableUnaryFunctionto the patterns library documentation. (docs/patterns/library.md, docs/patterns/library.mdR31-R32)Codebase Integration:
__init__.py: Imported the newfunctionmodule into theisobar/patternpackage to make the new classes accessible. (isobar/pattern/__init__.py, isobar/pattern/init.pyR14)Testing:
PUnaryFunctionandPCallableUnaryFunctionto validate functionality, including edge cases like callable parameter mixing and dynamic parameter updates. (tests/test_pattern_function.py, tests/test_pattern_function.pyR1-R68)## SummaryPUnaryFunctionwithrateandphaseinput modifiershttps://chatgpt.com/codex/tasks/task_e_6845287334fc832490d705e6ef75b84b