Glad to hear! So let's try to answer your questions:
I wrote three different capply
functions, named capply
, capply'
and capply''
. These are just valid function names. It would be totally fine to name the capply''
function thisismyawesomefunction
or something like that...But I guess you should get the idea.
You can copy the functions in your BootTidal.hs or in a separate file. You could load a separate file manually with
:script mytidalfuncs.tidal
But make sure that you wrap multiple lines with :{ and }: . I already saw an example of this in the forum:
I think I now understand the requirements for a one-size-fits-all solution.
This could be a larger project and I would prefer to exclude this to an issue on Github to discuss it there. Let me try to explain this. What you could do with the custom capply
function is to switch between patterns conditionally with a pattern like:
d1 $ capply'' "<0 1 2 3>" pvector
This works totally fine. And the osc control messages are basically patterns. It is not possible (or I don't know it yet) to control (let's call it) IO function like transitions (like xfade
) or d1
, d2
with patterns. What you could do for example is switching the output bus with a function like orbit:
-- Some kind of switching between d1 and d2
d1 $ s "808*4" # orbit "<0 1>"
I see two possible solutions here:
- There should be the possibility to control transitions with patterns and use them similar to the function
orbit
. Then my solution for selecting patterns with patterns would also work on transitions. - Or we need a way to trigger IO functions through OSC. But I think that we then leave the pattern context and I'm not sure if this is intended.
I can imagine that you are more flexible with this second approach. This would allow to trigger the IO-functions and the attached patterns independently from the TidalCycles clock. I think of it as a variant of my CycSeq approach, but then built into TidalCycles. In CycSeq I have code in a separate window and I activate a window with the code it contains. This is basically nothing else than having an osc controller that's wraps TidalCycles code which you could trigger from outside the IO functions.
But you see, that this contains a more in depth discussion.
[Edit:] I actually see that there is an issue for trigger IO functions with pattern on GitHub: IO patterns · Issue #483 · tidalcycles/Tidal · GitHub Maybe this is a feasible approach. But as far as I see, this is using an IO-function like reading a file to interpret this as a pattern. But maybe this works for triggering a transition like xfade
inside d1
...
But I would also be really happy if we could find a solution.
In my case, I can imagine that this will give me an easier environment in TidalCycles to do live sampling/live looping.