Audio Live Coding Documentation
Rayon is a browser-based audio synthesis environment that uses shopping metaphors for live coding music. Products become synthesizers, shopping carts provide rhythm, and retail concepts control musical parameters.
supermarket.html in a modern browserstory mode to start a guided tutorial that teaches you the basics step by step.
[0] add beer // Add a synth to slot 0
[1] add fresh salad // Add a modified synth to slot 1
my cart has square wheels // Add drums
| Shortcut | Action |
|---|---|
| Ctrl+Enter | Run the current line |
| Ctrl+Shift+Enter | Run all lines in the editor |
| Esc | Stop all sounds and clear products |
| Tab | Accept autocomplete suggestion |
| ↑ / ↓ | Navigate autocomplete suggestions |
Products are synthesizers assigned to slots [0] through [9]. Each slot can hold one synth at a time.
[N] add [modifiers] product [parameters]
| Product | Sound Description |
|---|---|
| beer | Mellow FM synth - smooth jazzy tones |
| salad | Crisp pluck synth - fresh texture |
| ham | Rich fat sawtooth - savory depth |
| milk | Soft pluck synth - liquid smooth |
| chips | Crispy sawtooth with filter sweep |
| pizza | Triangle wave FM synth - warm tones |
| oil | Low frequency sine wave - liquid bass |
| wine | Detuned poly synth - complex layers |
| cheese | Warm FM synth - smooth harmonics |
| soda | High pitched membrane synth - fizzy |
| bread | Warm duo synth - soft and full |
| cereal | Crunchy granular synth - textured |
| chocolate | Rich square wave AM synth - sweet |
| candy | Bright sawtooth mono synth - sugary |
| energy_drink | Buzzy FM synth - energetic |
| coffee | Dark filtered sawtooth - caffeinated |
| butter | Creamy detuned duo synth - smooth |
| eggs | Plucked string with bright attack |
| pasta | Soft poly synth - Italian warmth |
| rice | Short noise bursts - grainy texture |
[N] remove // Remove product from slot N
remove all // Clear all slots
Add modifiers before the product name to apply effects.
| Modifier | Effect |
|---|---|
| fresh | Higher pitch, brighter sound |
| old | Lower pitch, darker sound |
| Modifier | Effect |
|---|---|
| strong | Lowpass filter, deeper tone |
| flavorless | Highpass filter, thin sound |
| Modifier | Effect |
|---|---|
| cheap | Bitcrusher effect, lo-fi digital |
| expensive | Reverb effect, spacious sound |
| processed | Chorus effect, thick texture |
| industrial | Distortion effect, harsh tone |
| overpriced | Phaser effect, swirling motion |
| vomit | Chebyshev waveshaper, extreme distortion |
| artisanal | Tremolo effect, amplitude wobble |
| bargain | Feedback delay, echoing repeats |
| luxury | Long reverb, premium space |
| artificial | Vibrato effect, pitch wobble |
| mass-produced | Heavy bitcrusher, ultra lo-fi |
| addictive | Ping-pong delay, stereo bounce |
| packaged | Rhythmic tremolo with filter |
| glass | Shimmering echo effect |
[0] add fresh expensive wine // High pitch wine with reverb
[1] add old industrial ham // Low pitch ham with distortion
[2] add cheap processed cheese // Bitcrushed cheese with chorus
Change the musical key of a product.
[0] add beer nutriscore A // Beer in key of A
[1] add salad nutriscore C // Salad in key of C
Available keys: A, B, C, D, E
Control how long each note plays.
| Value | Duration |
|---|---|
| shelflife today | Very short (32n) |
| shelflife week | Short (16n) |
| shelflife month | Medium (8n) |
| shelflife year | Long (4n) |
| shelflife forever | Very long (1n) |
Create arpeggiated patterns.
[0] add beer escalator up fast
[1] add wine escalator bounce slow
Patterns: up, down, bounce, zigzag, express, checkout
Speeds: slow, normal, fast, rush, broken
[0] add beer volume loud
[1] add wine volume 50 // 0-100 scale
[2] add cheese volume mute
Presets: max, loud, soft, quiet, whisper, min, mute
Products marked as "open" play unpredictably (~60% of the time).
[0] add open beer
The shopping cart provides drum patterns. Different wheel types create different rhythms.
my cart has [type] wheels
| Wheel Type | Rhythm Style |
|---|---|
| square | Steady 4/4 beat |
| broken | Glitchy irregular rhythm |
| premium | Smooth swing rhythm |
| defective | Chaotic polyrhythm |
| bargain | Simple minimal beat |
| luxury | Complex jazz rhythm |
| heavy | Kick-heavy techno pattern |
| chrome | Crisp digital beats |
| turbo | Fast breakbeat rhythm |
| plastic | Synthetic artificial drums |
| wobbly | Dubstep wobble bass |
| squeaky | Hi-hat focused shuffle |
| rubber | Bouncy funk rhythm |
| smooth | Liquid drum'n'bass flow |
| rusty | Industrial metallic |
| vintage | Classic 808/909 |
| stolen | Erratic unpredictable |
| golden | Luxurious trap hi-hats |
| no | No rhythm (stops drums) |
Modes apply effects to all sounds globally.
[mode] mode on/off
| Mode | Effect |
|---|---|
| discount | Detunes everything slightly - unstable, lo-fi feel |
| inflation | Pitch gradually shifts upward over time |
| consumerism | Adds delays and echo to everything |
| black_friday | Chaotic distortion and random volume changes |
checkout // Start recording
finish checkout // Stop and save recording
Apply seasonal audio themes to all products.
season halloween // Spooky effects
season christmas // Festive holiday
season summer // Bright vibes
season winter // Cold crisp sounds
season easter // Bouncy spring
season valentines // Romantic ambience
season normal // Reset to default
Text-to-speech PA system announcements.
announcement cleanup // "Cleanup on aisle 3"
announcement closing // "Store closing soon"
announcement sale // Special offer
announcement [text] // Custom message
rush hour on // Tempo increases frantically
rush hour off // Return to normal
apply coupon BOGO // Buy one get one - duplicates products
apply coupon 50OFF // Half speed
apply coupon FREESHIP // Spacious reverb
apply coupon VIP // Luxury effects
decay on // Products gradually expire
decay off // Stop decay
preserve beer // Protect specific product from decay
spoil all // Instantly spoil all products
it's closing time // Speed up tempo
it's opening time // Slow down tempo
scan barcode 123456 // Generate products from digits
store layout // Open spatial view
map compose // Spatial sequencer mode
| Command | Effect |
|---|---|
| checkout line | Fade to silence |
| lunch break | Drums stop, music softens |
| lunch break off | Resume full energy |
| store closing | Everything fades away |
| cleanup time | Only muzak remains |
| intermission | Pause briefly |
| coffee break | Quick fade out/in |
| smoke break | Step outside briefly |
| Command | Effect |
|---|---|
| conveyor belt | Products roll in sequence |
| conveyor belt fast/slow | Speed variants |
| sliding doors | Stereo pan sweep |
| elevator music | Muffled distant sound |
| smooth transition | Crossfade between groups |
| fade to silence | Gradual fade to quiet |
| fade to soft | Fade to background level |
| fade to full | Fade to full volume |
| morph to [product] | Transform all products |
A risk/reward game mechanic for stealing products.
shoplift beer // Attempt to steal
steal chips // Alternative syntax
pocket candy // Another alternative
five finger discount wine
security level low // 30% catch rate
security level medium // 50% catch rate
security level high // 70% catch rate
security level paranoid // 95% catch rate
security chase on // Activate pursuit mode
security chase off // End the chase
shoplifting stats // View theft statistics
performance mode performance // Optimized for stability
performance mode quality // Maximum audio fidelity
performance mode balanced // Balance of both
performance stats // Show voice count and audio dropouts
A guided tutorial campaign that teaches you Rayon step by step.
story mode
Story mode takes you through progressive chapters that unlock features and teach the supermarket metaphor through narrative gameplay.
story mode again.
Certain product combinations trigger special effects:
| Combo | Products | Effect |
|---|---|---|
| Party | beer + chips | Friday night mode |
| Morning | milk + cereal | Morning routine |
| Jazz | wine + cheese | Sophisticated jazz |
| Lunch | bread + ham | Lunch break |
| Sugar Rush | energy_drink + candy | Hyperactive |
| Zen | oil + salad | Health conscious |