(mod note: started a new thread for this topic as it could become a longer topic)
combining scripts is not necessarily hard, but it also requires quite a bit of attention to the inner-workings of both scripts you want to combine.
what @dan_derks suggested is correct in terms of tracking some sort of focus variable and switching your enc, key, redraw, and grid(ā¦) functions.
but there are quite a few other things that will possibly get messy:
- if both scripts have same-named variables or tables
- if both scripts are trying to control or interpret the same MIDI ports or softcut or (etc)
- DEFINITELY if both scripts are using an ENGINE this will not work, unless itās the same engine, but that still may be difficult to navigate depending on the context.
but others would be very simple to merge. i could see a simple tutorial where:
- script 1 takes input into softcut and makes a parameterized echo effect with custom screen/enc controls
- script 2 is a sequencer that loads an engine and has a full interface
combining these two and then assigning a āswitch viewā control (such as ENC 1, given both scripts didnāt use it) would be very trivial.
a more in-depth option for āmodularā recombinatory (thatās not a word i guess) would require following some very specific conventions to ensure that things worked together consistentlyā a task which might be hard to achieve. essentially scripts would need to be written as libraries with very thin ālauncherā wrappers (and there could be wrappers to combine a stack of scripts, if they are compatible)
but again the current approach to DSP using supercollider right now is limited.
and some of these ideas end up being difficult to reconcile from a design perspective given the goal of easy accessibility for norns scripting. itās important to keep this goal in mindā but there may be an elegant solution for combining/layering scripts.