Usage
The easiest way to start is by exploring the software. If you prefer a traditional prepackaged web application approach, you can check out themes.
Alternatively, there's constituents which allows you to use any component from any theme interchangeably, each in a separate browser tab. Each tab talks to each other, so you can for example browse audio in one tab and play it in another.
The goal is for every user, no matter their experience with web software, to have agency over their software. One can start with making small changes and gradually progress to making big changes.
Demo
Diffuse is not your typical streaming service, you have to add sources of audio. This button here adds a few sample audio files.
Next, select any theme from below to play the audio. Or any of the other options suggested in the usage section.
Themes
Themes are element compositions and provide a traditional browser web application way of using them. In other words, pretty much the whole thing, besides your data, lives inside a single browser tab.
Each theme is unique, not just a skin; each one might have a totally different feature set.
-
[todo]
Blur
A theme with an Apple-inspired playback view. Features two audio players instead of the usual one.
-
[todo]
Loader
A theme that loads other themes! Load a theme from a URL, text snippet or from your user data output. If you're taking the first steps to customize, checkout the constituents loader first!
-
Webamp
Winamp 2 + Windows 98. Uses Webamp as the audio player connected to various Diffuse elements. Also features a desktop-like Windows 98 environment in which you can open "programs" that control the used Diffuse elements.
Constituents
Constituents are various interface components each loaded in their own web page. Every used component is configured so that it operates in broadcast mode, making all the pages communicate with each other.
It also allows non-browser web environments, such as WebViews, to display UI components separately. For example, to enable moveable web views on the desktop.
-
Blur / Artwork controller
Audio playback controller with artwork display.
-
Loader
Bring in other constituents! Load a constituent from a URL, text snippet or from your user data output.
-
Webamp / Browser
Collection browser + search in a retro, win98, look.
-
Webamp / Input Configurator
Windows 98 styled input configurator where you can add music sources.
Take control
Diffuse ranges from “eating out at a great restaurant” all the way to “making your favourite meal at home”
-
Level 1: Pick your restaurant, food comes in all shapes and sizes. The equivalent of choosing a Diffuse theme.
-
Level 2: Take out food from various places, eg. cheese shop + bakery. You choose how you combine the foods and from where you order them. That's constituents.
-
Level 3: Now that you know which food is good and how to make combinations, you might make a slight customization, add a little something of your own (eg. add some spice). However, you're not quite confident enough which spice to pick, so you hire some help.
This can be done using the constituents loader which allows you to build on top of a familiar preconfigured foundation and load custom constituents. People might share their own, or maybe you use an LLM to generate something for you (eg. an album art gallery).
-
Level 4: You learned a bit from watching and talking to the help you hired, so you decide to take things in your own hands.
You continue to use the constituents loader but learn a bit of HTML, Javascript and CSS; so you're able to write your own constituent.
-
Level 5: At this point you're confident enough to make a meal from scratch. You can start very simple, eg. just throwing a steak in the pan with some butter and some salt to it. Then later add some baked potatoes and go from there.
A similar tool comes into play here, the themes loader. Same concept as the constituents loader, but now you need to specify the foundation yourself. You can use the elements listed below to do so. The code for these is available from this website or through the Javascript package.
-
Level 6: You open your own restaurant.
You can host the theme you made on any web server, it's only HTML after all. Only difference is that you'll have to create the entire HTML tree, not just the body element, as is the case with the theme loader.
-
Level 7: You got promoted to master chef. Time to open your own restaurant chain.
You can self-host Diffuse, it's open-source! Or you present your own collection of elements.
Elements
The (web) components of the system. These custom elements are then recombined into an entire music player experience, or whatever you want to build.
Configurators
Elements that serve as an intermediate in order to make a particular kind of element configurable. In other words, these allow for an element to be swapped out with another that takes the same set of the actions and data output.
Engines
Elements with each a singular purpose and don't have any UI. There are specialised UI and orchestrator elements that control these.
Input
Inputs are sources of audio tracks. Each track is an entry in the list of possible items to play. These can be files or streams, static or dynamic.
-
Opensubsonic
Add any (open)subsonic server.
-
[todo]
HTTPS (Raw)
Enables usage of tracks with a HTTPS URI.
-
[todo]
HTTPS (JSON)
Generate tracks based on HTTPS servers that provide JSON (directory) listings.
-
S3
AWS S3 and services that provide the same surface API such as Cloudflare R2.
-
[todo]
Soundcloud
Add items from your Soundcloud feed.
-
[todo]
WebDAV
Add any WebDAV server.
Orchestrators
These too are element compositions. However, unlike themes, these are purely logical. Mostly exist in order to construct sensible defaults to use across themes and other compositions.
-
Input
A default input configuration. Contains all the inputs provided here.
-
Output
A default output configuration. Contains all the outputs provided here along with the relevant transformers.
-
Process inputs into tracks
Whenever the cached tracks are initially loaded through the passed output element it will list tracks by using the passed input element. Afterwards it loops over all tracks and checks if metadata needs to be fetched. If anything has changed, it'll pass the results to the output element.
-
Queue ⭤ Audio
Connects the given queue engine to the given audio engine.
-
Queue ⭤ Tracks
Sets the given queue element pool whenever the tracks signal from the given output changes.
-
Repeat & Shuffle
An opinionated way to setup repeat & shuffle.
-
Sources
Monitor tracks from the given output to form a list of sources based on the input's sources return value.
-
Search ⭤ Tracks
Supplies tracks to the given search processor whenever the tracks collection changes.
Output
Output is application-derived data such as playlists. These elements can receive such data and keep it around. These are categorised by the type of data they ingest, or many types in the case of polymorphic. Optionally use transformers to convert output into the expected format.
-
[todo]
Bytes / Automerge Repo
Sync with an Automerge repo sync server.
-
Polymorphic / IndexedDB
Stores output into the local indexedDB. Supports any type of data that indexedDB supports.
-
[todo]
Raw / AT Protocol
Store your user data on the storage associated with your ATProtocol identity. Data is lexicon shaped by default so this element takes in that data directly without any transformations.
Processors
These elements work with the output generated by the input elements to add more data to them, or process them in some other way.
-
Artwork
Fetches cover art for a given set of tracks, stored locally in indexedDB. Checks the audio metadata first, then MusicBrainz and uses Last.fm as the fallback.
-
Metadata
Fetch audio metadata for a given set of tracks, adding to the
Trackobject. -
Search
Provides a way to search through a collection of tracks, powered by orama.js
Supplements
Additional elements, such as scrobblers.
- [todo] Last.fm scrobbler
- [todo] ListenBrainz scrobbler
- [todo] Rocksky scrobbler
- [todo] Teal.fm scrobbler
Transformers
Transform data from one format or schema into another. See schema section below for more information. Just as configurators, these are intermediates and require to have the same set of actions as the element it targets.
-
Output / Bytes / Automerge
Translate data to and from an Automerge CRDT.
-
[todo]
Output / Bytes / Cambria lenses
Uses the Cambria library to seamlessly translate between data schemas so that no data migration is needed.
-
Output / Bytes / JSON
Raw data schema output ⇄ JSON Uint8Array.
-
Output / Refiner / Default
The task of a refiner transformer is to remove the output state that is not meant to be saved to storage. For example, ephemeral tracks; this transformer will keep them in memory, but they will not be present in the output. Ideally this is part of every theme, but you may swap it out with another transformer that might provide better defaults.
-
Output / String / JSON
Raw data schema output ⇄ JSON UTF8 string.
Definitions
All of the elements here are built with these data definitions in mind. That said, you can mix elements that use different definitions; you just have to put a transformer between them in order to translate between them, if needed.
-
Output / Constituent
Custom constituents to keep around.
-
[todo]
Output / Favourite
Indicate a user's favourite audio. Not a property of a track because tracks are associated with a specific source. Favourites may match with multiple tracks. Specified using the audio's title and artist.
-
[todo]
Output / Playlist
Just like favourites, does not refer to specific tracks. Unlike favourites, must also specify the album. Can also be considered a collection which is basically an unordered playlist.
-
[todo]
Output / Progress
Used to track progress of (long) audio playback.
-
[todo]
Output / Theme
Custom theme to keep around.
-
Output / Track
Represents audio that can be played, or a placeholder for a source of tracks. Contains a URI that will resolve to the audio. This object may be cached if convenient.