Teletype 3.0

ternary if op

? condition a b

this op means “if condition is true, return a, otherwise return b”. the main benefit of this op is that it can be used in expressions without the need to use IF pre op. consider the following:

IF EZ Z: A B
ELSE: A C

now you can do the same with A ? EZ Z B C.

as with IF, condition can be any value. 0 value is treated as false and any other value is treated as true. so you can also do something like this: A ? % Z 1 B C or A ? TOSS B C.

11 Likes

PR opened for those docs! Thanks for your hard work. You might want to open a thread to openly work on your studies material. I don’t know what direction those need to go to fit in with the existing one.

Also, super work @scanner_darkly! Love the ternary op and the implementation of multi-line select.

6 Likes

awesome, thanks! and big thanks to @unity2k for helping with the docs.

i updated the docs to also include the fix for IN op latency as it’ll likely be released as part of 2.2. once that PR is merged i’ll merge both PRs into my branch as well.

edit: 2.2 docs have been merged to my grid2 branch.

5 Likes

multi line cut/copy/paste

when editing scripts you can now use Shift-<up>/<down> to select multiple lines. when more than one line is selected the edit line (the bottom line) does not display anything, and to return to editing you can either press <Enter> or select a single line. pressing <up>/<down> will also make it go back to single line selection.

other fun things you can do with selected lines now:

  • Alt-<up>/<down> will shift selection up or down
  • Alt-<delete> will delete selection without copying it into the buffer
  • toggling comments with Alt-/ will work with multiple lines as well

all the old shortcuts for cut/copy/paste will now work with multi line selection, and you can still use them with single lines as well. however, there was a change in behaviour i had to make: when pasting, it will paste at the current position while shifting what was there down. previously, when you pasted something, it would paste into the edit line, so to commit the paste you had to additionally press <Enter> and it would replace the currently selected line with whatever you pasted. now it will shift the currently selected line down and it will insert the pasted line(s) above.

this seems like the most intuitive approach but i’ll be curious to hear how people find it in practice. you can somewhat replicate the old behaviour by copying, then selecting the line you want to replace, pressing Alt-<delete> and then pasting. i’m also considering adding this: when pasting a single line, and the edit line is empty, replicate the old behaviour (paste into the edit line but don’t commit). this way you can also replicate the old behaviour by copying a single line, then navigating to the line you want to replace, pressing Shift-<backspace> and pasting.


the buffer is shared between script editing / live screen / preset writing screen. i still need to add support for multi line selection to preset writing screen, once it’s done one thing you could do is use it to store bits of scripts!

finally, you can now navigate by words using Ctrl-<left>/<right>. i’m hoping these changes will be useful for live coding as well!

7 Likes

Hi all - Recently got my Teletype and I’ve been playing around with 2.3 beta 1 for a few days.

I’m not sure if this is the correct location to post ‘bugs’ - please let me know and move if not.

  1. My PARAM value is fluctuating. I noticed this was reported on an alpha of 2.2 (by @laborcamp) - but looks like it was declared fixed.

I have tried Firmware versions 2.1 release, 2.2beta1 and 2.3beta1. PARAM fluctuates on all of them. I have calibrated (to 0 and 16383 succesfully) . I have tried different power rail and case. It is varying enough to cause me to overwrite the wrong Scene when saving.

  1. I have had a few instances where pressing ALT + UP on a script, to move a line of code, has caused the screen to go blank and require a power cycle.

Cheers!

1 Like

yes, please post bugs here, unless it’s something 2.2 specific in which case it should go to the 2.2 thread (thanks for testing with multiple version - that’s very helpful!). if it’s a bug that existed before 2.2 then we can add it as an issue on github and it’ll get fixed when one of the developers chooses to work on it.

for the PARAM issue i believe that’s always been that way, there is a small amount of noise on the knob, calibration won’t fix that. i don’t think it was ever fixed, at least not to my knowledge - can you post a link to the discussion? regardless, i think there might be a way to reduce the jitter for scene loading/saving, i’ll think about this one.

Alt-<up> - when does it tend to happen? single line / multiple lines? any other details?

Here is @laborcamp mentioning the PARAM wobble on 2.2 - not sure if it is the same issue:

Personally, I wouldn’t mind losing some resolution on the PARAM knob if it meant it was stable. I have been using it to window through sections of CHAOS - which only really works when it is rock solid!

Regarding ALT + UP. It is almost certainly single line - I’ll try to replicate it. As the screen goes blank suddenly and unexpectedly, I can’t see exactly which line I was on but it has happened 3 or 4 times and each time I had my fingers on ALT + UP!

Other issues with ALT moving a line up/down:

  • The commented-out status of a line doesn’t move with the content of the line you are moving.

  • Moving empty lines between lines of code can break the page such that code is pushed down off the page - ie it appears that an empty line is inserted each time you try to ALT + UP or DOWN to move a line of code.

It is possible to cause a crash by entering an integer larger than 32767 as a Loop command in live mode.

L 0 32768: A R

re: losing resolution on PARAM - you can already do that by dividing or scaling. but sometimes you want a bigger range, so it’s always going to be a trade off. for scene selection my idea is to introduce “dead” zones between values, so even with jitter it shouldn’t change values when it happens to be right on the edge between two values.

moving lines - i’ll go over that code again and introduce some additional boundary checking, so at least it won’t crush. i’ll do that and check the other issues (and the loop issue) tomorrow.

thanks for your help with testing, very much appreciated! i’m a bit surprised tbh there hasn’t been more feedback, it’s been out for a couple of weeks now.

1 Like

Yes. Using SCALE to set PARAM range removes jitter completely but only at a range of 32! Dead zones where the value changes sounds like a good idea - presumably it would require calibration first?

I’m just getting started with the TT, so I’m still at the stage of exploring the limits of each OP and the interface rather than complex scripts.

I noticed a couple of potential problems in the Tracker mode earlier but I didn’t make notes at the time. Pressing CTRL enters a value (without requiring ENTER…?). I’ll look again later.

it shouldn’t. with only 32 values i think it should work even without calibration (but calibrating is still a good idea).

it’s on purpose - pressing CTRL enters the current knob value into the selected cell.

Yes range of 32 works fine as is but I thought you were suggesting dead zones as a fix for jitter at the maximum, non-scaled range. (I would prefer stability at a range of 1024 at the very least! Ideally 4096.)

I must have skipped the section of the pdf where CTRL in the Tracker was mentioned. I’ll double-check any further bugs! Cheers!

1 Like

One thing I wished I had the time to do when I re-wrote the cut and paste code was to display the contents of scripts on the preset load screen and add support for copying the contents.

If you’ve got the headspace for it (and especially with the multi-line changes) it would be a real timesaver.

1 Like

I’ll add my support for this idea. I find that I often want scripts for other scenes as part of something I’m working on… i.e. I have a quad lfo script that I’d love to be able to copy into any new scene that I’m working on.

3 Likes

i don’t think the technique would work well for full range, you’d want it to be smooth. for scene selection though it makes sense.

do you mean displaying full content as one page right after the scene description part? that might be simple enough to do, i’ll take a look. not sure how this aligns with the proposal for new scene loading/saving though, i wasn’t following that discussion closely.

1 Like

Yeah basically that. IIRC you should be able to call print_command (from src/command.c) to get the string out easily enough. The trickier prospect is deciding how to manage the output buffer. (i.e. convert all 10 scripts and store them in a temp buffer, or convert each line on demand as it’s needed). Other minor complexities include dealing with blank script lines.

AFAIK that only concerns serialisation to/from text files on USB, the on flash storage format will still be in the ‘compiled’ op codes that we currently use. Hopefully by using print_command you’ll be isolated from any changes in the underlying representation anyway.

1 Like

probably just enough to hold 7 lines and just update it dynamically when it’s scrolled up/down. can just ignore blank lines. another question is how to treat selection - for multi line implementation i changed the copy/paste buffer to be able to hold up to 32 lines (thinking this would be needed in case you want to copy/paste a scene description). i think i’ll leave it at that, and if you copy more than what a script can hold it will just shift everything down and discard any lines after 6 (which is how multi line copy/pasting works right now).

of course, there is a temptation to allow editing in this mode as well, so then you can edit all scripts together on one screen… :slight_smile: just a though really as this would require its own screen and proper script validation etc. i do think that multi line editing will be super handy whenever we get to the timeline feature (especially moving lines up/down - i imagine you’d do that often when editing the timeline).

i meant this thread: (Teletype) USB Disk Mode Interface it mentions script copying among other things.

The key combos for manual execution of scripts don’t seem to be working for me.

I’ve tried every combo of Win / Fn / Ctrl / Alt / Shft + a number / an F key.

Only Fn + F3 and Fn + F4 work - triggering Scripts 3 and 4, as expected.

I can’t trigger any other numbered script or “I” using any combo I’ve been able to find documented in previous versions.

EDIT: OK - I now see F1, F2, F3, F4 and F10 work without a key combo - but F5, F6, F7, F8 don’t. I hope I haven’t added to the confusion. Basically - there should be one key combo that works for each script - and that isn’t the case currently

Mutes all work - except for Ctrl + F9 for M, which is intermittent - ie. If I hold Ctrl and repeatedly press F9 (not too fast), it doesn’t always toggle the mute status of M. (Also the small letter M in the bottom left corner of the Mute Script screen does not reflect its Mute status as the similar numbers on other Script pages do.)

I’m on the stock chiclet keyboard.

Am I missing something?

Regarding the ALT + UP black screen of death - it happened once today in about 3hrs of Teletyping. I was on a blank line on the 6th row of a 5 line script. After re-booting, I reloaded the script and tried to repeat the crash - but no such luck.

i just tried triggering scripts with F keys and it works fine. could you try it with older firmware and see if you can reproduce? i have a feeling there is something else going on. also try replugging the keyboard several times.