strudel
Key Points
- 1Strudel is a web-based environment for live coding algorithmic music patterns, offering a faithful JavaScript port of TidalCycles.
- 2This platform allows users to manipulate sound in real-time through code, leveraging web-audio technologies and providing resources for local development and project integration.
- 3Released under the GNU Affero Public License v3, Strudel emphasizes open-source collaboration and supports an active community for discussion and contributions.
Strudel is an open-source, web-based live coding environment designed for the creation and manipulation of algorithmic musical patterns. It serves as a faithful port of the Haskell-based TidalCycles system to JavaScript, enabling similar pattern-based composition directly within a web browser at https://strudel.cc/.
The core methodology of Strudel revolves around its implementation of TidalCycles' expressive pattern combinators and its real-time interactive nature. While the specific internal representations are not detailed, a "faithful port" implies that it translates TidalCycles' concepts, such as its time-aware pattern data structure and its rich set of operators for transforming and combining patterns, into a JavaScript context. This likely involves:
- Pattern Abstraction: Representing musical or sonic events and their temporal arrangement as programmatic patterns. In TidalCycles, a pattern can be thought of as a function from a time interval to a list of events. A JavaScript implementation would likely adopt a similar functional or object-oriented approach to model these patterns, allowing them to be composed and transformed.
- Temporal Precision: Leveraging the Web Audio API's
AudioContext.currentTimefor precise scheduling of events, ensuring rhythmic accuracy crucial for live coding. This involves pre-calculating and queuing future events to compensate for JavaScript's single-threaded nature and browser event loop latency. - Domain-Specific Language (DSL) in JavaScript: Providing a set of JavaScript functions and methods that mirror TidalCycles' DSL, allowing users to express complex rhythmic and melodic structures concisely. For instance, operations like sequence cycling, pattern manipulation (e.g.,
chop,speed,rev), and event transformation would be implemented as higher-order functions or methods on pattern objects. - Modular Architecture: The project is organized into multiple npm packages, promoting reusability and extensibility. An example mentioned is
packages/edoforedoScale()(equal division of the octave) functionality, indicating support for microtonality. This modularity suggests that core pattern logic, synthesis components, and UI elements are separated. - Real-time Interaction (REPL): As a live coding environment, it integrates an interactive REPL, allowing users to execute JavaScript code snippets in real-time, instantly modifying the ongoing sonic output. This requires efficient code evaluation and pattern re-synchronization mechanisms.
- Sound Synthesis: Integration with the Web Audio API enables in-browser sound generation and processing, utilizing synthesizers, samples (from the
dough-samplesrepository), and effects. The mention of LFO documentation suggests capabilities for modulating synthesis parameters.
The project is developed primarily in JavaScript (84.2%), with supplementary files in MDX (for documentation), Csound (potentially for specific synthesis units or samples), Astro (for the website/front-end framework), and PEG.js (likely for parsing custom syntaxes or pattern descriptions). It operates under the GNU Affero Public License v3 (AGPLv3), mandating open-source distribution for derived works. Development is hosted on Codeberg, reflecting a conscious move from proprietary platforms for ethical reasons.