Strudel Documentation

website·Indexed 35 days ago

https://strudel.cc/learn/getting-started/

Documentation for Strudel, a live coding environment for patterns and music. It covers Mini-notation, Mondo Notation, synthesis, sampling, and tonal functions. The guides include technical details on cycles, LFOs, audio effects, and integration with MIDI, OSC, MQTT, and Hydra, as well as a comparison with TidalCycles.

Tokens
39.2K
Snippets
279
Records
381
Agent score
73%

What's inside Strudel

  1. Overview of Mondo Notation

    Mondo Notation is a standalone pattern language in Strudel that extends Mini Notation by allowing function calls and chaining. It removes the boundary between pattern definitions and function applications, allowing for more concise music coding.
  2. Overview of Strudel live coding environment

    Strudel is a web-based live coding environment that implements the Tidal Cycles algorithmic pattern language using JavaScript. Unlike the original Tidal Cycles (which requires Haskell and a SuperCollider/SuperDirt installation), Strudel runs directly in the web browser and generates sound natively without requiring additional software installation.
  3. Overview of Strudel for live coding music

    Strudel is a JavaScript port of the Tidal Cycles pattern language used for expressively writing dynamic music pieces. It allows for live coding music in real time, algorithmic composition via pattern manipulation, and integration into existing music setups using MIDI or OSC as a flexible sequencer. The primary environment for using Strudel is the Strudel REPL.
  4. Overview of Strudel testing strategies

    Strudel utilizes vitest for its testing framework, employing two primary strategies: unit tests for fine-grained logic verification and automated snapshot tests for broader system and pattern validation.
  5. Understand the relationship between Mini Notation and Pattern Functions

    In Strudel, everything is built from functions. Every operation possible in Mini Notation has an equivalent JavaScript function representation. Mini Notation is generally preferred for concise individual rhythms, while JavaScript functions are better suited for larger contexts and complex logic.
  6. Understand Strudel's default sound synthesis

    When using note or freq without specifying a sound source, Strudel uses a default triangle wave oscillator to synthesize the sound.
  7. Understand Strudel Mini-Notation basics

    Strudel uses 'Mini-Notation' to write rhythmic patterns. Events are separated by spaces and are squashed into a single cycle. The duration of each event is determined by the total number of events in the cycle; adding more events decreases the length of each individual event without changing the overall cycle duration.
    // Four events per cycle
    note("c e g b")
    
    // Eight events per cycle (each is shorter)
    note("c d e f g a b")
  8. Understand the Strudel Pattern model

    Patterns in Strudel are abstract entities based on pure functional reactive programming. A Pattern is essentially a function that takes a time span (input) and outputs a set of events occurring within that span. This process is called 'querying'.

    Time is measured in 'cycles'. The length of a cycle is determined by the tempo (defaulting to one cycle per second). Each event generated by a query contains a value, a begin time, and an end time, represented as fractions of the cycle.

    In the live coding editor, users define the pattern, and the scheduler automatically handles the querying and triggers sound synthesis.

  9. Add music metadata to Strudel code

    You can add music metadata to your Strudel code using tags within comments. These tags are ignored by the Strudel engine but can be used by external tools and the online REPL to categorize and retrieve information about the music. Metadata can be defined using single-line comments (//), comment blocks (/* ... */), or by placing multiple tags on one line.
    // @title My Cool Song
    // @by John Doe
    // @license CC-BY-SA-4.0
    
    /*
    @title My Cool Song
    @by John Doe
    @license CC-BY-SA-4.0
    */
    
    // @title My Cool Song @by John Doe @license CC-BY-SA-4.0
    
    // "My Cool Song" @by John Doe
  10. Use Continuous Signals for modulation in Strudel

    Signals in Strudel are patterns with continuous values (theoretically infinite steps) that provide streams of numbers. They are typically used to modulate other parameters or to generate sequences of notes when combined with .segment() and .range().

    Common signal types include:

    • Waveforms (0 to 1): saw, sine, cosine, tri, square.
    • Waveforms (-1 to 1): saw2, sine2, cosine2, tri2, square2.
    • Randomness: rand (0 to 1), perlin (Perlin noise 0 to 1), irand(n) (integers 0 to n-1), brand (binary 0 or 1), and brandBy(prob) (binary 0 or 1 with a specific probability for 1).
  11. Use Strudel offline via PWA

    Strudel is implemented as a Progressive Web App (PWA). When you first visit the Strudel REPL, the browser downloads the entire web app and documentation (<1MB). Once downloaded, the site remains accessible without a network connection. Updates are automatically downloaded during the next online visit and the site refreshes once the update is complete.
  12. Use superdough for Web Audio synthesis

    The superdough package encapsulates Strudel's web audio-based synth, sampler, and effects engine. It provides several advanced synthesis and modulation features, including:

    • Filter envelopes
    • FM Synthesis
    • Looping samples (enabling wavetable synthesis)
    • Vibrato
    • Integration of ZZFX