Flora
L-systems sequencer and bandpass filtered sawtooth engine for monome norns
Install / Use
/learn @jaseknighter/FloraREADME

Flora
An L-systems sequencer and bandpass-filtered sawtooth engine for monome norns
Demonstration video: https://vimeo.com/496481575
Follow the discussion on lines: https://llllllll.co/t/40261
Documentation
- Flora
Overview
L-systems and their sequencing
L-system basics
An L-system is a parallel rewriting mechanism originally conceived by Aristid Lindenmayer in 1968 as a mathematical model of plant development.
The basic building blocks of most L-systems include:
- Turtle graphics engine: First developed for the Logo programming language, a turtle creates a drawing from instructions that dictate when to move forward and draw and when to rotate to point in a different direction.
- Alphabet: A set of characters, each representing an instruction for an L-system algorithm to interpret (e.g. rotate, move forward, turn around, draw a line, etc.).
- Axiom: A sentence containing one or more characters that represents the starting point of an L-system algorithm.
- Rulesets: Each ruleset of an L-system contains two strings. The first string, the predecessor, typically contains a single character. The second string, the successor, contains one or more character. Each time the algorithm runs, if the character contained in the first string of the ruleset is encountered, it will replace that character with the character(s) of the second string.
- Angle: An angle used by the turtle to rotate clockwise or counterclockwise, giving it a new direction to move the next time it receives an instruction to draw a line.
- Generations: A generation represents a completed execution of the L-system algorithm.
Simple rewriting example
Take the following:
- Axiom: b
- Ruleset 1: b->a
- Ruleset 2: a->ab
The above axiom and rulesets will result in the following sentences when run six times, starting with the axiom b as Generation 0. Ruleset 1 states that each time the character b is encountered, it is replaced with a. Ruleset 2 states that each time the character a is encountered, it replaced with ab.
- Generation 0: b
- Generation 1: a
- Generation 2: ab
- Generation 3: aba
- Generation 4: abaab
- Generation 5: abaababa
Sequencing the L-system
The Flora alphabet
| Character | Turtle Behavior | Sound Behavior | | ---------- | ------------------------------------------------------- | --------------------------------------------------------------- | | F | Move the turtle forward and draw a line and a circle | Play current note | | G | Move the turtle forward and draw a line | Resting note (silence) | | [ | Save the current position | Save the current note | | ] | Restore the last saved position | Restore the last saved note | | + | Rotate the turtle counterclockwise by the current angle | Increase the active note's pitch (see Changes in pitch below) | | - | Rotate the turtle clockwise by the current angle | Decrease the active note's pitch (see Changes in pitch below) | | | | Rotate the turtle 180 degrees | No sound behavior | | r | Randomly increase or decrease the angle each frame | Randomly increase or decrease the active note's pitch (see Changes in pitch below) | | ! | Randomly set an angle | Randomly increase or decrease the active note's pitch (see Changes in pitch below) | | other | Other characters are ignored by the turtle | No sound behavior |
Changes in pitch
Flora leverages L-systems to algorithmically generate music, in particular, by taking the angles written into the L-system sentences as indicators of an increase or decrease in pitch. The amount of change in pitch is set by the angle measured in radians multiplied by the current pitch. The changes in pitch are quantized, so if an angle multiplied by the current pitch is not greater than a whole number, the pitch stays the same.
If a change in angle results in a pitch that is greater than the number of notes in the active scale, the active note becomes the root (lowest) note of the active scale. Conversely, if a change in angle results in a pitch that is less than the root note of the active scale, the active note becomes the last (highest) note in the active scale.
Bandsaw
If the output parameter is set in norns to include audio, notes will be played using the Bandsaw engine, built around a bandpass filtered sawtooth wave generator. This engine is based on the marimba instrument demonstrated by Eli Fieldsteel in video, SuperCollider Tutorial #15: Composing a Piece, Part I.
Unlike a 'typical' oscillator, where the frequency of the oscillator is perceived as the note being played, the notes typically heard when the Bandsaw engine is played are determined by the center frequency of its bandpass filter, not the frequency of its sawtooth oscillator.
The parameters of this instrument may be set in the PARAMETERS->EDIT menu or on the water page of the Flora program (see water below for more details)
SAFETY NOTES
Safety Note #1
The SuperCollider documentation for its BandPassFilter (BPF) contains the following warning:
WARNING: due to the nature of its implementation frequency values close to 0 may cause glitches and/or extremely loud audio artifacts!
For safety purposes, the minimum note frequency value is set to 0.2 to prevent loud noises. This safety measure is implemented in both the Bandsaw engine and the Lua code for norns.
Safety Note #2
The Bandsaw engine becomes loudly percussive as the values for rqmin and rqmax increase. Please take care not to hurt your ears, especially when using headphones.

norns UI
Flora's interface consists of five screens (or "pages"). Navigation between screens occurs using Encoder 1 (E1). While the controls for each screen vary, basic instructions for each screen can always be accessed using the key combination: Key 1 (K1) + Key 2 (K2). The instructions may also be found in the lib/instructions.lua file.
For many parameters, fine-grained adjustments can be made by pressing K1 along with the encoder (see below for details.)
Screens
The first three screens of the Flora program (Plant, Modify, and Observe) display two L-system rulesets, used by the program to sequence notes. The fourth screen (Plow) displays two envelopes. The fifth screen (Water) displays controls for the Bandsaw engine and other outputs (i.e. Midi, Just Friends, and crow).
Plant

e1: next page
k1 + e1: select active plant
k1 + e2: replace active plant
e3: increase/decrease angle
k2/k3: previous/next generation
k1 + k3: reset plants to original forms and restart their sequences
Modify

e1: next/previous page
k1 + e1: select active plant
e2: go to next/previous letter
e3: change letter
k2/k3: delete/add letter
k1 + k3: reset plants to original forms and restart their sequences
Observe

e1: next/previous page
k1 + e1: select active plant
e2: move up/down
e3: move left/right
k2/k3: zoom out/in
k1 + k3: reset plants to original forms and restart their sequences
Plow

e1: next/previous page
k1 + e1: select active plant
e2: select envelope control
e3: change envelope control value
k2/k3: delete/add envelope control point
The Plow screen provides controls for two envelopes, one for each L-system ruleset sequence. An extension of Mark Eats' envgraph class, the envelopes controlled on this screen are applied to the Bandsaw engine when the envelopes' respective L-system ruleset sequence triggers a note to play.
Unlike typical envelopes (AR, AD, ADSR, etc.), the envelope class developed for this program al
Related Skills
node-connect
351.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
