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.
def four_floor
menu "BASICS" >> "FOUR FLOOR"
tr.clr
l 1 16: if eq mod i 4 1: tr.add iBy 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
- Quickstart — a first script, from the editor to the machine
- Numbers and expressions — math, comparisons and logic in prefix notation
- Decisions and loops —
if,l,prob,everyand the other modifiers - Variables and memory — what a script remembers, and for how long
- Tracks and steps — the context: what a line acts on
- Functions — your own words, with arguments and return values
- Asking the player — parameters, confirmation and messages
- Chance you can repeat — random values, lists and seeds
- Live scripts — scripts that run with the sequencer, MIDI, links between scripts
- When something is wrong — errors, and why every run ends
- 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.