diff --git a/README.md b/README.md new file mode 100644 index 0000000..354ee23 --- /dev/null +++ b/README.md @@ -0,0 +1,174 @@ +# Music Production Setup + +This repository holds scripts, patch banks, sound resources, and notes for a +Linux-based music production setup. + +The current direction is a PipeWire-based system centered around Bitwig Studio. +Older QJackCtl patchbay files, Jack Rack presets, and JACK startup/recording +scripts are being removed from the working tree, but the migration is recorded +below so the old setup can still be recovered from Git history. + +## Current Contents + +- `scripts/set-pipewire-latency.sh` - helper for checking, forcing, and clearing + PipeWire graph quantum/rate metadata. +- `sounds.txt` - notes about useful electric piano, piano, brass, pad, organ, + string, mallet, and synth sounds. +- `soundfounts/` - archived SoundFont resources. +- `yoshimi-patches/` - archived Yoshimi banks and patch collections. + +## PipeWire And Bitwig Studio + +The new setup should prefer PipeWire as the shared audio graph instead of +manually starting JACK through QJackCtl profiles and wiring sessions with +QJackCtl patchbays. + +For standalone low-latency work outside the DAW, use: + +```sh +scripts/set-pipewire-latency.sh status +scripts/set-pipewire-latency.sh on 128 48000 +scripts/set-pipewire-latency.sh off +``` + +The script writes PipeWire settings metadata with `pw-metadata -n settings`. +`on` defaults to a quantum of `128` at `48000` Hz, which is about 2.7 ms per +block. `off` clears `clock.force-quantum` and `clock.force-rate` so PipeWire +can return to normal behavior. + +This override is not expected to be necessary when working in Bitwig Studio. +Bitwig is the DAW for the new workflow, so latency should normally be handled +inside that DAW/session rather than forced globally through this helper. + +## Legacy JACK Migration Notes + +The mainline branch in this checkout is named `main`. At the time these +legacy files were staged for deletion, the current `main` / `origin/main` +commit was: + +```text +ee169b0e013496b177195a6719295b40f9c932dd +``` + +That commit is the last mainline commit where the old QJackCtl, Jack Rack, and +script-based JACK workflow is available. To inspect one of the removed files: + +```sh +git show ee169b0e013496b177195a6719295b40f9c932dd: +``` + +### Files Staged For Deletion + +```text +jack-rack-presets/home/fender-jazz +jack-rack-presets/home/headphones +jack-rack-presets/home/sr505zw +jack-rack-presets/newlife/bass2 +jack-rack-presets/newlife/drums +jack-rack-presets/newlife/headphones +jack-rack-presets/newlife/headphones2 +jack-rack-presets/newlife/m48-mix +jack-rack-presets/newlife/yamaha-trb +jack-rack-presets/onboard/headphones +jack-rack-presets/onboard/sg200 +jack-rack-presets/onboard/sr505zw +jack-rack-presets/onboard/yamaha-trb +qjackctl-routing-settings/FastTrack-Practice.xml +qjackctl-routing-settings/K6-Bass+System.xml +qjackctl-routing-settings/church-eq-bass-with-synth.xml +qjackctl-routing-settings/church-eq-mix-ears-only.xml +qjackctl-routing-settings/church-eq-mix-splitchannel-with-headphone-mix.xml +qjackctl-routing-settings/church-eq-mix-splitchannel.xml +qjackctl-routing-settings/church-eq-mix.xml +qjackctl-routing-settings/church-eq-two-bass-setup.xml +qjackctl-routing-settings/keyboard-qsynth.xml +qjackctl-routing-settings/maudio-fasttrack.xml +qjackctl-routing-settings/onboard.xml +qjackctl-routing-settings/studio.xml +scripts/nl-prepare-raw-files-synth.sh +scripts/nl-prepare-raw-files.sh +scripts/nl-rec +scripts/nl-rec-1 +scripts/nl-rec-service +scripts/nl-rec-service-synth +scripts/nl-split-rec +scripts/start-church-session +scripts/start-church-session-bass-with-synth +scripts/start-church-session-two-bassists +scripts/start-home-session +scripts/start-onboard-session +``` + +### Jack Rack Presets + +The `jack-rack-presets/` files were gzip-compressed Jack Rack XML presets at +48 kHz. They store LADSPA plugin IDs, enabled/disabled state, wet/dry settings, +and raw control values. + +- `home/` contained home practice chains for Fender Jazz bass, SR505ZW bass, + and headphones. +- `onboard/` contained onboard audio chains for headphones, SG200, SR505ZW, + and Yamaha TRB bass. +- `newlife/` contained New Life church chains for Yamaha TRB bass, a second + bass, M48 mix, drums, and one or two headphone mixes. + +The bass presets were mono chains for instrument tone/level processing. The +headphone, M48, and drum presets were stereo or monitor-oriented chains used by +the old patchbay and session launcher scripts. + +### QJackCtl Patchbays + +The `qjackctl-routing-settings/` XML files were QJackCtl patchbay definitions. +They described JACK and MIDI clients, expected ports, and cables to restore +session routing. + +- `FastTrack-Practice.xml` routed a FastTrack practice setup with bass through + Jack Rack, Hydrogen, QSynth, PulseAudio JACK sink/source, and meters. +- `K6-Bass+System.xml` routed a Komplete Audio 6 setup with Jack Rack, + PulseAudio JACK, zita-at1, bridge meters, and MIDI control. +- `maudio-fasttrack.xml` routed FastTrack bass/headphones/QSynth practice use, + including zita-at1, meters, and a JACK-to-ALSA MIDI bridge. +- `keyboard-qsynth.xml` connected Oxygen 61 and jack-keyboard MIDI into + QSynth, with system and PulseAudio JACK audio routing. +- `onboard.xml` connected QSynth, MDA ePiano, jack-keyboard, Alesis Recital, + LPK25, a2j/ALSA MIDI, PulseAudio JACK, and headphone routing. +- `studio.xml` routed a studio setup with bass, mic, MDA ePiano, Alesis + Recital, LPK25, meter ports, and system outputs. +- `church-eq-mix.xml`, `church-eq-mix-ears-only.xml`, + `church-eq-mix-splitchannel.xml`, + `church-eq-mix-splitchannel-with-headphone-mix.xml`, + `church-eq-two-bass-setup.xml`, and + `church-eq-bass-with-synth.xml` described New Life church routings for bass, + M48 mix/drum feeds, monitors, meters, tuner input, second-bass variants, and + synth/MDA ePiano variants. + +### Legacy Scripts + +The removed scripts were tightly coupled to JACK client names, QJackCtl +profiles, Jack Rack session names, and specific capture/playback ports. + +- `start-home-session` started QJackCtl profile `Onboard48K`, loaded home bass + and headphone Jack Rack presets, and started `j2amidi_bridge`. +- `start-onboard-session` started QJackCtl profile `Onboard48K` and loaded + onboard Yamaha TRB and headphone Jack Rack presets. +- `start-church-session` started QJackCtl profile `Church48K`, loaded New Life + bass, M48 mix, drums, and headphone Jack Rack presets, started `meterbridge`, + and ran `devilspie`. +- `start-church-session-bass-with-synth` extended the church session with + `yoshimi`, `a2jmidid`, and separate bass/M48 meter bridges. +- `start-church-session-two-bassists` extended the church session with second + bass and second headphone Jack Rack chains plus separate meters. +- `nl-rec` recorded three JACK capture ports with `jack_capture`. +- `nl-rec-1` recorded the sermon channel from `system:capture_3`. +- `nl-rec-service` recorded worship, sermon, and altar files from the church + capture ports. +- `nl-rec-service-synth` recorded the same service files while also capturing + Yoshimi left/right outputs. +- `nl-split-rec` split one `.wavex` file into M48, drums, and bass WAV files. +- `nl-prepare-raw-files.sh` split `worship.wavex` and `altar.wavex` into M48, + drums, and bass WAV files with `ffmpeg`. +- `nl-prepare-raw-files-synth.sh` did the same split while also extracting + synth left/right WAV files. + +These files document the old JACK-era workflow but are no longer the active +direction for this repository. diff --git a/jack-rack-presets/home/fender-jazz b/jack-rack-presets/home/fender-jazz deleted file mode 100644 index c05b396..0000000 Binary files a/jack-rack-presets/home/fender-jazz and /dev/null differ diff --git a/jack-rack-presets/home/headphones b/jack-rack-presets/home/headphones deleted file mode 100644 index 6cce44d..0000000 Binary files a/jack-rack-presets/home/headphones and /dev/null differ diff --git a/jack-rack-presets/home/sr505zw b/jack-rack-presets/home/sr505zw deleted file mode 100644 index e97ea97..0000000 Binary files a/jack-rack-presets/home/sr505zw and /dev/null differ diff --git a/jack-rack-presets/newlife/bass2 b/jack-rack-presets/newlife/bass2 deleted file mode 100644 index 2037917..0000000 Binary files a/jack-rack-presets/newlife/bass2 and /dev/null differ diff --git a/jack-rack-presets/newlife/drums b/jack-rack-presets/newlife/drums deleted file mode 100644 index 0ae1f6e..0000000 Binary files a/jack-rack-presets/newlife/drums and /dev/null differ diff --git a/jack-rack-presets/newlife/headphones b/jack-rack-presets/newlife/headphones deleted file mode 100644 index 714d612..0000000 Binary files a/jack-rack-presets/newlife/headphones and /dev/null differ diff --git a/jack-rack-presets/newlife/headphones2 b/jack-rack-presets/newlife/headphones2 deleted file mode 100644 index 1a627eb..0000000 Binary files a/jack-rack-presets/newlife/headphones2 and /dev/null differ diff --git a/jack-rack-presets/newlife/m48-mix b/jack-rack-presets/newlife/m48-mix deleted file mode 100644 index 9523f0c..0000000 Binary files a/jack-rack-presets/newlife/m48-mix and /dev/null differ diff --git a/jack-rack-presets/newlife/yamaha-trb b/jack-rack-presets/newlife/yamaha-trb deleted file mode 100644 index d32d507..0000000 Binary files a/jack-rack-presets/newlife/yamaha-trb and /dev/null differ diff --git a/jack-rack-presets/onboard/headphones b/jack-rack-presets/onboard/headphones deleted file mode 100644 index dac72e0..0000000 Binary files a/jack-rack-presets/onboard/headphones and /dev/null differ diff --git a/jack-rack-presets/onboard/sg200 b/jack-rack-presets/onboard/sg200 deleted file mode 100644 index 5ce9c7d..0000000 Binary files a/jack-rack-presets/onboard/sg200 and /dev/null differ diff --git a/jack-rack-presets/onboard/sr505zw b/jack-rack-presets/onboard/sr505zw deleted file mode 100644 index e97ea97..0000000 Binary files a/jack-rack-presets/onboard/sr505zw and /dev/null differ diff --git a/jack-rack-presets/onboard/yamaha-trb b/jack-rack-presets/onboard/yamaha-trb deleted file mode 100644 index 3108d02..0000000 Binary files a/jack-rack-presets/onboard/yamaha-trb and /dev/null differ diff --git a/qjackctl-routing-settings/FastTrack-Practice.xml b/qjackctl-routing-settings/FastTrack-Practice.xml deleted file mode 100644 index 75e58ff..0000000 --- a/qjackctl-routing-settings/FastTrack-Practice.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - capture_1 - - - capture_2 - - - out_1 - - - out_L - - - out_R - - - l_00 - - - r_00 - - - Midi Through Port-0 - - - front-left - - - front-right - - - - - playback_1 - - - playback_2 - - - in_1 - - - Midi Through Port-0 - - - meter_1 - - - meter_2 - - - front-left - - - front-right - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/K6-Bass+System.xml b/qjackctl-routing-settings/K6-Bass+System.xml deleted file mode 100644 index 42ae872..0000000 --- a/qjackctl-routing-settings/K6-Bass+System.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - capture_1 - capture_2 - capture_3 - capture_4 - capture_5 - capture_6 - - - front-left - front-right - - - out_1 - out_2 - - - out_1 - out_2 - - - monitor_1 - monitor_2 - - - out - - - out_1 - out_1 - - - Midi Through Port-0 - - - Komplete Audio 6 MIDI 1 - - - Control - Control - - - - - playback_1 - playback_2 - playback_3 - playback_4 - playback_5 - playback_6 - - - front-left - front-right - - - in_1 - in_2 - - - in_1 - in_2 - - - meter_1 - meter_2 - - - in - - - pitch - - - Midi Through Port-0 - - - Komplete Audio 6 MIDI 1 - - - Control - Control - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-bass-with-synth.xml b/qjackctl-routing-settings/church-eq-bass-with-synth.xml deleted file mode 100644 index fd49b7a..0000000 --- a/qjackctl-routing-settings/church-eq-bass-with-synth.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - capture_1 - - - out_1 - - - out_1 - - - out_2 - - - capture_3 - - - capture_4 - - - out_1 - - - out_1 - - - left - - - right - - - left_out - - - right_out - - - LPK25 MIDI 1 - - - Midi Through \[14\] \(capture\): Midi Through Port-0 - - - - - in_1 - - - playback_3 - - - meter_1 - - - meter_2 - - - meter_3 - - - in_1 - - - in_2 - - - playback_1 - - - playback_2 - - - meter_4 - - - in_1 - - - in_1 - - - meter_1 - - - meter_2 - - - in - - - Midi Through Port-0 - - - midi in - - - event_in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-mix-ears-only.xml b/qjackctl-routing-settings/church-eq-mix-ears-only.xml deleted file mode 100644 index ac5f41a..0000000 --- a/qjackctl-routing-settings/church-eq-mix-ears-only.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - capture_1 - - - capture_3 - - - capture_4 - - - out_1 - - - out_1 - - - out_1 - - - out_2 - - - - - meter_1 - - - meter_2 - - - playback_3 - - - in_1 - - - in_1 - - - in_2 - - - playback_1 - - - playback_2 - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-mix-splitchannel-with-headphone-mix.xml b/qjackctl-routing-settings/church-eq-mix-splitchannel-with-headphone-mix.xml deleted file mode 100644 index f13512a..0000000 --- a/qjackctl-routing-settings/church-eq-mix-splitchannel-with-headphone-mix.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - out_1 - - - out_2 - - - capture_1 - - - capture_2 - - - out_1 - - - out_2 - - - out_1 - - - out_1 - - - out_1 - - - out_2 - - - capture_3 - - - capture_4 - - - out_1 - - - out_2 - - - - - in_1 - - - in_2 - - - in_1 - - - in_2 - - - meter_5 - - - in - - - playback_3 - - - in_1 - - - in_1 - - - meter_1 - - - meter_2 - - - playback_1 - - - playback_2 - - - in_1 - - - in_2 - - - in_1 - - - in_2 - - - meter_3 - - - meter_4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-mix-splitchannel.xml b/qjackctl-routing-settings/church-eq-mix-splitchannel.xml deleted file mode 100644 index cf0ebf3..0000000 --- a/qjackctl-routing-settings/church-eq-mix-splitchannel.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - capture_1 - - - out_1 - - - out_2 - - - out_1 - - - out_1 - - - capture_3 - - - capture_4 - - - out_1 - - - out_2 - - - - - in - - - playback_3 - - - in_1 - - - meter_1 - - - meter_2 - - - playback_1 - - - playback_2 - - - in_1 - - - in_2 - - - in_1 - - - in_2 - - - meter_3 - - - meter_4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-mix.xml b/qjackctl-routing-settings/church-eq-mix.xml deleted file mode 100644 index c2b4fe8..0000000 --- a/qjackctl-routing-settings/church-eq-mix.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - capture_1 - - - out_1 - - - out_1 - - - capture_3 - - - capture_4 - - - out_1 - - - out_2 - - - - - in - - - playback_3 - - - in_1 - - - meter_1 - - - meter_2 - - - playback_1 - - - playback_2 - - - in_1 - - - in_2 - - - meter_3 - - - meter_4 - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/church-eq-two-bass-setup.xml b/qjackctl-routing-settings/church-eq-two-bass-setup.xml deleted file mode 100644 index 3a91f9c..0000000 --- a/qjackctl-routing-settings/church-eq-two-bass-setup.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - capture_1 - - - out_1 - - - out_1 - - - out_2 - - - capture_2 - - - out_1 - - - out_1 - - - out_2 - - - capture_3 - - - capture_4 - - - out_1 - - - out_1 - - - - - in_1 - - - meter_1 - - - meter_2 - - - in_1 - - - in_2 - - - playback_1 - - - playback_2 - - - meter_3 - - - in_1 - - - meter_1 - - - meter_2 - - - in_1 - - - in_2 - - - playback_3 - - - playback_4 - - - meter_3 - - - in_1 - - - in_1 - - - meter_1 - - - meter_2 - - - in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/keyboard-qsynth.xml b/qjackctl-routing-settings/keyboard-qsynth.xml deleted file mode 100644 index 7450deb..0000000 --- a/qjackctl-routing-settings/keyboard-qsynth.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Oxygen 61 MIDI 1 - - - capture_1 - capture_2 - - - front-left - front-right - - - l_00 - r_00 - - - midi_out - - - Midi Through Port-0 - - - - - playback_1 - playback_2 - playback_3 - playback_4 - - - front-left - front-right - - - midi_in - - - midi - - - Synth input port \([0-9]+:0\) - - - Midi Through Port-0 - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/maudio-fasttrack.xml b/qjackctl-routing-settings/maudio-fasttrack.xml deleted file mode 100644 index 61a6a7b..0000000 --- a/qjackctl-routing-settings/maudio-fasttrack.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - capture_2 - - - out_1 - - - out_1 - - - out_2 - - - l_00 - - - r_00 - - - midi_out - - - capture - - - - - in_1 - - - in_2 - - - in_1 - - - meter_1 - - - meter_2 - - - meter_3 - - - meter_4 - - - playback_1 - - - playback_2 - - - in - - - playback - - - Synth input port \([0-9]+:0\) - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/onboard.xml b/qjackctl-routing-settings/onboard.xml deleted file mode 100644 index 143d800..0000000 --- a/qjackctl-routing-settings/onboard.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - out_1 - - - out_2 - - - l_00 - - - r_00 - - - left_out - - - right_out - - - midi_out - - - Midi Through Port-0 - - - Midi Through \[14\] \(capture\): Midi Through Port-0 - - - LPK25 MIDI 1 - - - Alesis Recital MIDI 1 - - - front-left - - - front-right - - - - - in_1 - - - in_2 - - - in_1 - - - playback_1 - - - playback_2 - - - Midi Through Port-0 - - - Midi Through \[14\] \(playback\): Midi Through Port-0 - - - Synth input port \([0-9]+:0\) - - - event_in - - - - - - - - - - - - - - - - - - - - - - diff --git a/qjackctl-routing-settings/studio.xml b/qjackctl-routing-settings/studio.xml deleted file mode 100644 index b85628c..0000000 --- a/qjackctl-routing-settings/studio.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - capture_2 - - - out_1 - - - capture_1 - - - left_out - - - right_out - - - Alesis Recital MIDI 1 - - - LPK25 MIDI 1 - - - Midi Through \[14\] \(capture\): Midi Through Port-0 - - - - - in_1 - - - meter_1 - - - meter_2 - - - meter_3 - - - playback_1 - - - playback_2 - - - Midi Through Port-0 - - - event_in - - - - - - - - - - - - - - - - - - diff --git a/scripts/nl-prepare-raw-files-synth.sh b/scripts/nl-prepare-raw-files-synth.sh deleted file mode 100755 index c9d46aa..0000000 --- a/scripts/nl-prepare-raw-files-synth.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -for filename in worship.wavex altar.wavex; do - name=${filename%.wavex} - ffmpeg -i "$filename" -filter_complex 'channelsplit=channel_layout=4.1[L][R][B][X][Y]' \ - -map '[L]' "${name}-m48.wav" \ - -map '[R]' "${name}-drums.wav" \ - -map '[X]' "${name}-synth-L.wav" \ - -map '[Y]' "${name}-synth-R.wav" \ - -map '[B]' "${name}-bass.wav" -done diff --git a/scripts/nl-prepare-raw-files.sh b/scripts/nl-prepare-raw-files.sh deleted file mode 100755 index 52e8696..0000000 --- a/scripts/nl-prepare-raw-files.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -for filename in worship.wavex altar.wavex; do - name=${filename%.wavex} - ffmpeg -i "$filename" -filter_complex 'channelsplit=channel_layout=2.1[L][R][B]' \ - -map '[L]' "${name}-m48.wav" \ - -map '[R]' "${name}-drums.wav" \ - -map '[B]' "${name}-bass.wav" -done diff --git a/scripts/nl-rec b/scripts/nl-rec deleted file mode 100755 index 8a9e8bc..0000000 --- a/scripts/nl-rec +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -jack_capture --channels 3 --port system:capture_3 --port system:capture_4 --port system:capture_1 "$@" diff --git a/scripts/nl-rec-1 b/scripts/nl-rec-1 deleted file mode 100755 index 611e616..0000000 --- a/scripts/nl-rec-1 +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -jack_capture -jt --channels 1 --port system:capture_3 sermon.wavex diff --git a/scripts/nl-rec-service b/scripts/nl-rec-service deleted file mode 100755 index d688618..0000000 --- a/scripts/nl-rec-service +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Worship -jack_capture --channels 3 \ - --port system:capture_3 \ - --port system:capture_4 \ - --port system:capture_1 \ - worship.wavex - -# sermon -jack_capture --channels 1 --port system:capture_3 sermon.wavex - -# altar -jack_capture --channels 3 \ - --port system:capture_3 \ - --port system:capture_4 \ - --port system:capture_1 \ - altar.wavex diff --git a/scripts/nl-rec-service-synth b/scripts/nl-rec-service-synth deleted file mode 100644 index 74170be..0000000 --- a/scripts/nl-rec-service-synth +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Worship -jack_capture --channels 5 --port system:capture_3 --port system:capture_4 --port system:capture_1 --port yoshimi:left --port yoshimi:right worship.wavex - -# sermon -jack_capture --channels 1 --port system:capture_3 sermon.wavex - -# altar -jack_capture --channels 5 --port system:capture_3 --port system:capture_4 --port system:capture_1 --port yoshimi:left --port yoshimi:right altar.wavex diff --git a/scripts/nl-split-rec b/scripts/nl-split-rec deleted file mode 100755 index 5751d28..0000000 --- a/scripts/nl-split-rec +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -name=${1%.wavex} -avconv -i "$1" -filter_complex 'channelsplit=channel_layout=2.1[L][R][B]' -map '[L]' "${name}-m48.wav" -map '[R]' "${name}-drums.wav" -map '[B]' "${name}-bass.wav" - diff --git a/scripts/set-pipewire-latency.sh b/scripts/set-pipewire-latency.sh new file mode 100755 index 0000000..51d8ea5 --- /dev/null +++ b/scripts/set-pipewire-latency.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'USAGE' +Usage: ./set-pipewire-latency.sh COMMAND [QUANTUM] [RATE] + +Commands: + status Show current PipeWire clock/quantum settings. + on [Q] [RATE] Force a low-latency graph quantum. Defaults: Q=128 RATE=48000. + off Clear forced quantum/rate and return to normal PipeWire behavior. + +Useful quantum values at 48 kHz: + 256 about 5.3 ms per block, safer + 128 about 2.7 ms per block, good stage starting point + 64 about 1.3 ms per block, lower latency but higher dropout risk +USAGE +} + +metadata() { + pw-metadata -n settings "$@" +} + +status() { + local output + output="$(pw-metadata -n settings)" + printf '%s\n' "$output" | grep -E "clock\\.(rate|quantum|min-quantum|max-quantum|force-quantum|force-rate)" || true + + local rate quantum forced_quantum + rate="$(printf '%s\n' "$output" | awk -F"'" '/clock.rate/ { print $4; exit }')" + quantum="$(printf '%s\n' "$output" | awk -F"'" '/clock.quantum/ { print $4; exit }')" + forced_quantum="$(printf '%s\n' "$output" | awk -F"'" '/clock.force-quantum/ { print $4; exit }')" + + if [[ -n "$rate" && -n "$quantum" ]]; then + awk -v q="$quantum" -v r="$rate" 'BEGIN { printf "\nCurrent block latency: %.2f ms at %s Hz\n", (q / r) * 1000, r }' + fi + + if [[ "${forced_quantum:-0}" != "0" ]]; then + printf 'Low-latency override: ON\n' + else + printf 'Low-latency override: OFF\n' + fi +} + +set_low_latency() { + local quantum="${1:-128}" + local rate="${2:-48000}" + + if ! [[ "$quantum" =~ ^[0-9]+$ && "$rate" =~ ^[0-9]+$ ]]; then + printf 'Quantum and rate must be numeric.\n' >&2 + exit 2 + fi + + metadata 0 clock.force-rate "$rate" >/dev/null + metadata 0 clock.force-quantum "$quantum" >/dev/null + awk -v q="$quantum" -v r="$rate" 'BEGIN { printf "Forced PipeWire quantum %s at %s Hz, about %.2f ms per block\n", q, r, (q / r) * 1000 }' +} + +clear_low_latency() { + metadata 0 clock.force-quantum 0 >/dev/null + metadata 0 clock.force-rate 0 >/dev/null + printf 'Cleared PipeWire forced quantum/rate.\n' +} + +case "${1:-}" in + status) + status + ;; + on) + set_low_latency "${2:-128}" "${3:-48000}" + ;; + off) + clear_low_latency + ;; + -h|--help|help|'') + usage + ;; + *) + usage >&2 + exit 2 + ;; +esac diff --git a/scripts/start-church-session b/scripts/start-church-session deleted file mode 100755 index dab4e76..0000000 --- a/scripts/start-church-session +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -qjackctl -s -p Church48K & -echo "Waiting 4sec to let JACK start." -sleep 4.0s -jack-rack -s bass /home/music/projects/music-production/jack-rack-presets/newlife/yamaha-trb & -jack-rack -s mix /home/music/projects/music-production/jack-rack-presets/newlife/m48-mix & -jack-rack -s mix_drums /home/music/projects/music-production/jack-rack-presets/newlife/drums & -jack-rack -s headphones /home/music/projects/music-production/jack-rack-presets/newlife/headphones & -meterbridge -n meter -t dpm x x x x x & -echo "Waiting 2 sec to let all the apps start." -sleep 2.0s -devilspie & diff --git a/scripts/start-church-session-bass-with-synth b/scripts/start-church-session-bass-with-synth deleted file mode 100755 index f1242f0..0000000 --- a/scripts/start-church-session-bass-with-synth +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -qjackctl -s -p Church48K & -echo "Waiting 4sec to let JACK start." -sleep 4.0s -jack-rack -s bass /home/music/projects/music-production/jack-rack-presets/newlife/yamaha-trb & -jack-rack -s mix /home/music/projects/music-production/jack-rack-presets/newlife/m48-mix & -jack-rack -s mix_drums /home/music/projects/music-production/jack-rack-presets/newlife/drums & -jack-rack -s headphones /home/music/projects/music-production/jack-rack-presets/newlife/headphones & -meterbridge -n meter_bass -t dpm x x x x & -meterbridge -n meter_m48 -t dpm x x & -yoshimi -c & -a2jmidid & -echo "Waiting 2 sec to let all the apps start." -sleep 2.0s -devilspie & diff --git a/scripts/start-church-session-two-bassists b/scripts/start-church-session-two-bassists deleted file mode 100755 index 6650ea5..0000000 --- a/scripts/start-church-session-two-bassists +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -qjackctl -s -p Church48K & -echo "Waiting 4sec to let JACK start." -sleep 4.0s -jack-rack -s bass /home/music/projects/music-production/jack-rack-presets/newlife/yamaha-trb & -jack-rack -s bass2 /home/music/projects/music-production/jack-rack-presets/newlife/bass2 & -jack-rack -s mix /home/music/projects/music-production/jack-rack-presets/newlife/m48-mix & -jack-rack -s mix_drums /home/music/projects/music-production/jack-rack-presets/newlife/drums & -jack-rack -s headphones /home/music/projects/music-production/jack-rack-presets/newlife/headphones & -jack-rack -s headphones2 /home/music/projects/music-production/jack-rack-presets/newlife/headphones2 & -meterbridge -n meter_bass -t dpm x x x & -meterbridge -n meter_bass2 -t dpm x x x & -meterbridge -n meter_m48 -t dpm x x & -echo "Waiting 2 sec to let all the apps start." -sleep 2.0s -devilspie & diff --git a/scripts/start-home-session b/scripts/start-home-session deleted file mode 100755 index 84c6369..0000000 --- a/scripts/start-home-session +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -qjackctl -s -p Onboard48K & -echo "Waiting 4sec to let JACK start." -sleep 4.0s -jack-rack -s bass /home/music/projects/music-production/jack-rack-presets/home/yamaha-trb & -#jack-rack -s mix /home/music/projects/music-production/jack-rack-presets/M48-Mix & -#jack-rack -s mix_drums /home/music/projects/music-production/jack-rack-presets/M48-Mix-Drums & -jack-rack -s headphones /home/music/projects/music-production/jack-rack-presets/home/headphones & -j2amidi_bridge & diff --git a/scripts/start-onboard-session b/scripts/start-onboard-session deleted file mode 100755 index bf3000a..0000000 --- a/scripts/start-onboard-session +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -qjackctl -s -p Onboard48K & -echo "Waiting 4sec to let JACK start." -sleep 4.0s -jack-rack -s bass /home/music/projects/music-production/jack-rack-presets/onboard/yamaha-trb & -#jack-rack -s mix /home/music/projects/music-production/jack-rack-presets/M48-Mix & -#jack-rack -s mix_drums /home/music/projects/music-production/jack-rack-presets/M48-Mix-Drums & -jack-rack -s headphones /home/music/projects/music-production/jack-rack-presets/onboard/headphones &