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

learn OType

Learn OType

OType is a small language for the Octatrack. A script is a text file on the CF card; each function in it becomes an entry in your firmware's script menu, or a live script that plays along with the sequencer. A function can place trigs, lock parameters, set up parts and scenes, send MIDI, arm the recorder, and work on audio files on the card.

This guide teaches the language from the beginning. It is a series of short studies: each one builds something you can hear, and introduces the parts of the language it needs on the way. Read them in order; each study assumes the ones before it.

Example · A whole script: a kick on every beat of the current track
def four_floor
  menu "BASICS" >> "FOUR FLOOR"
  tr.clr
  l 1 16: if eq mod i 4 1: tr.add i

By the end of the quickstart you will have written this script, checked it, seen what it does, and run it on the machine. By the end of the studies you will be able to read any script in the cookbook and write your own.

What you need

  • A text editor. Any will do. The VS Code extension checks your script as you type, with the same rules as the unit.
  • Python 3 and a copy of the OType repository, to check scripts and run them on the computer. You can follow every study this way, without an Octatrack.
  • An Octatrack running a firmware that integrates OType, such as OT1, to hear the result. OType is developed on the MKI, OS 1.40C.

The studies

  1. Quickstart — a first script, from the editor to the machine
  2. Numbers and expressions — math, comparisons and logic in prefix notation
  3. Decisions and loops — if, l, prob, every and the other modifiers
  4. Variables and memory — what a script remembers, and for how long
  5. Tracks and steps — the context: what a line acts on
  6. Functions — your own words, with arguments and return values
  7. Asking the player — parameters, confirmation and messages
  8. Chance you can repeat — random values, lists and seeds
  9. Live scripts — scripts that run with the sequencer, MIDI, links between scripts
  10. When something is wrong — errors, and why every run ends
  11. Appendix: scope at a glance — who sees what, in one table

When you know what you want to do and need the exact word, go to the command reference: every operation, its arguments and an example.