/tsal:pattrnsfrom tsal
Creates generative, emergent music with Pattrns, a Lua-based pattern engine for Renoise. Use for algorithmic patterns, euclidean rhythms, and evolving melodies across multiple genres.
Ships in tsal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pattrns is a Lua-based pattern generation engine for Renoise that enables algorithmic, generative music creation. Use this skill when working with Pattrns to create emergent, evolving musical patterns across genres including breakbeat/jungle, IDM, jazz, industrial/trip-hop, and ambient music.
Core Architecture: Pattrns separates rhythm from melody through a Pulse → Gate → Event pipeline:
This separation enables powerful generative techniques where rhythms and melodies can evolve independently and be recombined in creative ways.
Invoke this skill when:
Every Pattrns pattern follows this structure:
return pattern {
unit = "1/16", -- Time grid (1/16, 1/8, 1/4, bars, etc.)
resolution = 1, -- Multiplier (2/3 for triplets)
offset = 0, -- Delay pattern start
repeats = true, -- Loop pattern
pulse = {1, 0, 1, 1}, -- Static rhythm array
event = {"c4", "e4", "g4"} -- Static note sequence
}
Euclidean Rhythms (most common starting point):
pulse = pulse.euclidean(7, 16) -- 7 hits distributed in 16 steps
Scale-Based Melodies:
local s = scale("c4", "minor")
event = s.notes -- Use scale notes as sequence
Random Generation with Control:
event = function(context)
local notes = scale("c4", "pentatonic minor").notes
return notes[math.random(#notes)]
end
Tidal Cycles Mini-Notation:
return cycle("kd ~ sn ~, [hh hh]*4"):map({
kd = "c4 #1", -- Kick drum
sn = "c4 #2", -- Snare
hh = "c4 #3 v0.5" -- Hi-hat, quieter
})
Identify what to create:
Start with rhythmic foundation:
Static Arrays:
pulse = {1, 0, 1, 1, 0, 1, 0, 0} -- Hand-crafted rhythm
Euclidean Distribution:
pulse = pulse.euclidean(5, 8) -- Algorithmic rhythm
Dynamic/Generative:
pulse = function(context)
return math.random() > 0.5 -- Probabilistic rhythm
end
Subdivisions (Cramming):
pulse = {1, {1, 1, 1}, 1, 0} -- Quarter + triplet + quarter + rest
Create melodic/harmonic content:
Static Sequence:
event = {"c4", "e4", "g4", "b4"}
Scale-Based:
local s = scale("c4", "minor")
event = function(context)
return s.notes[math.imod(context.step, #s.notes)]
end
Chord Progressions:
local s = scale("c4", "minor")
event = sequence(
s:chord("i"), -- Tonic
s:chord("iv"), -- Subdominant
s:chord("v") -- Dominant
)
Generative/Evolving:
event = function(init_context)
local state = initial_value
return function(context)
-- Update and use state to create evolution
state = state + delta
return generate_from(state)
end
end
Filter or modify pulse triggers:
gate = function(context)
-- Higher probability on downbeats
local is_downbeat = (context.pulse_step - 1) % 4 == 0
local probability = is_downbeat and 0.9 or 0.3
return math.random() < probability
end
Enable live tweaking without code changes:
parameter = {
parameter.integer("variation", 1, {1, 4}),
parameter.number("density", 0.5, {0.0, 1.0}),
}
-- Access in functions
event = function(context)
local var = context.parameter.variation
-- Use var to select different patterns
end
Workflow for Emergent Music:
Load references/genre_recipes.md and search for "Breakbeat" for complete examples.
Quick pattern:
-- Euclidean-based break
local kick = pulse.euclidean(4, 16)
local snare = pulse.euclidean(3, 16, 2)
local hats = pulse.from{1,0,1,0}:repeat_n(4)
-- Use cycle notation to combine
return cycle("[kd*16], [sn*16], [hh*16]"):map({
kd = function(ctx) return kick[math.imod(ctx.step,16)] and "c4 #1" end,
sn = function(ctx) return snare[math.imod(ctx.step,16)] and "c4 #2" end,
hh = function(ctx) return hats[math.imod(ctx.step,16)] and "c4 #3" end
})
Load references/core_techniques.md and search for "Constrained Random Walk" or "Scale-Based Generation".
Quick pattern:
return pattern {
unit = "1/16",
pulse = pulse.euclidean(7, 16), -- Rhythmic interest
event = function(init_context)
local notes = scale("c4", "pentatonic minor").notes
local last_idx = 1
return function(context)
-- Prefer small intervals (smoother melody)
local next_idx = last_idx
while math.abs(next_idx - last_idx) > 2 do
next_idx = math.random(#notes)
end
last_idx = next_idx
return notes[next_idx]
end
end
}
Load references/core_techniques.md and search for "Chord Progressions".
Quick pattern:
local s = scale("c4", "minor")
return pattern {
unit = "1/4", -- Whole notes
pulse = {1, 1, 1, 1},
event = sequence(
s:chord("i", 3), -- i minor
s:chord("iv", 3), -- iv minor
s:chord("v", 3), -- v minor
s:chord("i", 3) -- i minor
)
}
Load references/genre_recipes.md and search for "Ambient" or "Textural".
Quick pattern:
return pattern {
unit = "1/16",
pulse = function(context)
return math.random() > 0.85 -- Sparse
end,
event = function(context)
local notes = scale("c4", "phrygian").notes
return note(notes[math.random(#notes)])
:volume(0.2 + math.random() * 0.3)
:delay(math.random() * 0.5)
:panning(math.random() * 2 - 1)
end
}
Load references/core_techniques.md and search for "Polyrhythms".
Quick pattern:
-- 3:4:5 polyrhythm
cycle("[c4*3]/4, [e4*4]/4, [g4*5]/4")
For detailed explanations and complete code examples, load these reference files:
references/core_techniques.md)Load when working with:
Search patterns:
grep -i "euclidean" references/core_techniques.mdgrep -i "random" references/core_techniques.mdgrep -i "scale" references/core_techniques.mdreferences/genre_recipes.md)Load when creating:
Search patterns:
grep -i "breakbeat\|jungle\|dnb" references/genre_recipes.mdgrep -i "idm\|experimental\|glitch" references/genre_recipes.mdgrep -i "jazz\|swing\|walking" references/genre_recipes.mdreferences/api_quick_reference.md)Load when needing:
The assets/ directory contains starter templates for common patterns:
euclidean_drum.lua: Euclidean-based drum patterngenerative_melody.lua: Scale-based melody with constraintsevolving_chord.lua: Slowly evolving chord progressiontexture_cloud.lua: Sparse atmospheric textureCopy and modify these as starting points.
Use seeded random for reproducibility:
event = function(init_context)
local rand = math.randomstate(12345) -- Consistent seed
return function(context)
return generate_with(rand)
end
end
nil for rests, not 0 or falsearray[1] is first elementmath.imod(step, #array) for array wrappingPattern not triggering:
unit is appropriate for tempopulse returns non-zero valuesgate (if present) isn't filtering all eventsNotes out of key:
scale() to constrain note generationPattern too predictable:
math.random()Pattern too chaotic:
Lua errors:
math.imod for array wrapping, not %The power of Pattrns for emergent music:
IDEA → ALGORITHM → PATTERN → EVENTS → AUDIO → RESAMPLE → NEW PATTERN
This workflow enables creating "parts" that can be assembled into songs in Renoise or exported to traditional DAWs, with each iteration adding new layers of complexity and emergence.
Detailed technical documentation and genre-specific recipes. Load as needed:
core_techniques.md: In-depth technique explanations and code patternsgenre_recipes.md: Complete examples for different musical stylesapi_quick_reference.md: Function signatures and API referencePattern templates ready to copy and modify:
assets/euclidean_drum.lua (opens in a new tab)assets/evolving_chord.lua (opens in a new tab)assets/generative_melody.lua (opens in a new tab)assets/texture_cloud.lua (opens in a new tab)references/api_quick_reference.md (opens in a new tab)references/core_techniques.md (opens in a new tab)references/genre_recipes.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bfollington/terma --plugin tsal8 skills in this plugin
/bevyThis skill should be used when working on Bevy game engine projects. It provides specialized knowledge for Bevy's Entity Component System (ECS) architecture, component-driven design patterns, system ordering, UI development, build strategies, and common pitfalls. Use this skill when implementing game features, debugging Bevy code, designing component architectures, or working with Bevy's UI system./claude-pluginsReference for building and distributing Claude Code plugins — plugin.json and marketplace.json structure, bundling commands, agents, skills and hooks, versioning, and publishing a marketplace. Use when creating or packaging a plugin, setting up a marketplace, or debugging why a plugin's components are not loading./domain-driven-designThis skill should be used whenever domain modeling is taking place. It provides specialized guidance for type-driven and data-driven design based on Rich Hickey and Scott Wlaschin's principles. The skill helps contextualize current modeling within the existing domain model, identifies inconsistencies, builds ubiquitous language, and creates visualizations (Mermaid, Graphviz/DOT, ASCII diagrams) to communicate domain concepts clearly. Use this skill when designing types, modeling business domains, refactoring domain logic, or ensuring domain consistency across a codebase./godotThis skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components./godot-interactiveInteract with a running Godot game via MCP — launch, screenshot, click, inspect scene tree, get/set properties, call methods, run dev-console commands. Powered by godot-mcp + the GodotMCPBridge autoload (protocol v4.0)./shadertoyThis skill should be used when working with Shadertoy shaders, GLSL fragment shaders, or creating procedural graphics for the web. Use when writing .glsl files, implementing visual effects, creating generative art, or working with WebGL shader code. This skill provides GLSL ES syntax reference, common shader patterns, and Shadertoy-specific conventions.Other plugins' skills for the same job