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

"as" function #595

Open
felixroos opened this issue Jun 11, 2023 · 3 comments · May be fixed by #1247
Open

"as" function #595

felixroos opened this issue Jun 11, 2023 · 3 comments · May be fixed by #1247
Labels
function new pattern function

Comments

@felixroos
Copy link
Collaborator

felixroos commented Jun 11, 2023

...which allows using colon notation for arbitrary combinations of controls:

const as = register('as', (mapping, pat) => {
  return pat.fmap((v) => {
    // TODO: using aliases e.g. lpf does not work yet...
    v = Array.isArray(v) ? v : [v];
    v = Object.fromEntries(mapping.map((prop, i) => [prop, v[i]]));
    //console.log(v)
    return v;
  });
})

"[c2 a2 f2 e2]:{200 1000 800 2000}%3".as("note:<cutoff hcutoff>").s('sawtooth')

https://strudel.tidalcycles.org/?Z_qnuC-jOaL9

this would even allow to pattern the params itself:

https://strudel.tidalcycles.org/?5lh-8JXdPlKH

maybe this could also work for any pattern method and not just controls, similar to #566 does it

@felixroos felixroos added the function new pattern function label Jun 11, 2023
@felixroos
Copy link
Collaborator Author

also useful as tie replacement: https://strudel.cc/?svGlj81FALJ2 ref #52

@felixroos
Copy link
Collaborator Author

... or to set anchors per chord: https://strudel.cc/?l2-ExgNDGd8o

@felixroos
Copy link
Collaborator Author

another variant by @daslyfe https://strudel.cc/?cFh54k5oQlki

@felixroos felixroos linked a pull request Jan 18, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
function new pattern function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant