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

Reorganise pattern.mjs with a 'toplevel first' regime #286

Merged
merged 16 commits into from Dec 10, 2022
Merged

Conversation

yaxu
Copy link
Member

@yaxu yaxu commented Dec 7, 2022

No description provided.

@felixroos
Copy link
Collaborator

looks promising!

@yaxu
Copy link
Member Author

yaxu commented Dec 9, 2022

pattern.mjs is looking tidier now. Other modules are still using patternified and/or define rather than the new register, and should probably be updated.

@yaxu
Copy link
Member Author

yaxu commented Dec 9, 2022

I had a go at tidying up degrade/undegrade in signal.mjs along the same lines but hit the complication that register makes heavy use of reify, which applies pure which is for discrete values.. this messes things up.
So I propose merging for now and doing further tidying later.

@yaxu yaxu changed the title sketch of 'toplevel first' regime Reorganise pattern.mjs with a 'toplevel first' regime Dec 9, 2022
@yaxu yaxu requested a review from felixroos December 9, 2022 16:28
@felixroos
Copy link
Collaborator

I found a way to get rid of the arity switch case in register! I'd be fine with a merge. We can refactor makeComposable / patternifyX / Pattern.prototype.define in a separate PR

@yaxu
Copy link
Member Author

yaxu commented Dec 10, 2022

Heh, let me know your t-shirt size and address !

@yaxu yaxu merged commit 4340f02 into main Dec 10, 2022
@yaxu yaxu deleted the deconstruct-pattern branch December 10, 2022 14:39
@felixroos
Copy link
Collaborator

felixroos commented Dec 10, 2022

EDIT: hm it seems the tests now fail.. dunno what went right there at first... although it sounds right. maybe randomness just behaves a little different now, similar to how haps have reordered a little bit?

I had a go at tidying up degrade/undegrade in signal.mjs along the same lines but hit the complication that register makes heavy use of reify, which applies pure which is for discrete values.. this messes things up.
So I propose merging for now and doing further tidying later.

just tried using register with degrade(By) / undegrade(By) and it seems to work even with reify. see 09b15a0

should I just refactor the rest of signal.mjs similar to this or is there something messed up I am missing? I also tried to add a noReify option, but skipping reify actually breaks stuff

@yaxu
Copy link
Member Author

yaxu commented Dec 10, 2022

Yeah I tried the same and think the use of pure was putting a sample and hold on the random signal so it was either all or nothing on a per cycle basis.

@yaxu
Copy link
Member Author

yaxu commented Dec 10, 2022

We need to reify but with steady rather than pure.

@felixroos
Copy link
Collaborator

I wonder why it worked with the old patternify function

@yaxu
Copy link
Member Author

yaxu commented Dec 10, 2022

I'm afk but it's using something custom with applicative.. hmm

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.

None yet

2 participants