endless / lofi / faq
General
endless / lofi is an algorithmic music generator (no ai required!) that creates infinite, unique lofi beats in real-time. it constructs complete songs on-the-fly complete with chord progressions, basslines, melodies, harmonies, and drum patterns. each track is generated fresh when you hit play — you never hear the exact same song twice.
yes, enjoy infinite ad-free lofi ~ and it always will be ♫
if you would like to support my work, you are welcome to leave a tip :)
once a song has been played it cannot be replayed, this is by design — the goal of endless / lofi is to provide an infinite stream of lofi for you to consume in the moment: once you've heard a song, enjoy the experience of being the first and only person to have ever heard it.
from a technical standpoint: once a song has lapsed, its unique composition is discarded. if perhaps there is enough demand, i might be tempted to implement a native way to export to an .mp3 file
absolutely! everything produced by endless / lofi is free to use, for more information refer to the licensing page
when you first play a song, the application fetches some instrument samples (piano notes, bass, drums, etc.) and common lofi-themed sound effects (vinyl crackle, ambient sounds) as needed. these files are then cached to your browser for all future songs to use. after approximately ~8 songs, you'll have downloaded all the necessary audio files.
from that point forward, everything runs completely local — all music generation happens in your browser: no server calls, no streaming, no internet connection required. the app simply combines the cached audio samples in infinite new ways using procedural generation.
the inspiration for this project was primarily drawn from my desire to end "playlist fatigue" where after many years of seeking out and growing my personal lofi collection of playlists on spotify, i've reached a point where i have listened to every lofi song (for my taste) dozens of times and now when i'm studying, working, or just chilling with lofi always in the background, i can almost always identify the same song or the same playlist even with shuffle ~ (i consume a ridiculous amount of lofi throughout my day)
instead of hunting down a fresh new curated playlist that matches my taste and has a long enough run time that doesn't require manually switching to a new playlist every few hours, i landed on the idea of composing endless / lofi with a procedural music generation algorithm to match the surprisingly predictable pattern of lofi music.
while some musical patterns and structures repeat (as they do in lofi music naturally), you'll never hear the exact same song twice. no more playlist fatigue, no more searching for new tracks — just endless, fresh lofi beats on demand ♫
so if you're also going through playlist fatigue or just want a never-ending supply of fresh lofi, then i truly hope you enjoy listening!
Technical Details
The heart of the music generation is an algorithmic composition system, which creates complete, unique lofi tracks through a sophisticated five-phase procedural composition system.
Phase 1: Initialization & Configuration
First, we establish the song's fundamental characteristics:
- Tempo: Randomly selects a BPM between 60-90
- Swing: Applies subtle timing variation (e.g. chances of minimal swing vs. pronounced swing)
- Key: Picks one of 12 chromatic keys for the entire song
Phase 2: Sound Selection & Audio Routing
The generator assembles a unique "band" for each song by selecting instruments and textures:
-
Background Textures:
- Ambience - atmospheric sounds at random playback rates (0.8x-1.0x) and volume (-18 to -14 dB)
- Vinyl Crackle - classic lofi nostalgic texture also at a varying playback rate, -19 to -16 dB
-
Melodic Instruments:
- Chordal Instrument - randomly chosen from the likes of piano, rhodes, Mbira , synthesizer, marimba
- Lead Instrument - selected from a wider pool of instruments (e.g. guitar, piano, kalimba, synthesizer, đàn tranh , violin pizzicato, ukulele)
-
Bass: Selected based on tempo and whether bass ducking (sidechain compression) is enabled
- Drums: Kick, snare, and hi-hat sounds all routed through the master filter chain
Phase 3: Effect Chain Randomization
Each instrument passes through a sophisticated effects chain with randomized parameters to ensure every song has a unique sonic character:
-
Lead Effects:
- Reverb: Decay time (0.5-2.5 seconds), wet mix (10-50%)
- Delay/Echo: Eighth or quarter note timing, feedback (10-30%)
- Chorus: 2 or 4 Hz frequency, variable depth and wet mix
- High-pass Filter: Chance of 20 Hz (bypassed), or 300-1200 Hz (noticeable filtering)
- Chordal Effects: Similar chain with adjusted ranges (e.g., higher reverb wet mix at 10-65%)
-
Master Effects:
- Lowpass Filter: chance of full-range (20 kHz), or of muffled sound (6-14 kHz)
- Slow Vibrato: 0-25% depth at 0.6 Hz
- Fast Vibrato: 0-10% depth at 7 Hz
Phase 4: Musical Content Generation
Next, the core musical elements are composed:
-
Harmonic Foundation:
- Generates a chord progression in the selected key
- Determines if the progression plays at half-speed (bpm can dictate this)
- Creates rhythmic patterns for chord voicings
- Generates two different voicings of the same progression for variation
- Bass Lines: Creates both simple (root notes) and rhythmic (syncopated) patterns that follow the chord progression
- Melodic Content: Generates primary and alternate melody/harmony pairs by selecting notes from scales that harmonize with the current chords, considering musical intervals and phrase variation
-
Drum Patterns:
- Creates kick, snare, and hi-hat patterns with weighted probabilities
- Randomizes drum tuning using MIDI note ranges
- Generates "fills" (more complex patterns) for segment transitions, with shorter fills used for slower tempos
Phase 5: Song Structure & Scheduling
Finally, the function arranges everything into a complete composition:
-
Segment Definition: Creates 6 distinct segments with varying densities:
- Start (Bars 0-4): Sparse - chords 100%, melody 50%, partial drums, minimal bass
- Introduction (Bars 4-7/8): Building - adds full beat and bass
- Segment 1-4 (Bars 8-24): Full arrangement with randomized instrument combinations
- Random Repeat (Bars 24-28): Revisits Segment 1 or 2
- Outro (Bars 28-34): Returns to Introduction 1 or 2 for resolution
- Dynamic Arrangement: Segment lengths are sometimes randomized (3¾, 3½, or 4 bars) to prevent predictable structure
-
Automation:
- Ambience and vinyl crackle start at random offsets for unique texture on each playthrough
- Initial filter applied and removed over 4-8 bars
- Chance of adding a mid-song filter effect at bars 12, 16, 20, or 24
- Fade-out begins at bar ~28
Randomization Strategy
The key to creating varied yet coherent music is multi-layered randomization with musical constraints:
- Weighted Probabilities: Most selections use probability distributions rather than pure random (e.g., 75% simple, 25% complex)
- BPM-Dependent Logic: Slower tempos automatically use different bass instruments and simpler fills
- Contextual Randomization: Effect parameters are constrained to musically useful ranges
- Segment Variation: Alternating between defined segments with random lengths prevents repetitive structure
Performance & Efficiency
- Sample-Accurate Timing: All musical events scheduled via Tone.Transport for precise synchronization
- Minimal Runtime Overhead: Most computation happens during generation; playback is purely event-driven
- Consistent Duration: Fixed segment structure results in approximately 2 minutes per song at 60-90 BPM
All audio follows a carefully designed signal path
graph TB %% Individual Instrument Chains subgraph Chordal["Chordal Instrument Chain"] C1[Instrument] --> C2[Filter] --> C3[Chorus] --> C4[Delay] --> C5[Reverb] --> C6[Gain] end subgraph Lead["Lead Instrument Chain"] L1[Instrument] --> L2[Filter] --> L3[Chorus] --> L4[Delay] --> L5[Reverb] --> L6[Gain] end subgraph Bass["Bass Chain"] B1[Instrument] --> B2[Gain] end subgraph Other["Drums/Ambient/Vinyl"] O1[Samples] --> O2[Gain] end %% Master Chain subgraph Master["Master Chain"] M1[Master Filter] --> M2[Lowpass] --> M3[Vibrato Fast] --> M4[Vibrato Slow] --> M5[Gain] --> M6[Final Gain] --> M7[Limiter] --> M8[Output] end %% Connections to Master C6 --> M1 L6 --> M1 B2 --> M1 O2 --> M1
Use Mouse Scroll to zoom, hold Left Click to pan around
stateDiagram
direction TB
state "Chordal Chain" as Chordal {
direction LR
[*] --> CInstrument: Instrument
CInstrument --> CFilter: Filter
CFilter --> CChorus: Chorus
CChorus --> CDelay: Delay
CDelay --> CReverb: Reverb
CReverb --> CGain: Gain
CGain --> [*]
}
state "Lead Chain" as Lead {
direction LR
[*] --> LInstrument: Instrument
LInstrument --> LFilter: Filter
LFilter --> LChorus: Chorus
LChorus --> LDelay: Delay
LDelay --> LReverb: Reverb
LReverb --> LGain: Gain
LGain --> [*]
}
state "Bass Chain" as Bass {
direction LR
[*] --> BInstrument: Instrument
BInstrument --> BGain: Gain
BGain --> [*]
}
state "Drums/Ambient/Vinyl" as Other {
direction LR
[*] --> OSamples: Samples
OSamples --> OGain: Gain
OGain --> [*]
}
state "Master Chain" as Master {
direction LR
[*] --> MasterFilter: Master Filter
MasterFilter --> Lowpass: Lowpass
Lowpass --> VibratoFast: Vibrato (Fast)
VibratoFast --> VibratoSlow: Vibrato (Slow)
VibratoSlow --> MGain: Gain
MGain --> FinalGain: Final Gain
FinalGain --> Limiter: Limiter
Limiter --> Output: Output
Output --> [*]
}
Chordal --> Master
Lead --> Master
Bass --> Master
Other --> Master
The music production is built on music theory principles and probabilistic algorithms. Here's the technical breakdown:
Song Structure
-
Each song is ~34 bars long with a clear structure: intro sections (bars 0-8), main sections (bars 8-24), variations (bars 24-28), and outro (bars 28-34). The tempo is randomly chosen between 60-90 BPM, with swing timing applied for that characteristic lofi feel.
Chord Progressions
-
The core of every good lofi track is its chord progression (a sequence of chords that sound good together). Thankfully, lofi music often uses simple, repetitive progressions that are easy to generate algorithmically.
How it works:
-
Pick a Recipe: A function randomly selects one of several different 'recipes' for chord progressions. Some recipes are more common than others (e.g. type 1 may be picked 3 times more often) and each follow a proven pattern that sounds good in lofi music.
-
Build the Chord Sequence: Based on the recipe chosen, it adds 3-4 chords in a specific order; some examples of how this might look:
- Type 1: I - IV - I - IV
- Type 2: ii - V - I
- Type 3: I - vi - IV - V
For each chord position, it randomly picks a "flavor" like whether to use a basic chord, add a 7th note, flip the notes around, etc.
-
The Musical Theory Behind It:
All progressions assume the key of C major initially with roman numerals I, ii, iii, IV, V, vi representing scale positions:
- I - C major the "home" chord
- ii - D minor
- iii - E minor
- IV - F major
- V - G major
- vi - A minor
These are classic chord relationships that sound very satisfying together.
-
Convert to Numeric Keys
Finally, we convert our music theory (like C Major) into a numeric value that represents the actual note mapping to play — numbers represent semitones (
0=C, 1=C#, 2=D, ...)
-
Basslines
-
Two bass patterns are generated: a simple pattern (playing root notes) and a rhythmic pattern (more syncopated). The generator selects between different bass instruments based on tempo and whether bass ducking (sidechain compression on kick hits) is enabled.
Melodies & Harmonies
-
Melodies are algorithmically composed by selecting notes from scales that harmonize with the current chord. The algorithm considers musical intervals, creates phrases with variation, and applies probability-based note selection to ensure both coherence and unpredictability. Harmonies are generated separately to accompany the main melody.
Drums
-
Kick, snare, and hi-hat patterns are generated with weighted probabilities to create typical lofi drum grooves. The system also generates "fills" (more complex drum patterns) that occur at section transitions. Each drum sound is selected from a pool of 20+ samples.
Instruments & Synthesis
-
Instruments use sampled audio stored as .webm files. Each instrument has multiple note samples (e.g., C4, E4, G4) loaded into a Tone.js Sampler which interpolates between samples to play any note. The available instruments include acoustic piano, electric piano, guitar, ukulele, violin pizzicato, and various other common instrument notes found in lofi music.
Effects Processing
-
Audio passes through an effects chain including:
- Reverb: Adds space and depth
- Delay/Echo: Creates rhythmic echoes (8th or quarter note delays)
- Chorus: Adds warmth and thickness to the sound
- Filters: Highpass/lowpass filters that sweep in and out during the song
- Vibrato: Subtle pitch modulation for analog warmth
- Sidechain Compression: Bass and chords duck when the kick drum hits
All parameters are randomized within musically appropriate ranges.
Ambience Layer
-
Each song can also randomly include selected ambient sounds (e.g. vinyl crackle, subtle rain) played continuously in a background loop, adding to the lofi aesthetic.
Visualizer
-
The frontend visualizer uses the an audio motion analyzer to perform real-time FTT analysis of the audio signal, displaying frequency data as animated bars in a radial layout.
this application is built with:
- Tone.js - a comprehensive web audio framework for creating and scheduling music in the browser. Handles audio synthesis, sampling, effects processing, and precise timing.
- audiomotion-analyzer - a high-performance audio spectrum analyzer for creating the real-time frequency visualizer display.
- Web Audio API - the underlying browser API that Tone.js is built on, providing low-level audio processing capabilities.
- Cache API - browser storage API used to cache audio samples locally, allows for indefinite playback directly from cache when offline.
have any other questions, feedback, or want to chat?
endless / lofi / licensing
Creative Commons Attribution-ShareAlike 4.0 International
Copyright 2025 Skully
Any and all music produced by lofi.skully.tech is licensed under CC BY-SA 4.0, it allows reusers to distribute, remix, adapt, and build upon the material in any medium or format, even for commercial purposes. If others remix, adapt, or build upon the material, they must license the modified material under identical terms.
Section 3(a)(1)(A) of the license states that if you share the material (including in modified form), you must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. lofi.skully.tech waives the requirement for attribution and is not necessary in any use of the music, however you are free to give credit if you wish to do so by denoting as such:
- music by lofi.skully.tech / licensed under CC BY-SA 4.0
-
Credit or attribution is hereby waived by the creator and is not required
-
Adaptations must be shared under the same terms
CC BY-SA 4.0 License
Permissions
- Commercial use
- Modification
- Distribution
- Private use
Limitations
- No additional restrictions
- No warranties
Conditions
- Adaptations must be shared under the same terms