So I just got hold of a Teletype a few days ago. My experience of coding is limited to dabbling with some variants of BASIC in the early 80s, messing with bad HTML in the 90s and some basic SQL since then – so the whole scripting thing is something of challenge (albeit an enjoyable one).
Now I’ve run into a problem. Let’s say I’ve created a pattern
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
and the script
PN.L 0 3
TR.P 1; CV 1 N PN.NEXT 0
This runs up the pattern and sends TR & CV pairs with note values 1 2 3 4 1 2 3 4 etc. As an exercise, I’m trying to work out how to make it run up then down again - so that it outputs CV values 1 2 3 4 3 2 1 2 3 4 3 2 1 etc.
It’s driving me bonkers.
I’ve tried loops, a second script containing a PN.PREV, some other stuff, and nothing seems to do the trick. Can someone give me a hint? What’s the best process to use to achieve this?
That would certainly do the trick, but what I’m wondering, I guess, is if there’s a way of scripting a ping-pong motion for playback of the pattern? Or is the direction of play limited to being either forwards or backwards only?
i will marinate on this. the tracker columns are what i was referencing as patterns, which are just lists of numbers that get called, so i think there’s a way to use one list of numbers to dictate how another list of numbers gets read.
exactly why i want a mobile teletype logic checker.
@dan_derks@chrisharrisx@David_Rothbaum - Thanks so much for taking the time to look at this. I think it’s pretty cool that there are such different ways of approaching a solution. And the EZ and EQ ops definitely look like they’re worth digging in to - handy little things to have around!
Ideally you’d want more patterns operators, like NEXT or PREV.
You could have a PING (not the best name) that would do the ping pong thing automatically, a RAND that would access a random valid element, a BROWN that would randomly choose between NEXT and PREV (with automatic wrapping), etc.
Not having to use 4or 5 lines for something like this enables you to do more things at the same time…
I haven’t looked at the code for this but making new operators like this is probably not too difficult…
You could probably add a P.INC / PN.INC OP. (i.e. the amount to increment on next / prev, negative values swap direction).
Biggest issue is that it won’t be saved with USB saving and loading, and it’s won’t be trivial to fix that. Really the next “big thing” that needs sorting in the codebase is the USB loading and saving code, once that’s improved a lot of new features become possible (e.g. more than 4 patterns, more than 8 scripts, etc, etc).