Group scripts into pad/, shows/ and anim/ folders.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f593b973c
commit
647cfa3a75
26 files changed
+68
-66
No files matched your search
@@ -3,12 +3,12 @@
|
||||
|
||||
Dry run (prints DMX samples, sends nothing):
|
||||
|
||||
python3 scripts/anim_eight.py
|
||||
python3 -m showfile run scripts/anim_eight.py --seconds 1
|
||||
python3 scripts/anim/anim_eight.py
|
||||
python3 -m showfile run scripts/anim/anim_eight.py --seconds 1
|
||||
|
||||
Send Art-Net, for example at the stage simulator:
|
||||
|
||||
python3 scripts/anim_eight.py --ip 127.0.0.1 --seconds 8
|
||||
python3 scripts/anim/anim_eight.py --ip 127.0.0.1 --seconds 8
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -16,7 +16,7 @@ from __future__ import annotations
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
@@ -5,12 +5,12 @@ The patch, positions, and channel names come from stage/map.json.
|
||||
|
||||
Dry run (prints DMX samples, sends nothing):
|
||||
|
||||
python3 scripts/anim_stage.py
|
||||
python3 -m showfile run scripts/anim_stage.py --seconds 1
|
||||
python3 scripts/anim/anim_stage.py
|
||||
python3 -m showfile run scripts/anim/anim_stage.py --seconds 1
|
||||
|
||||
Send Art-Net at the stage simulator:
|
||||
|
||||
python3 scripts/anim_stage.py --ip 127.0.0.1 --seconds 12
|
||||
python3 scripts/anim/anim_stage.py --ip 127.0.0.1 --seconds 12
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -18,7 +18,7 @@ from __future__ import annotations
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"""Print the SMC-PAD SysEx in a usbmon capture.
|
||||
|
||||
sudo tcpdump -i usbmon1 -s 0 -U -w - > captures/pad.pcap
|
||||
python3 scripts/decode_usbmon.py captures/pad.pcap --device 21
|
||||
python3 scripts/pad/decode_usbmon.py captures/pad.pcap --device 21
|
||||
|
||||
Each USB-MIDI packet is reassembled into messages per cable, then SINCO
|
||||
SysEx is decoded to its command, memory, address, and data.
|
||||
@@ -15,7 +15,7 @@ import struct
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from padeditor.sysex import decode # noqa: E402
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print SMC-PAD pad and knob numbers.
|
||||
|
||||
pipenv run python scripts/midi.py
|
||||
pipenv run python scripts/pad/midi.py
|
||||
|
||||
Each pad press prints pad N. Each knob turn prints knob N and its step
|
||||
(+ for up, - for down).
|
||||
@@ -18,7 +18,7 @@ from pathlib import Path
|
||||
|
||||
import mido
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
MAP_PATH = ROOT / "shows" / "midi_map.json"
|
||||
|
||||
# (channel, note) -> pad number. Loaded from shows/midi_map.json.
|
||||
@@ -5,11 +5,11 @@ Pad bank 1 is notes 36–51 and pad bank 2 is notes 52–67, bottom-left
|
||||
first. Note messages do not change these lamps. The colour is three
|
||||
bytes in the preset, written over the Private USB port.
|
||||
|
||||
.venv/bin/python scripts/pad_colours.py --xchc --bank 2
|
||||
.venv/bin/python scripts/pad_colours.py --colour-set --bank 2
|
||||
.venv/bin/python scripts/pad_colours.py --dry-run
|
||||
.venv/bin/python scripts/pad_colours.py --clear
|
||||
.venv/bin/python scripts/pad_colours.py --identify
|
||||
.venv/bin/python scripts/pad/pad_colours.py --xchc --bank 2
|
||||
.venv/bin/python scripts/pad/pad_colours.py --colour-set --bank 2
|
||||
.venv/bin/python scripts/pad/pad_colours.py --dry-run
|
||||
.venv/bin/python scripts/pad/pad_colours.py --clear
|
||||
.venv/bin/python scripts/pad/pad_colours.py --identify
|
||||
|
||||
--identify lights every pad on a page in that page's colour, in rainbow
|
||||
order, in all eight presets, so the page on show can be read at a glance.
|
||||
@@ -27,9 +27,9 @@ import glob
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
sys.path.insert(0, str(ROOT / "scripts" / "pad"))
|
||||
|
||||
from patch_smc_pad import PAD_COLORS # noqa: E402
|
||||
from padeditor import preset # noqa: E402
|
||||
@@ -120,6 +120,7 @@ def xchc_colours(clear: bool = False) -> list[tuple[str, bytes]]:
|
||||
|
||||
def colour_set(clear: bool = False) -> list[tuple[str, bytes]]:
|
||||
"""The colours of shows/test.qxw in pad order, then the rest of the bank off."""
|
||||
sys.path.insert(0, str(ROOT / "scripts" / "shows"))
|
||||
from colour_sets import COLOURS
|
||||
|
||||
colours = []
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Set the SMC-PAD lamps: bank 1 off, bank 2 in the colours of shows/test.qxw.
|
||||
|
||||
.venv/bin/python scripts/pad_lamps.py
|
||||
.venv/bin/python scripts/pad/pad_lamps.py
|
||||
|
||||
Needs the USB Private port. smooth_smc_pad.py does this on start; run this
|
||||
when the pad is read by Chataigne instead.
|
||||
@@ -12,13 +12,13 @@ from __future__ import annotations
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def set_lamps() -> None:
|
||||
"""Bank 1 lamps off, bank 2 lamps from shows/test.qxw. Needs the USB Private port."""
|
||||
sys.path.insert(0, str(ROOT))
|
||||
sys.path.insert(0, str(ROOT / "scripts"))
|
||||
sys.path.insert(0, str(ROOT / "scripts" / "pad"))
|
||||
import pad_colours
|
||||
|
||||
try:
|
||||
File renamed without changes.
@@ -8,7 +8,7 @@ import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
OUT = ROOT / "shows" / "midi.qxw"
|
||||
PROFILE_SRC = ROOT / "inputprofiles" / "M-VAVE-SMC-PAD.qxi"
|
||||
PROFILE_DST = Path.home() / ".qlcplus" / "inputprofiles" / "M-VAVE-SMC-PAD.qxi"
|
||||
@@ -13,7 +13,7 @@ Point QLC+ MIDI input at that virtual port (midi.qxw does this via
|
||||
patch_smc_pad.py once the smoother is running).
|
||||
|
||||
Usage:
|
||||
.venv/bin/python scripts/smooth_smc_pad.py
|
||||
.venv/bin/python scripts/pad/smooth_smc_pad.py
|
||||
# optional: --tau 0.05 (seconds; lower = snappier, higher = silkier)
|
||||
"""
|
||||
|
||||
@@ -27,7 +27,7 @@ import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
import glob
|
||||
|
||||
for p in glob.glob(str(ROOT / ".venv" / "lib" / "python*" / "site-packages")):
|
||||
@@ -7,7 +7,7 @@
|
||||
# 3) patch workspace to that port
|
||||
# 4) open QLC+ last
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
cd "$ROOT"
|
||||
|
||||
PYTHON="${ROOT}/.venv/bin/python"
|
||||
@@ -35,7 +35,7 @@ while read -r pid; do
|
||||
[[ -n "$pid" ]] && kill "$pid" 2>/dev/null || true
|
||||
done < <(ps -eo pid,args | awk '/[.]venv\/bin\/python .*smooth_smc_pad[.]py/ {print $1}')
|
||||
sleep 0.4
|
||||
nohup "$PYTHON" scripts/smooth_smc_pad.py --tau 0.055 >>/tmp/smooth_smc_pad.log 2>&1 &
|
||||
nohup "$PYTHON" scripts/pad/smooth_smc_pad.py --tau 0.055 >>/tmp/smooth_smc_pad.log 2>&1 &
|
||||
for _ in $(seq 1 20); do
|
||||
if aconnect -l 2>/dev/null | grep -q 'SMC-PAD Smooth'; then
|
||||
break
|
||||
@@ -48,7 +48,7 @@ if ! aconnect -l 2>/dev/null | grep -q 'SMC-PAD Smooth'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python3 scripts/patch_smc_pad.py
|
||||
python3 scripts/pad/patch_smc_pad.py
|
||||
|
||||
kill "$(pgrep -x qlcplus)" 2>/dev/null || true
|
||||
sleep 0.5
|
||||
@@ -7,7 +7,7 @@ fades in and out over FADE_MS. Bank 2 (notes 52–67) picks colour 1.
|
||||
Holding Play picks set B: the smoother turns those notes into 68–83 while
|
||||
Play is down. Bank 1 is kept for animations.
|
||||
|
||||
python3 scripts/colour_sets.py && python3 -m showfile write shows/test.show.json -o shows/test.qxw
|
||||
python3 scripts/shows/colour_sets.py && python3 -m showfile write shows/test.show.json -o shows/test.qxw
|
||||
The sliders are Playback sliders over five scenes per set (Dim, R, G, B, W),
|
||||
so they never override a channel. Knobs 1–5 move colour 1's sliders and knobs
|
||||
6–10 colour 2's. Run the smoother with --lock-knobs to make them work only
|
||||
@@ -20,18 +20,18 @@ from __future__ import annotations
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
SPEC = ROOT / "shows" / "test.show.json"
|
||||
|
||||
FADE_MS = 1000
|
||||
DIMMER, RED, GREEN, BLUE, WHITE = 0, 2, 3, 4, 5
|
||||
PAD_BANK_2_FIRST_NOTE = 52
|
||||
HELD_FIRST_NOTE = 68 # scripts/pad_layer.py sends bank 2 here while Play is held
|
||||
HELD_FIRST_NOTE = 68 # scripts/pad/pad_layer.py sends bank 2 here while Play is held
|
||||
PROFILE = "M-VAVE SMC-PAD"
|
||||
OMNI = 16 # QLC+ MIDI plugin channel that accepts every MIDI channel
|
||||
PAD_MIDI_CH = 9 # the pads send notes on channel 10
|
||||
KNOB_FIRST_CC = 30 # pad knob 1; colour 2's sliders follow colour 1's
|
||||
PAD_PORT = "SMC-PAD Smooth" # scripts/smooth_smc_pad.py; it applies the Play layer
|
||||
PAD_PORT = "SMC-PAD Smooth" # scripts/pad/smooth_smc_pad.py; it applies the Play layer
|
||||
|
||||
# name, r, g, b, w. Bottom row first, four to a row. The cans have a white emitter, so the whites use it.
|
||||
COLOURS = (
|
||||
@@ -5,9 +5,9 @@ Traces QLC+'s Eight path (pan = -sin(2t), tilt = cos(t)), rides focus
|
||||
with throw so the spot stays a similar size, and walks hue around the loop.
|
||||
The whole 8 slowly drifts in a circle so it does not sit in one place.
|
||||
|
||||
python3 scripts/figure8_small_eye.py
|
||||
python3 scripts/figure8_small_eye.py --write-qxw shows/small_eye.qxw
|
||||
python3 scripts/figure8_small_eye.py --merge-xchc shows/xchc.qxw
|
||||
python3 scripts/shows/figure8_small_eye.py
|
||||
python3 scripts/shows/figure8_small_eye.py --write-qxw shows/small_eye.qxw
|
||||
python3 scripts/shows/figure8_small_eye.py --merge-xchc shows/xchc.qxw
|
||||
|
||||
Stop QLC+ output before live mode so the two sources do not fight.
|
||||
Quit live mode with Ctrl+C (sends blackout).
|
||||
@@ -22,7 +22,7 @@ import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
|
||||
from test_small_eye import (
|
||||
@@ -182,7 +182,7 @@ def monitor_xml() -> str:
|
||||
|
||||
|
||||
def main():
|
||||
path = Path(__file__).resolve().parents[1] / "shows" / "xchc.qxw"
|
||||
path = Path(__file__).resolve().parents[2] / "shows" / "xchc.qxw"
|
||||
text = path.read_text()
|
||||
|
||||
for i, (name, rgb) in enumerate(COLORS.items()):
|
||||
@@ -5,7 +5,7 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
OUT = ROOT / "shows" / "cabaret.qxw"
|
||||
|
||||
M1, M2 = 8, 9
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Write a Chataigne project from a show spec.
|
||||
|
||||
python3 scripts/make_chataigne.py shows/test.show.json chataigne/test
|
||||
python3 scripts/shows/make_chataigne.py shows/test.show.json chataigne/test
|
||||
|
||||
Writes <out>/<name>.noisette and <out>/<name>.js. The script holds the scenes and
|
||||
the pad and slider mapping, and sends DMX through the project's DMX module, named Lights, and a copy to Preview. Solo
|
||||
@@ -16,7 +16,7 @@ import struct
|
||||
import zlib
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
TEMPLATE = ROOT / "chataigne" / "show.template.js"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
@@ -33,7 +33,7 @@ def btn(
|
||||
</Button>"""
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
def main():
|
||||
Reference in new issue
Block a user