Teletype script editing offline

has anyone edited scripts offline (on a computer) and had success/failure reading them into teletype with a usb stick?

i suspect there will be issues with different text editors and formatting.

this wasn’t necessarily a feature i was intending, also. if you’d like to share a tt scene, please attach the file as to preserve formatting-- otherwise the file will likely need to be retyped (which is probably good for learning the script).

but in general, i expect the file handling code needs to be improved.

I haven’t tried this, but I suspect it could be really fun to share files here on the forum.

A note on the “teletype code exchange” thread: it’s very long, making it difficult to sort through and find older interesting posts (especially since most of the posts in the thread are discussion, and not code). I’m wondering if it might be a more usable pattern to create individual posts for sharing teletype code, and use tags or a category to tie the posts together. That way any ensuing discussion can go on as long as it needs to without worry about “cluttering” the thread.

2 Likes

I have done a little editing using Atom in plain text mode. It worked well! The only issue I had was I forgot a “#” at the start of a section, after fixing it the file loaded perfectly.

I actually really like this mode for importing pre-existing scripts. I used the file import to get the example Euclidian Sequencer scene loaded. It was much faster than typing it all in on the TT directly.

2 Likes

the most likely issue for teletype would be line endings. iirc teletype has a problem with windows style CRLF line endings. when i implemented parsing for orca i treated both as newline, and it will ignore empty lines, so this works fine. for teletype looking at the code there are several places that need to be updated but should be very easy. alternatively it’s easy to configure windows based editors to use Unix style line endings (notepad++ etc).

i’ve been thinking it’d be nice to extract usb and parsing code to libavr32 - this would make it trivial adding it to whitewhale / earthsea etc etc. i could try and extract the fairly naive serialization code from orca, but thinking perhaps Ragel would be a good choice here? or some lightweight serialization library?

one more idea for USB storage: it would be nice at some point to define/consolidate the format between teletype/trilogy/orca/kria/ansible so that certain things that apply to multiple firmwares are serialized in the same manner, so it would be easy to facilitate exchanging, say, patterns or scales between different modules.

1 Like

I would like to know if this feature request is possible with the teletype.

Would a whole new text editor have to be written to exchange code easily via txt files?

When copying code from “code-exchange” library via HTML or RAW from git hub to windows notepad, there are still formatting errors on teletype output, which results in garbage output on teletype.

I definitely do not want to retype all extraneous code from other sources into teletype and save it manually.

Just copying code from a .txt file on a USB stick to teletype would be ideal and way more user friendly than it currently is.

if you’re on windows try notepad++, it can save teletype files with the line endings it requires (and i like it as an editor, that’s what i use for firmware development).

regardless, i think we should just support all kinds of line endings in teletype, it’s a trivial change.

also the ability to add line comments (something very simple like ignoring everything after //) would be great for scene sharing. of course if you edit a scene on teletype you’d have to manually redo all the comments, but for studies and teletype codex this would be very helpful.

5 Likes

Agreed. New text parser in 2.3 will support any line ending and I can add comment lines at that time.

5 Likes

Can you point me in the direction so I can start to understand how to prepare, or convert a cut and paste scene with Notepad++ so it conforms to the requirements needed by Teletype? I’m familiar with Notepad++ but I do not know how to remove the CR/LF formatting or what the Teletype requires in its place if anything.

notepad++ will detect line endings when you open a file, so if there isn’t some weird conversion when you download a scene you should be able to just open it and edit without any extra steps, and it will save with the proper line endings. i’ve also added .gitattributes for the teletype code exchange repo so that it will check out with proper line endings even if you’re on windows.

if somehow it got converted to windows line endings anyway (in which case teletype will display weird text when you load that scene) just open it in notepad++ and do edit->EOL conversion->Unix(LF). to confirm you have correct line endings press imagein the toolbar. windows line endings will show up as CRLF and what teletype wants is just LF.

1 Like

wait a sec… is this issue basically about converting line endings?

that seems like a pretty achievable goal.

on linux / mac:
dos2unix windows.txt unix.txt
tr -d '\15\32' < windows.txt > unix.txt

on windows: notepad++ as mentioned

atom: line-ending-convert
sublime text: view menu -> line endings…
vim: :e ++ff=unix
emacs: M-x set-buffer-file-coding-system RET undecided-unix

&c…

but yeah i guess the real solution is to just accept LF, CR or CRLF when parsing. i’ll shut up again now

1 Like

Resurrecting this dormant thread.

For those who use notepad++ (as do I), has anyone taken the time to develop a Teletype UDL for that editor? I have searched the NUDL collection but none there that I can see.

1 Like