concept: preset morpher
inspired by the macro control script above. quick recap: we can use the param knob to control the CV outputs in a more continuous fashion by using the metro script with a high refresh rate, like 25ms: M 25. you can experiment with even higher rates by using the M! op as M caps it at 25 - just expect that teletype might start acting a little weird.
this was the script from the previous post, showing that you can map the knob range to different output ranges by using SCALE:
#M
CV 1 PARAM
CV 2 SCALE 0 V 10 V 10 0 PARAM
CV 3 SCALE 0 V 10 0 V 5 PARAM
CV 4 SCALE 0 V 10 V 5 0 PARAM
it’s a super simple scene but what we have is essentially a 4 CV preset morpher (which makes it sound more exciting). you have one set of voltages when the knob is down all the way, another when it’s all the way up, and turning the knob morphs between them. what would make it really usable though if instead of typing voltage values in we could actually use the knob itself to choose them.
let’s add the ability to record snapshots. it’s simpler than it sounds. first, we need some way to indicate whether the knob is being used for recording or for morphing. let’s use variable A - value of 0 can mean we’re morphing, value 1 - recording CV 1 etc. first, we need to add this line to the metro script:
#M
IF A: SCRIPT 8; BREAK
CV 1 PARAM
CV 2 SCALE 0 V 10 V 10 0 PARAM
CV 3 SCALE 0 V 10 0 V 5 PARAM
CV 4 SCALE 0 V 10 V 5 0 PARAM
since any positive value is evaluated as “true”, then when we are recording (A is 1…4) it will execute script 8 (which is what we’ll use for recording) and stop.
one more thing: we need to store 8 values - 2 snapshots of 4 CVs. let’s store snapshot 1 in pattern bank 1 and snapshot 2 in pattern bank 2. we also need a variable that determines which snapshot we are recording, let’s use B (we’ll worry about where to set it later). here is script 8:
#8
PN B A PARAM
CV A PARAM
the first line stores the knob value, the second line passes it to the corresponding CV output so we can hear the result.
now, we need a way to trigger recording. let’s use scripts 1-4 to turn recording on, one for each CV, then we can use keyboard to toggle recording. since we need to record 2 snapshots, we could do it this way: executing script 1 enables recording for snapshot 1, executing it again enables recording for snapshot 2, executing it again stops recording and enables morphing again:
#1
IF AND A EQ B 1: B 2; BREAK
IF AND A EQ B 2: A 0; BREAK
A 1
B 1
first line will only get executed when A is not zero (so, we are recording already) and B is 1 (we are recording snapshot 1), so we switch to snapshot 2. second line will only get executed when we are recording snapshot 2, so set A to 0 to stop recording. and if we get past that, we’re not recording, so we enable it.
we can now copy this script to scripts 2-4 (remember, you can select several lines by holding SHIFT and copy them at once). then modify A 1 to A 2 in script 2 etc. here is a neat trick we could use so we wouldn’t even need to edit scripts after duplicating them: A SCRIPT. SCRIPT op returns the current script number, so it’ll do exactly what we need!
switch to pattern view before you record snapshots - this way you can see the values being updated as you turn the knob. it would be also neat to see which value is being recorded at any given time - let’s use the turtle for it! we’ll need to make it visible when we start recording and set its coordinates to the proper pattern cell, and then hide it once recording is done. unfortunately, adding it to the existing script pushes us over the line limit, so we have to modify the script a bit and use another trick - if you have a really long IF condition, store it in a variable and use the variable instead:
J AND A EQ B 1
IF J: B 2; @X B; BREAK
J AND A EQ B 2
IF J: A 0; @SHOW 0; BREAK
A SCRIPT; B 1
@X B; @Y A; @SHOW 1
we can also employ the A SCRIPT trick, so you can just copy this whole script to scripts 2-4 without modifying anything (and we could save ourselves time and make it more readable by moving the whole thing to script 5, changing A SCRIPT to A Z and then scripts 1-4 could simply be Z SCRIPT; SCRIPT 5).
finally, we need to update the metro script to use the new snapshots instead of the fixed values. for each of the 4 CVs we need to scale the current param value from 0…10 V range to the min/max range saved in the pattern banks. this would be something like this:
CV 1 SCALE 0 V 10 PN 1 1 PN 2 1 PARAM
this is definitely too long! let’s use aliases, and also take advantage of using a loop. modify the metro script as follows and add script 7:
#M
IF A: SCRIPT 8; BREAK
L 1 4: SCRIPT 7
#7
J SCL 0 V 10 PN 1 I PN 2 I PRM
CV I J
if you tried it at this point and are wondering why the values are in the middle and start from row 2 - that’s because pattern banks and indexes are 0-based. doesn’t really matter here and simple enough to subtract 1 when needed.
final thing: remember to set the metro rate in the init script, and we need to start with proper values for A and B:
#I
A 0
B 1
M 25
oh, and would be useful to be able to reset all values at once. easy! let’s use script 5:
#4
L 1 4: PN 1 I 0; PN 2 I 0
so here it is, simple enough but pretty useful. and as always, with teletype this can be just a starting point for further exploration. here are some ideas: with something like telexo or er-301 we could control more than 4 values (just have to be careful not to have too many - remember, we are still updating each one of them at 25ms or faster). instead of the knob you could use faderbank to record 16 values at once. and what about storing and morphing between 4 snapshots instead of 2?
and here is what a more complex variation of this idea might look like: morphing faders grid scene