ATOM SQ LIVE CODE - STRUDEL BRIEF ============================================================ I am jamming on https://atomsq.sevinhub.com/live.html, a live-coding music page powered by Strudel (strudel.cc), a real browser-based pattern language and audio engine (the same one used for algorave live coding). Write me a pattern. STRUDEL LIVE-CODING LANGUAGE - QUICK REFERENCE (https://strudel.cc - a JavaScript port of TidalCycles. Output is a single JavaScript expression/statement chain, evaluated directly by the browser.) TEMPO setcpm(120/4) set cycles per minute (bpm/4 for a 4/4 beat) setcps(0.5) set cycles per second directly SOUND SOURCES s("bd sd hh cp") play named samples in sequence, one per step s("bd*4") repeat 4 times inside one step s("bd(3,8)") euclidean rhythm: 3 hits over 8 steps n("0 1 2 3").s("jazz") pick sample index n from a sample bank note("c e g").s("piano") play named notes on an instrument/sound note("c3 eb3 g3") note names: letter + optional # or b + octave sound("sawtooth") alias of s(), reads better for synths MINI-NOTATION (the strings passed to s/n/note) " " space separates sequential events "bd hh sd hh" ~ rest / silence "bd ~ sd ~" *n speed up n times within the slot "hh*8" /n slow down, spread over n cycles "bd/2" !n repeat without changing note "bd!3" one item per CYCLE (alternates each loop) "" [a b] group/subdivide one slot "bd [hh hh]" a,b layer in parallel (a chord or two voices) "[c,e,g]" a(x,y) euclidean rhythm: x hits over y steps "bd(3,8)" a? 50% chance to drop the event "hh*8?" a|b pick one at random each time "[bd|cp]" %n repeat pattern to fill n steps "{c e g}%8" EFFECTS (chain with .method(value), value can itself be a mini-notation string) .gain(n) volume, 0-1+ .gain(".8 1 .6 1") .pan(n) stereo position 0-1 .pan("<0 .5 1>") .speed(n) playback speed / pitch .speed(1.5) .lpf(hz) .hpf(hz) .bpf(hz) low/high/band-pass filter cutoff .lpq(n) .hpq(n) filter resonance .attack(s) .decay(s) .sustain(0-1) .release(s) amplitude envelope (ADSR) .pattack(s) .pdecay(s) .prelease(s) PITCH envelope (pitch swoop) .room(0-1) reverb send .delay(0-1) .delaytime(s) .delayfeedback(0-1) echo .distort(n) waveshaping distortion .distort(2) .crush(bits) bitcrush, lower = harsher .crush(4) .vowel("a e i o u") formant/vowel filter .orbit(n) separate effects bus (1,2,3..) so tracks don't share fx .duckorbit(n) sidechain-duck this pattern whenever orbit n hits .duckattack(s) .duckdepth(0-1) shape the duck .bank("RolandTR909") pick a drum machine bank for s() .jux(rev) play once normal + once reversed, panned apart .euclid(x,y) alt way to write euclidean rhythms as a method .struct("t ~ t t") apply a rhythm (t=hit, ~=rest) to a fixed set of notes .scale("C:minor") snap note()/n() numbers into a musical scale .every(n, fn) apply function fn every n cycles, e.g. .every(4, rev) .sometimesBy(p, fn) apply fn to p fraction of events at random .degradeBy(p) randomly drop p fraction of events .off(t, fn) layer a delayed, transformed copy (t = cycle offset) .ply(n) repeat each event n times within its own slot .chop(n) slice a sample into n pieces and play them in order .slow(n) .fast(n) stretch/compress the WHOLE pattern by n .rev() reverse the pattern VISUALIZATION (optional - draws a live piano-roll in the dedicated visualization panel above the editor, scrolling in sync with playback) .pianoroll() add to any one pattern/track to see its notes as they play, e.g. note("c e g").s("piano").pianoroll() Use .pianoroll() (no underscore) so it draws in that panel, NOT ._pianoroll() (underscore), which draws inline over the code text instead and is not wanted here. REQUIRED: chain .pianoroll() onto exactly ONE track in every pattern you write (pick the clearest melodic/bass/lead line - not a drum-only track, those are hard to read as a piano roll). This page always shows a live visualization panel, so every pattern must feed it. COMBINING PATTERNS stack(a, b, c) play multiple patterns layered at once (the main way to build a full track: stack(kick, hats, bass, ...)) cat(a, b) play patterns one full cycle after another, looping let x = s("bd*4") you CAN assign to variables then stack(x, y, z) A REAL MINIMAL BEAT (all verified syntax): setcpm(140/4) stack( s("bd*4").gain(1), s("~ cp ~ cp").gain(.9), s("hh*8").gain(".4 .8").pan("<0 1>"), note("").s("sawtooth").lpf(600).distort(1.2).gain(.8).pianoroll() ) RULES FOR YOUR OUTPUT - Output ONLY functions and mini-notation shown above. Do not invent function names that are not in this list. - Use stack(...) to combine drums/bass/melody/pads into one full pattern. - Always chain .pianoroll() onto exactly one melodic/bass/lead track (see VISUALIZATION above). Never skip this. - setcpm(...) or setcps(...) must be the first line when tempo matters. - Prefer real drum sample names: bd, sd, hh, oh, cp, rim, cr, rd, lt, mt, ht. - Keep it playable immediately: no undefined variables, no missing commas, balanced parentheses/brackets/quotes. GENRE CONVENTIONS (match these unless the request says otherwise; still stay inside the syntax above - never invent a function to chase a genre) house: 118-126bpm. Four-on-the-floor bd*4, offbeat open hats, a looped chord/pluck riff, warm sub bass. .room()+.delay() for depth, not distortion. techno: 125-135bpm. Hypnotic, repetitive, few melodic notes. bd*4, tight closed hats, a driving mono bassline. Automate .lpf/.hpf over a <...> cycle sequence for the classic filter-sweep build. trance: 132-140bpm. Rolling 16th-note arpeggio lead, gated supersaw pad, long .room()/.delay(), big filter sweeps on breakdowns. dubstep: 138-142bpm, HALF-TIME feel (snare/clap on beat 3 only, not 2 and 4). Wobbling reese/growl bass via .lpf() modulated with a fast <...> pattern, sparse hats, heavy .distort()/.crush(). drum and bass / jungle / neurofunk: 160-176bpm. Fast breakbeat-style hh/sd pattern (not four-on-the-floor), reese/growl sub bass, .duckorbit() on the bass so it ducks under the kick, sparse stabby leads. footwork / juke: 155-165bpm but felt in triplets/odd groupings; chopped, repeated vocal-style stabs, syncopated kick, sparse and jittery. trap / hip-hop: 130-150bpm (often written/felt as 65-75bpm double-time hats). Rolling triplet/32nd hh rolls (.fast on the hat), sparse hard-hitting 808 sub (long .release, .distort a little), claps on 2 and 4. lofi hip-hop: 70-90bpm. Laid-back swung drums (use swing via subtle timing offsets or a looser step feel), jazzy 7th/9th chords, .crush()/.lpf(1500- 3000) for the dusty/warm filtered tape feel, vinyl-style filtered hats. breakbeat / breaks: 130-140bpm. A syncopated, non-four-on-floor kick/snare breakbeat pattern (borrow the DnB break idea but slower), funky and loose. uk garage / 2-step: 130-136bpm. Shuffled, syncopated kick/snare (2-step, NOT four-on-the-floor), skippy hats, pitched-up chopped vocal-style stabs, warm sub bass. ambient / drone: 40-70bpm or no clear pulse at all. Very .slow() pads, long .room(), minimal or no drums, gentle .pianoroll()-worthy slow melody. cinematic / orchestral: flexible tempo, use real instrument packs (see ATOM SQ SOUNDS below) for strings/brass/piano over synth pads, long reverb, sparse rhythm, dynamics via .gain automation more than drums. funk / disco: 110-124bpm. Syncopated, groove-forward bd/sd, tight closed hats with accents, a plucky/bouncy bass on the off-beats, bright chords. reggae / dub: 70-90bpm. Off-beat "skank" chords, heavy sparse sub bass on beat 3, deep .room()/.delay() (dub echo), sparse drums with space. latin / reggaeton: 90-100bpm (dembow feel). A syncopated kick-kick-snare-kick dembow-style rhythm, warm bass, bright percussion. afrobeats: 100-115bpm. Syncopated log-drum-style bass, off-beat percussion layers, warm and spacious, moderate swing feel. phonk: 130-145bpm (often felt half-time). Cowbell-heavy percussion, distorted saturated 808 bass, dark and lo-fi, memphis-style vocal-chop-ish stabs if a phrase pack fits. pop / rock loop: 100-128bpm depending on feel. Clear verse/chorus energy contrast if writing a whole song (see SONG STRUCTURE), simple strong bd/sd backbeat, guitar/keys chords, hook-forward lead melody. REAL ATOM SQ SOUNDS (optional - use s("...") with these exact names for real recorded instruments/drums instead of Strudel's built-in banks, when the requested style wants something acoustic/realistic; keep synth sounds for electronic genres, that is not a compromise there): Real instruments: "atomsq-bass-electric" - Picked Electric Bass (CC0): real instrument, playable E1-E2, e.g. note("c3 e3 g3").s("atomsq-bass-electric") "atomsq-cellos" - Cello Section (CC0): real instrument, playable C1-F4, e.g. note("c3 e3 g3").s("atomsq-cellos") "atomsq-clarinet" - Clarinet (CC0): real instrument, playable D2-F#5, e.g. note("c3 e3 g3").s("atomsq-clarinet") "atomsq-contrabass" - Solo Contrabass (CC0): real instrument, playable E0-B2, e.g. note("c3 e3 g3").s("atomsq-contrabass") "atomsq-electric-piano" - FM Electric Piano (CC0): real instrument, playable C0-C7, e.g. note("c3 e3 g3").s("atomsq-electric-piano") "atomsq-flute" - Flute (CC0): real instrument, playable C3-C6, e.g. note("c3 e3 g3").s("atomsq-flute") "atomsq-french-horn" - French Horn (CC0): real instrument, playable A0-F4, e.g. note("c3 e3 g3").s("atomsq-french-horn") "atomsq-glockenspiel" - Glockenspiel (CC0): real instrument, playable G4-C7, e.g. note("c3 e3 g3").s("atomsq-glockenspiel") "atomsq-guitar-distorted" - Distorted Electric Guitar (CC0): real instrument, playable C2-C#6, e.g. note("c3 e3 g3").s("atomsq-guitar-distorted") "atomsq-guitar-electric" - Clean Electric Guitar (CC0): real instrument, playable C2-C#6, e.g. note("c3 e3 g3").s("atomsq-guitar-electric") "atomsq-guitar-nylon" - Spanish Classical Guitar (CC0): real instrument, playable G1-A#5, e.g. note("c3 e3 g3").s("atomsq-guitar-nylon") "atomsq-harp" - Concert Harp (CC0): real instrument, playable E1-F7, e.g. note("c3 e3 g3").s("atomsq-harp") "atomsq-harpsichord" - Flemish Harpsichord (CC0): real instrument, playable F#0-C6, e.g. note("c3 e3 g3").s("atomsq-harpsichord") "atomsq-marimba" - Marimba (CC0): real instrument, playable F1-C6, e.g. note("c3 e3 g3").s("atomsq-marimba") "atomsq-oboe" - Oboe (CC0): real instrument, playable A#2-F5, e.g. note("c3 e3 g3").s("atomsq-oboe") "atomsq-piano-steinway" - Steinway B Grand Piano (CC0): real instrument, playable A#0-G#7, e.g. note("c3 e3 g3").s("atomsq-piano-steinway") "atomsq-piano-upright" - Yamaha Upright Piano (CC0): real instrument, playable C0-C6, e.g. note("c3 e3 g3").s("atomsq-piano-upright") "atomsq-strings-pizzicato" - Pizzicato Strings (CC0): real instrument, playable C1-F4, e.g. note("c3 e3 g3").s("atomsq-strings-pizzicato") "atomsq-tenor-sax" - Tenor Saxophone (CC0): real instrument, playable G#1-E5, e.g. note("c3 e3 g3").s("atomsq-tenor-sax") "atomsq-trombone" - Tenor Trombone (CC0): real instrument, playable A#0-F3, e.g. note("c3 e3 g3").s("atomsq-trombone") "atomsq-trumpet" - Trumpet (CC0): real instrument, playable F2-C5, e.g. note("c3 e3 g3").s("atomsq-trumpet") "atomsq-tuba" - Tuba (CC0): real instrument, playable F0-D3, e.g. note("c3 e3 g3").s("atomsq-tuba") "atomsq-vibraphone" - Vibraphone (CC0): real instrument, playable F2-E5, e.g. note("c3 e3 g3").s("atomsq-vibraphone") "atomsq-violas" - Viola Section (CC0): real instrument, playable C2-D5, e.g. note("c3 e3 g3").s("atomsq-violas") "atomsq-violin-solo" - Solo Violin (CC0): real instrument, playable G2-C7, e.g. note("c3 e3 g3").s("atomsq-violin-solo") "atomsq-violins" - Violin Section (CC0): real instrument, playable G2-D5, e.g. note("c3 e3 g3").s("atomsq-violins") "atomsq-xylophone" - Xylophone (CC0): real instrument, playable G3-C7, e.g. note("c3 e3 g3").s("atomsq-xylophone") One-shot/phrase samples (trigger AT MOST ONCE in the whole pattern, it is a finished recording, not a loopable hit): "atomsq-my-sub-bass" - Sub Bass (yours): ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-loop-drums" - Drum Loop (yours): ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-loop-shepard" - Shepard Riser FX (yours): ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-91v-ukb2-140-songstarter-no-access-intro" - songstarter no access intro: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-bt-synth-loop-20-150-f-m" - BT Synth Loop 20 150 F#m: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-ds-td2-145-drum-full-minus-alt" - DS TD2 145 drum full minus alt: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-ds-td2-fx-lazer-gametron" - fx lazer gametron: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-eliminate-bass-hit-yawoo3-c" - ELIMINATE bass hit yawoo3 C#: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-lev-glitch-094" - Lev Glitch 094: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-mo-unf-808-experimental-inflator-e" - experimental inflator bass: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-parth-bass-one-shot-thunder-taker-f" - parth bass one shot thunder taker F: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-rku-ukb-fx-atmosphere-one-shot-lfo-ether" - fx atmosphere one shot lfo ether: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-rku-ukb-vocal-adlib-one-shot-lfo-seraphi" - Adlib Hook vocal: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-so-sci-synth-bassy-crunchy-gb" - SO SCI synth bassy crunchy Gb: ONE trigger only, plays the whole recording at its own pitch (note is ignored). "atomsq-my-ts-prd-170-drums-relaxed-halftime-breakd" - drums relaxed halftime breakd: ONE trigger only, plays the whole recording at its own pitch (note is ignored). Real drum kits (one name per drum in the kit): "My Kit (your sounds)": atomsq-my-kit-kick, atomsq-my-kit-openhat, atomsq-my-kit-perc "Saturated Kick (yours)": atomsq-my-kick-dirty-kick "Sub Kick F# (yours)": atomsq-my-kick-sub-kick "Tight Bounce Kick (yours)": atomsq-my-kick-tight-kick "Acoustic Drum Kit (CC0)": atomsq-acoustic-kit-clap, atomsq-acoustic-kit-crash, atomsq-acoustic-kit-hat, atomsq-acoustic-kit-kick, atomsq-acoustic-kit-openhat, atomsq-acoustic-kit-perc, atomsq-acoustic-kit-perc-bongo, atomsq-acoustic-kit-perc-conga "CyOn Cyber Crash 02": atomsq-my-cyon-cyber-crash-02-crash, atomsq-my-cyon-cyber-crash-02-perc "TR-808 (CC0)": atomsq-tr808-clap, atomsq-tr808-hat, atomsq-tr808-kick, atomsq-tr808-openhat, atomsq-tr808-perc, atomsq-tr808-perc-clave, atomsq-tr808-perc-maraca, atomsq-tr808-ride MY REQUEST: Reply with ONLY the Strudel code, in one fenced code block, nothing else - no explanation before or after. I will paste your code straight into the Live Code page and press Run.