# ShredBlob Demo

OpenGL audio-reactive demo. This package includes the tuned preset `shredblob_tune_tt.json` and `mp3s/puux/MemoriesOfRain.mp3`.

## Requirements

On Debian/Ubuntu:

```bash
sudo apt-get install build-essential libglew-dev libsdl2-dev libmpg123-dev libglm-dev python3 python3-tk
```

You also need OpenGL drivers and a working desktop GL context.

## Build

```bash
make -f Makefile_shredbob
```

This builds `libaudioanalysis.a` (from `Makefile_mp3`) and the `shredblob` binary.

Optional offline analyzer for the phrase editor:

```bash
make -f Makefile_mp3 shredblob_analyze
```

## Run

Windowed mode with live control panel (recommended for tuning):

```bash
./shredblob shredblob_tune_tt.json -w
```

The preset's `mp3` field loads the bundled track automatically. Fullscreen:

```bash
./shredblob shredblob_tune_tt.json
```

Controls:
- **J** — skip to next narrative phase
- **Space** — pause/resume (windowed)
- **Esc** — quit

## Phrase / timing editor (optional)

```bash
python3 shredblob_phrase_editor.py mp3s/puux/MemoriesOfRain.mp3
```

Analyze the track, adjust phase timings, and save presets. Requires `shredblob_analyze` (see build step above).

## Files

| File | Purpose |
|------|---------|
| `shredblob.cpp` | Main demo |
| `shredblob_live.*` | Live tuning + preset loading |
| `mp3_player.*` | MP3 playback and analysis |
| `shredblob_tune_tt.json` | Tuned preset for this track |
| `mp3s/puux/MemoriesOfRain.mp3` | Audio track |
| `shredblob_controls.py` | Live GUI (windowed mode) |
| `shredblob_phrase_editor.py` | Offline timing editor |

## Clean

```bash
make -f Makefile_shredbob clean-all
```
