internal process dsp, skipping ladspa pipewire attempt, and reworked waveforms
This commit is contained in:
@@ -24,7 +24,7 @@ Terminal DJ suite — Rust + Ratatui + PipeWire graph DSP.
|
||||
│ PipeWire Graph │
|
||||
│ │
|
||||
│ djdeck.deck.a ──► input.djdeck.chain.a │
|
||||
│ [rubberband LADSPA] │
|
||||
│ [pitch → lpL/lpR → reverb] │
|
||||
│ output.djdeck.chain.a ──► default sink │
|
||||
│ │
|
||||
│ (same for z, s, x) │
|
||||
@@ -32,29 +32,55 @@ Terminal DJ suite — Rust + Ratatui + PipeWire graph DSP.
|
||||
```
|
||||
|
||||
Each deck stream outputs raw decoded PCM. The PipeWire graph handles all DSP:
|
||||
- **Pitch shifting** and **time stretching** — rubberband LADSPA via `libpipewire-module-filter-chain`
|
||||
- **Pitch shifting** — rubberband `Semitones` port (requires `ladspa-rubberband`)
|
||||
- **Cutoff filter** — `lowpass_iir` + `highpass_iir` (swh-plugins), `Cutoff Frequency` port:
|
||||
- Negative value → lowpass (kill highs), positive → highpass (kill lows), 0 → flat
|
||||
- **Reverb** — `plate` `Dry/wet mix` port (swh-plugins): 0=dry → 1=wet
|
||||
- **Volume (fader)** — `wpctl set-volume` on the stream node
|
||||
- **Pitch/Tempo params** — `pw-cli set-param <node-id> Props '{ params = [...] }'`
|
||||
- **Tempo** — varispeed in audio engine; rubberband compensates pitch automatically
|
||||
|
||||
## Dependencies
|
||||
|
||||
### System
|
||||
|
||||
**Required:**
|
||||
```bash
|
||||
# Arch
|
||||
pacman -S pipewire wireplumber pipewire-audio ladspa rubberband
|
||||
|
||||
# Ubuntu / Debian
|
||||
apt install pipewire wireplumber pipewire-audio ladspa-sdk rubberband-ladspa
|
||||
apt install pipewire wireplumber ladspa-sdk rubberband-ladspa
|
||||
|
||||
# Fedora
|
||||
dnf install pipewire wireplumber ladspa rubberband-ladspa
|
||||
```
|
||||
|
||||
**Required** (cutoff + reverb):
|
||||
```bash
|
||||
# Arch
|
||||
pacman -S swh-plugins
|
||||
|
||||
# Ubuntu / Debian
|
||||
apt install swh-plugins
|
||||
|
||||
# Fedora
|
||||
dnf install swh-plugins
|
||||
```
|
||||
|
||||
Verify the rubberband LADSPA plugin is present:
|
||||
```bash
|
||||
analyseplugin ladspa-rubberband.so
|
||||
# should list labels including: rubberband_pitchshifter_stereo
|
||||
python3 -c "
|
||||
import ctypes; lib = ctypes.CDLL('/usr/lib/ladspa/ladspa-rubberband.so')
|
||||
lib.ladspa_descriptor.restype = ctypes.c_void_p
|
||||
class D(ctypes.Structure):
|
||||
_fields_ = [('uid',ctypes.c_ulong),('label',ctypes.c_char_p),('props',ctypes.c_int),('name',ctypes.c_char_p)]
|
||||
i=0
|
||||
while True:
|
||||
d=lib.ladspa_descriptor(i)
|
||||
if not d: break
|
||||
print(ctypes.cast(d,ctypes.POINTER(D)).contents.label.decode()); i+=1
|
||||
"
|
||||
# should include: rubberband-pitchshifter-stereo
|
||||
```
|
||||
|
||||
### Rust
|
||||
@@ -77,10 +103,11 @@ cargo build --release
|
||||
Logs → `/tmp/djdeck.log`. Set `RUST_LOG=debug` for verbose output.
|
||||
|
||||
On startup djdeck will:
|
||||
1. Load `libpipewire-module-filter-chain` for each deck (rubberband LADSPA)
|
||||
2. Start 4 PipeWire playback streams, each targeting its filter-chain sink
|
||||
1. Start 4 PipeWire playback streams, each targeting its filter-chain sink
|
||||
2. Load `libpipewire-module-filter-chain` for each deck via `pw-cli load-module` (pitch → lpL/lpR → reverb)
|
||||
3. Wait 800ms for PipeWire to settle, then resolve node IDs via `pw-dump`
|
||||
4. Start the TUI and OSC server
|
||||
4. Explicitly link each chain's output to the default sink via `pw-link -L`
|
||||
5. Start the TUI and OSC server
|
||||
|
||||
Node IDs for each deck are shown in the deck panel title: `[pw:stream/filter]`.
|
||||
|
||||
@@ -96,8 +123,10 @@ Node IDs for each deck are shown in the deck panel title: `[pw:stream/filter]`.
|
||||
| `c` | Set cue point |
|
||||
| `v` | Jump to cue point |
|
||||
| `↑ / ↓` | Fader ±5% (via `wpctl set-volume`) |
|
||||
| `[ / ]` | Pitch ±0.5 semitones (via `pw-cli`, rubberband) |
|
||||
| `, / .` | Tempo ±1% (via `pw-cli`, rubberband) |
|
||||
| `[ / ]` | Pitch ±0.5 semitones (rubberband `Semitones` port) |
|
||||
| `, / .` | Tempo ±1% (varispeed; rubberband compensates pitch) |
|
||||
| `- / =` | Cutoff ±500 (negative=LP kills highs, positive=HP kills lows, 0=flat) |
|
||||
| `o / p` | Reverb wet ±5% (requires swh-plugins) |
|
||||
| `q` | Quit (unloads filter-chain modules) |
|
||||
|
||||
**File selector:** type to filter, `↑/↓` navigate, `Enter` load, `Esc` cancel.
|
||||
|
||||
Reference in New Issue
Block a user