Two mood knobs: style and energy
In Without Streaming I made the controls like a mixing desk: one knob shifts the broadcast Jazz ⇄ Hip-hop, the other changes the energy Drifting ⇄ Driving.
The basis is deliberately simple and transparent: I tag tracks in Telegram (#J / #H / #JxH and #drift / #drive / #dd). An indexer collects this into playlist.json, and on a /playlist?mix=&energy= request the server rebuilds the track order. #JxH and #dd are tracks I myself consider mixed in style (Jazz×Hip-hop) and tracks of mixed energy (between drift and drive).
Then the code does a simple thing: it turns the slider positions into coefficients of “how much attention to give each side” and calculates the track’s final score. The higher the score, the higher the track rises in the /playlist output.
jazz_bias = 1.0 - hiphop_bias
drive_bias = energy / 100.0
drift_bias = 1.0 - drive_bias
score = jazz_bias * w_jazz + hiphop_bias * w_hiphop \
+ drift_bias * w_drift + drive_bias * w_drive
- mix and energy turn into *_bias coefficients: this is “how much influence” to give each side of the scale.
- w_jazz / w_hiphop / w_drift / w_drive are track weights derived from tags during indexing.
- score is the final rating: the higher it is, the sooner the track will be on air at the current settings.
Then an important engineering part comes in: to keep the broadcast from looping within a narrow category, the server first serves the “matching” tracks (and bridges), then mixes in the rest.
Why it’s not perfect yet: tags are subjective, two axes create many combinations, and “musically right” doesn’t always match “highest score”.
Auto modes (Auto Flow / Auto Energy) move the knobs smoothly and don’t break the current track; the effect shows on the next one. By the way, auto mode can be turned on right from the slider: press the “dot” (the slider) and it starts moving on its own.
In the next post I’ll go through the inner pipeline of Without Streaming: how the indexer builds playlist.json, how /playlist shapes the broadcast to the knobs, and how /audio streams media from Telegram chunked without saving to disk.