OTYPElearn1.1scripting for the octatrackoctatrack

The studies
  1. Learn OType
  2. 01Quickstart
  3. 02Numbers and expressions
  4. 03Decisions and loops
  5. 04Variables and memory
  6. 05Tracks and steps
  7. 06Functions
  8. 07Asking the player
  9. 08Chance you can repeat
  10. 09Live scripts
  11. 10When something is wrong
  12. 11Appendix: scope at a glance

appendix

Appendix: scope at a glance

Who can see a name, who can change it, and how long it lives. Each line points to the study that explains it.

nameseen bychanged bylives
a b c done call of one functionthat callone run, 0 at the start (variables)
x y z tevery functionevery functionbetween presses, 0 at startup (variables)
var nameits functionits functionbetween presses and wakes, from the loading of the scripts (variables)
i jthe loop and what it governsthe loops onlythe loop (loops)
argumentstheir functionno one: read-onlyone call (functions)
paramits functionthe player, before the runone run (the player)
constevery fileno onealways (functions)
functionsevery file—always (functions)
flip o drunk, every counterstheir functiontheir functionbetween presses, reset at startup (variables)
tracks and steps (trk, steps)the line or block, and the functions it calls (a copy)the line or blockuntil the end of the block (tracks and steps)
seedthe rest of the block, and the functions it callsthe blockuntil the end of the block (chance)

Coming from Teletype

OType borrows Teletype's prefix notation, its modifiers before : and many of its words. The main differences:

  • no limit of six lines: blocks by indentation, named functions with arguments, instead of scripts 1 to 8;
  • no ;: an indented block replaces several commands on a line;
  • no W (while): every loop is bounded before the run;
  • operations act on a context of tracks and steps;
  • a b c d are local, x y z t global and kept between presses;
  • scripts are written on a computer, since the Octatrack has no keyboard port.