diff --git a/Pipfile b/Pipfile index 4ba33c1..645640b 100644 --- a/Pipfile +++ b/Pipfile @@ -13,7 +13,5 @@ python-rtmidi = "*" python_version = "3.12" [scripts] -positions = "python scripts/position_movers.py" -pattern = "python -m pattern_pad" -midi = "python scripts/midi.py" +midi = "python scripts/pad/midi.py" padeditor = "python -m padeditor" diff --git a/README.md b/README.md index d153da3..da1d338 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ shows/ Workspaces to open in QLC+ simple.qxw Manual board: M1/M2 pads, shared + individual RGBW small_eye.qxw Movers-only figure-of-8 show archive/ Older scratch workspaces -scripts/ Generators / patchers for the shows +scripts/ Launchers (pattern_studio.sh, flash_luxdmx_xiao.sh) + pad/ SMC-PAD tools: smoother, Play layer, lamps, MIDI patching + shows/ Generators / patchers for the shows and Chataigne + anim/ showfile animations to preview over Art-Net stage/ Stage map (SVG, JSON, canvas) tests/ Art-Net / fixture helpers used by scripts ``` @@ -26,16 +29,16 @@ tests/ Art-Net / fixture helpers used by scripts ```bash # Rebuild simple manual board -python3 scripts/make_simple_vc.py +python3 scripts/shows/make_simple_vc.py # Rewrite can/mover patterns from stage layout -python3 scripts/integrate_u_patterns.py +python3 scripts/shows/integrate_u_patterns.py # Unify Patterns + Movers into one Show frame -python3 scripts/unify_vc.py +python3 scripts/shows/unify_vc.py # Figure-of-8 (live Art-Net or write/merge workspace) -python3 scripts/figure8_small_eye.py --write-qxw shows/small_eye.qxw +python3 scripts/shows/figure8_small_eye.py --write-qxw shows/small_eye.qxw ``` ## Fixtures / DMX @@ -50,18 +53,18 @@ manufacturer/model is missing. ## Chataigne -`scripts/make_chataigne.py` turns a show spec into a Chataigne project, so the +`scripts/shows/make_chataigne.py` turns a show spec into a Chataigne project, so the SMC-PAD can drive the same colour pads and sliders without QLC+. ```bash -python3 scripts/make_chataigne.py shows/test.show.json chataigne/test +python3 scripts/shows/make_chataigne.py shows/test.show.json chataigne/test ``` Open `chataigne/test/test.noisette`. The **Pad** (MIDI) module reads the SMC-PAD directly (`--pad` picks the port: USB `SINCO SMC-PAD-Master` by default, or `SMC-PAD Bluetooth`). The script does the Play-layer shift that `pad_layer.py` does for QLC+, with no knob smoothing, so `smooth_smc_pad.py` is not needed. Set the lamps with -`scripts/pad_lamps.py`. The **Lights** (DMX) module sends Art-Net to the +`scripts/pad/pad_lamps.py`. The **Lights** (DMX) module sends Art-Net to the node in the spec. The **Preview** module sends a copy to 127.0.0.1 for the simulator (`--preview ''` leaves it out). If it comes up on the wrong output, set DMX Type to Art-Net, the remote host, and an output universe of net 0, subnet 0, universe 0. The project also has a dashboard with the same buttons and sliders as the diff --git a/chataigne/show.template.js b/chataigne/show.template.js index 9af4d32..00721be 100644 --- a/chataigne/show.template.js +++ b/chataigne/show.template.js @@ -1,7 +1,7 @@ // Pads pick colours, sliders mix a custom colour, like the QLC+ virtual console. -// It reads the pad directly: Play shifts bank 2 here, as scripts/pad_layer.py does +// It reads the pad directly: Play shifts bank 2 here, as scripts/pad/pad_layer.py does // when QLC+ is used. -// Generated by scripts/make_chataigne.py: edit this template, not the output. +// Generated by scripts/shows/make_chataigne.py: edit this template, not the output. // // Runs as a script on the MIDI module "Pad" so it gets the pad and knob events. // DMX goes out through the DMX module "Lights", and a copy through "Preview" if it exists. diff --git a/chataigne/test/test.js b/chataigne/test/test.js index 6c10a8f..64fef6d 100644 --- a/chataigne/test/test.js +++ b/chataigne/test/test.js @@ -1,7 +1,7 @@ // Pads pick colours, sliders mix a custom colour, like the QLC+ virtual console. -// It reads the pad directly: Play shifts bank 2 here, as scripts/pad_layer.py does +// It reads the pad directly: Play shifts bank 2 here, as scripts/pad/pad_layer.py does // when QLC+ is used. -// Generated by scripts/make_chataigne.py: edit this template, not the output. +// Generated by scripts/shows/make_chataigne.py: edit this template, not the output. // // Runs as a script on the MIDI module "Pad" so it gets the pad and knob events. // DMX goes out through the DMX module "Lights", and a copy through "Preview" if it exists. diff --git a/scripts/anim_eight.py b/scripts/anim/anim_eight.py similarity index 81% rename from scripts/anim_eight.py rename to scripts/anim/anim_eight.py index 3015a9a..025a6a8 100644 --- a/scripts/anim_eight.py +++ b/scripts/anim/anim_eight.py @@ -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)) diff --git a/scripts/anim_stage.py b/scripts/anim/anim_stage.py similarity index 93% rename from scripts/anim_stage.py rename to scripts/anim/anim_stage.py index 9f046e3..ecf64df 100644 --- a/scripts/anim_stage.py +++ b/scripts/anim/anim_stage.py @@ -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)) diff --git a/scripts/decode_usbmon.py b/scripts/pad/decode_usbmon.py similarity index 97% rename from scripts/decode_usbmon.py rename to scripts/pad/decode_usbmon.py index a535799..a3f7267 100644 --- a/scripts/decode_usbmon.py +++ b/scripts/pad/decode_usbmon.py @@ -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 diff --git a/scripts/midi.py b/scripts/pad/midi.py similarity index 98% rename from scripts/midi.py rename to scripts/pad/midi.py index 7e6325e..cc1cd38 100644 --- a/scripts/midi.py +++ b/scripts/pad/midi.py @@ -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. diff --git a/scripts/pad_colours.py b/scripts/pad/pad_colours.py similarity index 95% rename from scripts/pad_colours.py rename to scripts/pad/pad_colours.py index 51137e9..3b0e315 100644 --- a/scripts/pad_colours.py +++ b/scripts/pad/pad_colours.py @@ -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 = [] diff --git a/scripts/pad_lamps.py b/scripts/pad/pad_lamps.py similarity index 84% rename from scripts/pad_lamps.py rename to scripts/pad/pad_lamps.py index 0cb197c..6363fb5 100644 --- a/scripts/pad_lamps.py +++ b/scripts/pad/pad_lamps.py @@ -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: diff --git a/scripts/pad_layer.py b/scripts/pad/pad_layer.py similarity index 100% rename from scripts/pad_layer.py rename to scripts/pad/pad_layer.py diff --git a/scripts/patch_smc_pad.py b/scripts/pad/patch_smc_pad.py similarity index 99% rename from scripts/patch_smc_pad.py rename to scripts/pad/patch_smc_pad.py index e817b2b..ed40f8d 100644 --- a/scripts/patch_smc_pad.py +++ b/scripts/pad/patch_smc_pad.py @@ -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" diff --git a/scripts/smooth_smc_pad.py b/scripts/pad/smooth_smc_pad.py similarity index 98% rename from scripts/smooth_smc_pad.py rename to scripts/pad/smooth_smc_pad.py index 3401abd..3be7aa5 100644 --- a/scripts/smooth_smc_pad.py +++ b/scripts/pad/smooth_smc_pad.py @@ -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")): diff --git a/scripts/start_midi.sh b/scripts/pad/start_midi.sh similarity index 90% rename from scripts/start_midi.sh rename to scripts/pad/start_midi.sh index 5d06c9d..18d967d 100755 --- a/scripts/start_midi.sh +++ b/scripts/pad/start_midi.sh @@ -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 diff --git a/scripts/colour_sets.py b/scripts/shows/colour_sets.py similarity index 95% rename from scripts/colour_sets.py rename to scripts/shows/colour_sets.py index 572423f..5659064 100644 --- a/scripts/colour_sets.py +++ b/scripts/shows/colour_sets.py @@ -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 = ( diff --git a/scripts/figure8_small_eye.py b/scripts/shows/figure8_small_eye.py similarity index 99% rename from scripts/figure8_small_eye.py rename to scripts/shows/figure8_small_eye.py index 8e2481d..d0256a4 100644 --- a/scripts/figure8_small_eye.py +++ b/scripts/shows/figure8_small_eye.py @@ -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 ( diff --git a/scripts/integrate_u_patterns.py b/scripts/shows/integrate_u_patterns.py similarity index 99% rename from scripts/integrate_u_patterns.py rename to scripts/shows/integrate_u_patterns.py index b54f29b..10dbaa9 100644 --- a/scripts/integrate_u_patterns.py +++ b/scripts/shows/integrate_u_patterns.py @@ -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()): diff --git a/scripts/make_cabaret_vc.py b/scripts/shows/make_cabaret_vc.py similarity index 99% rename from scripts/make_cabaret_vc.py rename to scripts/shows/make_cabaret_vc.py index ab2c489..34fa770 100644 --- a/scripts/make_cabaret_vc.py +++ b/scripts/shows/make_cabaret_vc.py @@ -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 diff --git a/scripts/make_chataigne.py b/scripts/shows/make_chataigne.py similarity index 99% rename from scripts/make_chataigne.py rename to scripts/shows/make_chataigne.py index c53db4e..cb41413 100644 --- a/scripts/make_chataigne.py +++ b/scripts/shows/make_chataigne.py @@ -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 /.noisette and /.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" diff --git a/scripts/make_simple_vc.py b/scripts/shows/make_simple_vc.py similarity index 93% rename from scripts/make_simple_vc.py rename to scripts/shows/make_simple_vc.py index 3861c5e..1369973 100644 --- a/scripts/make_simple_vc.py +++ b/scripts/shows/make_simple_vc.py @@ -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)) diff --git a/scripts/unify_vc.py b/scripts/shows/unify_vc.py similarity index 99% rename from scripts/unify_vc.py rename to scripts/shows/unify_vc.py index 36980d2..06b499b 100644 --- a/scripts/unify_vc.py +++ b/scripts/shows/unify_vc.py @@ -33,7 +33,7 @@ def btn( """ -ROOT = Path(__file__).resolve().parents[1] +ROOT = Path(__file__).resolve().parents[2] def main(): diff --git a/tests/test_chataigne.py b/tests/test_chataigne.py index 6f99194..18126f1 100644 --- a/tests/test_chataigne.py +++ b/tests/test_chataigne.py @@ -10,7 +10,7 @@ import unittest from pathlib import Path ROOT = Path(__file__).resolve().parents[1] -sys.path.insert(0, str(ROOT / "scripts")) +sys.path.insert(0, str(ROOT / "scripts" / "shows")) import make_chataigne # noqa: E402 @@ -35,7 +35,7 @@ class ChataigneExportTest(unittest.TestCase): def test_writes_project_and_script(self) -> None: with tempfile.TemporaryDirectory() as tmp: subprocess.run( - [sys.executable, str(ROOT / "scripts" / "make_chataigne.py"), str(ROOT / "shows" / "test.show.json"), tmp], + [sys.executable, str(ROOT / "scripts" / "shows" / "make_chataigne.py"), str(ROOT / "shows" / "test.show.json"), tmp], check=True, capture_output=True, ) diff --git a/tests/test_pad_colours.py b/tests/test_pad_colours.py index ea17cd7..20b8276 100644 --- a/tests/test_pad_colours.py +++ b/tests/test_pad_colours.py @@ -7,7 +7,7 @@ import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[1] -spec = importlib.util.spec_from_file_location("pad_colours", ROOT / "scripts" / "pad_colours.py") +spec = importlib.util.spec_from_file_location("pad_colours", ROOT / "scripts" / "pad" / "pad_colours.py") colours = importlib.util.module_from_spec(spec) assert spec.loader is not None sys.modules["pad_colours"] = colours diff --git a/tests/test_pad_layer.py b/tests/test_pad_layer.py index 7acf69f..238f576 100644 --- a/tests/test_pad_layer.py +++ b/tests/test_pad_layer.py @@ -2,7 +2,7 @@ import sys import unittest from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts")) +sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts" / "pad")) from pad_layer import PlayLayer # noqa: E402 diff --git a/tests/test_padeditor.py b/tests/test_padeditor.py index f2ef5f1..c4def55 100644 --- a/tests/test_padeditor.py +++ b/tests/test_padeditor.py @@ -155,7 +155,7 @@ def test_last_pad_keeps_its_short_tail(): def test_factory_image_reads_as_midisuite_shows_it(): - # Captured from MidiSuite's Reset with scripts/decode_usbmon.py. + # Captured from MidiSuite's Reset with scripts/pad/decode_usbmon.py. raw = (ROOT / "tests" / "data" / "smc_pad_factory.bin").read_bytes() doc = unpack(raw) assert pack(doc) == raw diff --git a/tests/test_showfile.py b/tests/test_showfile.py index f558a64..09d6f3f 100644 --- a/tests/test_showfile.py +++ b/tests/test_showfile.py @@ -290,12 +290,12 @@ class ShowFileTest(unittest.TestCase): target.unlink(missing_ok=True) def test_animation_script_dry_run(self): - show = load_show(ROOT / "scripts" / "anim_eight.py") + show = load_show(ROOT / "scripts" / "anim" / "anim_eight.py") frames = [show_frame(show, t) for t in (0, 2000)] self.assertNotEqual(frames[0]["m1"][2], frames[1]["m1"][2]) self.assertEqual(frames[0]["m1"][8], 255) completed = subprocess.run( - [sys.executable, "-m", "showfile", "run", "scripts/anim_eight.py", "--seconds", "0.1"], + [sys.executable, "-m", "showfile", "run", "scripts/anim/anim_eight.py", "--seconds", "0.1"], cwd=ROOT, check=False, capture_output=True, @@ -329,7 +329,7 @@ class ShowFileTest(unittest.TestCase): def test_stage_map_drives_the_whole_rig(self): stage = json.loads((ROOT / "stage" / "map.json").read_text(encoding="utf-8")) - show = load_show(ROOT / "scripts" / "anim_stage.py") + show = load_show(ROOT / "scripts" / "anim" / "anim_stage.py") self.assertEqual([fx.key for fx in show.fixtures], list(stage["fixtures"])) for key, raw in stage["fixtures"].items(): fixture = show.fixtures_by_key[key] @@ -370,7 +370,7 @@ class ShowFileTest(unittest.TestCase): outside = validate_show({"stage": "/etc/passwd"}) self.assertFalse(outside["ok"]) completed = subprocess.run( - [sys.executable, "-m", "showfile", "run", "scripts/anim_stage.py", "--seconds", "0.1"], + [sys.executable, "-m", "showfile", "run", "scripts/anim/anim_stage.py", "--seconds", "0.1"], cwd=ROOT, check=False, capture_output=True,