Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Welcome

... to the pattrns scripting guide! pattrns is an experimental imperative music sequence generator engine that lets you create musical patterns programmatically using Lua scripts for algorithmic or live music coding.

This guide focuses on the Lua scripting API. For Rust development, see the pattrns crate docs.

Key Features

Programmatic : Build musical patterns using dynamic scripts or precompiled code.
Modular : Combine and reuse patterns components dynamically.
Flexible : Create anything from simple beats to complex musical phrases.
Generative : Make evolving compositions that change over time.
Dynamic : Modify patterns live, during playback.
External Control : Connect with MIDI/OSC controllers for hands-on parameter tweaking.
Templates : Create user configurable pattern templates.
Cycles Mini-Notation : Use familiar Tidal Cycles mini-notation for rapid pattern creation.

Applications

Online Playground : Experiment with pattrns scripts directly in your browser
Rust Examples : Write or test scripts in Rust or Lua with a basic sample player.

Documentation

Quickstart : Start with a quick introduction through practical examples.
Guide : Get into details with a more comprehensive documentation.
Examples : More advanced examples, created and explained step by step.
Reference : Read raw technical specifications of the Lua API.