# interspecifics/rmr architecture

> Architecture diagram of the GitHub repository interspecifics/rmr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/interspecifics/rmr
- Repository: https://github.com/interspecifics/rmr

## Overview

#### Purpose and System Shape
RMR (“Recurrent Morphing Radio”) is an audio-art system spanning live audiovisual software, generated/curated radio streaming, a public site/player, and Max/MSP multichannel spatial-audio patches. The repository is a multi-runtime workspace rather than one deployable application.

#### Live Application
The desktop live component is an openFrameworks/C++ application. Its executable artifacts are under `rmr_live/bin/rmr2.exe`, with the primary source entry and app lifecycle in `rmr_live/src/main.cpp`, `rmr_live/src/ofApp.cpp`, and `rmr_live/src/ofApp.h`. A separate revised implementation exists in `rmr_live/src_update/ofApp.cpp`, with presentation/data objects in `rmr_live/src_update/Card.cpp` and `rmr_live/src_update/Styler.cpp`.

#### Radio Stream Assembly
`sound_lab/stream` constructs the broadcast program: playlist/sample selection, metadata/tagging, jingles, and stream-process commands. Core orchestration inputs are `sound_lab/stream/make_list.py`, `sound_lab/stream/chains.py`, `sound_lab/stream/four.liq`, and `sound_lab/stream/ffmpeg_commands.sh`. The Liquidsoap configuration is the likely runtime boundary that turns selected media into a continuous audio stream; FFmpeg is used for media processing. Station/program metadata is represented in `sound_lab/stream/db_14_3dot1.json`.

#### Generative Jukebox and Bot
The jukebox subsystem contains custom generation/filter hooks and prompt/audio assets: `sound_lab/jukebox/custom_sample.py`, `sound_lab/jukebox/custom_filters.py`, and `sound_lab/jukebox/prompts/21_l2/long/`. Identifier datasets under `sound_lab/jukebox/data/ids/genres_artists.js` and related artist/genre files connect selection logic to catalog metadata. `sound_lab/bot/rmr_bot.py` is a separate automation/client entry point, likely consuming status information via `sound_lab/bot/status-json.xsl`.

#### Public Web Experience
`rmr_site/index.html` is the primary browser entry point, supplemented by PHP pages such as `rmr_site/about-us.php` and `rmr_site/pro.php`. Browser behavior is concentrated in `rmr_site/assets/js/main.js`, audio/radio functions in `rmr_site/assets/js/radio.js` and `rmr_site/assets/js/stream-icy-meta.php`, and visualization/network logic in `rmr_site/assets/js/network.js`. The site is PHP-capable (`rmr_site/config.php`) and uses JavaScript libraries including Three.js and WaveSurfer, indicating a visual interactive player layered over stream playback and metadata retrieval.

#### Spatial Audio / Performance Patches
Max/MSP patchers provide performance-time audio slicing, resonant processing, and multichannel routing: `RMR_12CH/RMR_slicer_12ch.maxpat`, `RMR_12CH/p_resoncomb~.maxpat`, and `RMR_12CH/15chEsp_Interspecifics.maxpat`. Ambisonic trajectory experiments are separate patches under `trayectorias_ambisonics/primer_movimiento.maxpat`, `trayectorias_ambisonics/lissajous.maxpat`, and `trayectorias_ambisonics/shots.maxpat`. These form an external, real-time DSP boundary rather than being embedded in the web or C++ runtimes.

#### Main End-to-End Flow
Catalog IDs, prompts, and samples feed jukebox/custom selection; stream scripts assemble media, jingles, and metadata into a Liquidsoap/FFmpeg-managed radio output. The PHP/JavaScript site plays that stream and obtains ICY metadata for user-facing state and visualization. Independently, the openFrameworks application and Max/MSP patches support live visual/audio performance and multichannel presentation.

Main entry points: [`sound_lab/stream/four.liq`](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/four.liq) (Liquidsoap runtime), [`sound_lab/stream/db_14_3dot1.json`](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/db_14_3dot1.json) (Station metadata), [`rmr_site/index.html`](https://github.com/interspecifics/rmr/blob/master/rmr_site/index.html) (Public site pages), [`sound_lab/stream/make_list.py`](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/make_list.py) (Playlist builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_stream["Radio Stream Assembly"]
  node_playlist_builder["Playlist builder<br/>Python orchestration<br/>[make_list.py]"]
  node_stream_chains["Stream chains<br/>Python orchestration<br/>[chains.py]"]
  node_station_metadata[("Station metadata<br/>JSON metadata<br/>[db_14_3dot1.json]")]
  node_liquidsoap{{"Liquidsoap runtime<br/>stream configuration<br/>[four.liq]"}}
  node_ffmpeg["FFmpeg processing<br/>shell commands<br/>[ffmpeg_commands.sh]"]
  node_radio_output["Radio stream<br/>broadcast output"]
end

subgraph group_web["Public Web Experience"]
  node_site_pages["Public site pages<br/>HTML/PHP entry<br/>[index.html]"]
  node_site_runtime["PHP site runtime<br/>PHP configuration<br/>[config.php]"]
  node_player["Browser radio player<br/>JavaScript<br/>[radio.js]"]
  node_visualization["Interactive visualization<br/>JavaScript<br/>[network.js]"]
end

subgraph group_live["Live Performance"]
  node_of_app["openFrameworks app<br/>C++ application<br/>[ofApp.cpp]"]
  node_revised_live_ui["Revised live UI<br/>C++ implementation<br/>[ofApp.cpp]"]
  node_max_12ch["12-channel Max/MSP rig<br/>Max patcher"]
  node_ambisonic_paths["Ambisonic trajectories<br/>Max patcher"]
end

subgraph group_jukebox["Generative Jukebox"]
  node_catalog[("Catalog IDs<br/>metadata dataset<br/>[genres_artists.js]")]
  node_prompts["Prompt &amp; audio assets<br/>generation assets"]
  node_sample_hook["Custom sample hook<br/>Python module<br/>[custom_sample.py]"]
  node_filter_hook["Custom filters<br/>Python module<br/>[custom_filters.py]"]
end

node_bot["Automation bot<br/>Python client<br/>[rmr_bot.py]"]

node_catalog -->|"catalog context"| node_sample_hook
node_prompts -->|"generation inputs"| node_sample_hook
node_sample_hook -->|"candidate media"| node_filter_hook
node_filter_hook -->|"selected media"| node_playlist_builder
node_catalog -->|"IDs"| node_playlist_builder
node_playlist_builder -->|"playlist"| node_stream_chains
node_station_metadata -->|"tags"| node_stream_chains
node_stream_chains -->|"program assembly"| node_liquidsoap
node_ffmpeg -->|"media processing"| node_liquidsoap
node_station_metadata -->|"station metadata"| node_liquidsoap
node_liquidsoap -->|"broadcast"| node_radio_output
node_site_pages -->|"served by"| node_site_runtime
node_site_pages -->|"loads"| node_player
node_site_pages -->|"loads"| node_visualization
node_radio_output -->|"audio and ICY metadata"| node_player
node_player -->|"playback state"| node_visualization
node_station_metadata -.->|"status context"| node_bot
node_of_app -.->|"alternative implementation"| node_revised_live_ui
node_max_12ch -.->|"spatial performance experiments"| node_ambisonic_paths

click node_catalog "https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/data/ids/genres_artists.js"
click node_sample_hook "https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/custom_sample.py"
click node_filter_hook "https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/custom_filters.py"
click node_playlist_builder "https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/make_list.py"
click node_stream_chains "https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/chains.py"
click node_station_metadata "https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/db_14_3dot1.json"
click node_liquidsoap "https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/four.liq"
click node_ffmpeg "https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/ffmpeg_commands.sh"
click node_site_pages "https://github.com/interspecifics/rmr/blob/master/rmr_site/index.html"
click node_site_runtime "https://github.com/interspecifics/rmr/blob/master/rmr_site/config.php"
click node_player "https://github.com/interspecifics/rmr/blob/master/rmr_site/assets/js/radio.js"
click node_visualization "https://github.com/interspecifics/rmr/blob/master/rmr_site/assets/js/network.js"
click node_of_app "https://github.com/interspecifics/rmr/blob/master/rmr_live/src/ofApp.cpp"
click node_revised_live_ui "https://github.com/interspecifics/rmr/blob/master/rmr_live/src_update/ofApp.cpp"
click node_max_12ch "https://github.com/interspecifics/rmr/blob/master/RMR_12CH/RMR_slicer_12ch.maxpat"
click node_ambisonic_paths "https://github.com/interspecifics/rmr/blob/master/trayectorias_ambisonics/primer_movimiento.maxpat"
click node_bot "https://github.com/interspecifics/rmr/blob/master/sound_lab/bot/rmr_bot.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_playlist_builder,node_stream_chains,node_station_metadata,node_liquidsoap,node_ffmpeg,node_radio_output toneBlue
class node_site_pages,node_site_runtime,node_player,node_visualization toneAmber
class node_of_app,node_revised_live_ui,node_max_12ch,node_ambisonic_paths toneMint
class node_catalog,node_prompts,node_sample_hook,node_filter_hook toneRose
class node_bot toneNeutral
```

## Components

### Radio Stream Assembly

Builds the continuous broadcast program.

- [Playlist builder](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/make_list.py): Python orchestration · Selects program media and playlist inputs. · `sound_lab/stream/make_list.py`
- [Stream chains](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/chains.py): Python orchestration · Defines stream assembly chains. · `sound_lab/stream/chains.py`
- [Station metadata](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/db_14_3dot1.json): JSON metadata · `sound_lab/stream/db_14_3dot1.json`
- [Liquidsoap runtime](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/four.liq): stream configuration · Turns assembled media into continuous radio output. · `sound_lab/stream/four.liq`
- [FFmpeg processing](https://github.com/interspecifics/rmr/blob/master/sound_lab/stream/ffmpeg_commands.sh): shell commands · `sound_lab/stream/ffmpeg_commands.sh`
- **Radio stream**: broadcast output · Continuous audio plus ICY metadata.

### Public Web Experience

Browser player and public PHP site.

- [Public site pages](https://github.com/interspecifics/rmr/blob/master/rmr_site/index.html): HTML/PHP entry · `rmr_site/index.html`
- [PHP site runtime](https://github.com/interspecifics/rmr/blob/master/rmr_site/config.php): PHP configuration · `rmr_site/config.php`
- [Browser radio player](https://github.com/interspecifics/rmr/blob/master/rmr_site/assets/js/radio.js): JavaScript · Handles stream playback and ICY metadata. · `rmr_site/assets/js/radio.js`
- [Interactive visualization](https://github.com/interspecifics/rmr/blob/master/rmr_site/assets/js/network.js): JavaScript · Network and visual player behavior. · `rmr_site/assets/js/network.js`

### Live Performance

Independent audiovisual and spatial-audio runtimes.

- [openFrameworks app](https://github.com/interspecifics/rmr/blob/master/rmr_live/src/ofApp.cpp): C++ application · Desktop live audiovisual application lifecycle. · `rmr_live/src/ofApp.cpp`
- [Revised live UI](https://github.com/interspecifics/rmr/blob/master/rmr_live/src_update/ofApp.cpp): C++ implementation · Alternative card and styling implementation. · `rmr_live/src_update/ofApp.cpp`
- [12-channel Max/MSP rig](https://github.com/interspecifics/rmr/blob/master/RMR_12CH/RMR_slicer_12ch.maxpat): Max patcher · Slicing, resonant processing, and multichannel routing. · `RMR_12CH/RMR_slicer_12ch.maxpat`
- [Ambisonic trajectories](https://github.com/interspecifics/rmr/blob/master/trayectorias_ambisonics/primer_movimiento.maxpat): Max patcher · Spatial trajectory experiments. · `trayectorias_ambisonics/primer_movimiento.maxpat`

### Generative Jukebox

Generation inputs and custom selection hooks.

- [Catalog IDs](https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/data/ids/genres_artists.js): metadata dataset · `sound_lab/jukebox/data/ids/genres_artists.js`
- **Prompt & audio assets**: generation assets
- [Custom sample hook](https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/custom_sample.py): Python module · `sound_lab/jukebox/custom_sample.py`
- [Custom filters](https://github.com/interspecifics/rmr/blob/master/sound_lab/jukebox/custom_filters.py): Python module · `sound_lab/jukebox/custom_filters.py`

### Other components

- [Automation bot](https://github.com/interspecifics/rmr/blob/master/sound_lab/bot/rmr_bot.py): Python client · Separate status-aware automation entry point. · `sound_lab/bot/rmr_bot.py`

## Connections

- Catalog IDs → Custom sample hook: catalog context
- Prompt & audio assets → Custom sample hook: generation inputs
- Custom sample hook → Custom filters: candidate media
- Custom filters → Playlist builder: selected media
- Catalog IDs → Playlist builder: IDs
- Playlist builder → Stream chains: playlist
- Station metadata → Stream chains: tags
- Stream chains → Liquidsoap runtime: program assembly
- FFmpeg processing → Liquidsoap runtime: media processing
- Station metadata → Liquidsoap runtime: station metadata
- Liquidsoap runtime → Radio stream: broadcast
- Public site pages → PHP site runtime: served by
- Public site pages → Browser radio player: loads
- Public site pages → Interactive visualization: loads
- Radio stream → Browser radio player: audio and ICY metadata
- Browser radio player → Interactive visualization: playback state
- Station metadata → Automation bot: status context
- openFrameworks app → Revised live UI: alternative implementation
- 12-channel Max/MSP rig → Ambisonic trajectories: spatial performance experiments
