diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 1a0a190..ee11eaa 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -8,10 +8,9 @@ on: [push, pull_request] jobs: drift: # Fails if this repo's .clang-format/.clang-tidy/STYLE.md diverge from TapHouse. - # TapHouse v2 (pinned by commit SHA until the v2 tag is created). - uses: tap/taphouse/.github/workflows/drift-check.yml@ff71d8146754e5e35374cfe0d191e0983219da3b + uses: tap/taphouse/.github/workflows/drift-check.yml@v4 with: - ref: ff71d8146754e5e35374cfe0d191e0983219da3b + ref: v4 clang-format: runs-on: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b392057 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +# Canonical Tap House pre-commit config — the single source of truth for the +# Tap family's local formatting hook. Distributed to every Tap repo by +# scripts/sync.sh (alongside .clang-format / .clang-tidy / STYLE.md) and kept +# honest by the drift-check workflow, so every repo runs the SAME hook at the +# SAME pinned clang-format version. +# +# Why the pin matters: an ad-hoc hook using each machine's own clang-format +# would format differently than CI and be worse than none. The `rev` below is +# the Tap-wide clang-format version — bump it HERE, re-sync, and every repo +# (and its CI, which runs `pre-commit run --all-files`) moves together. +# +# Adopt in a consumer repo: +# 1. taphouse/scripts/sync.sh /path/to/your-repo # copies this file in +# 2. cd your-repo && pre-commit install # once per clone +# Thereafter `git commit` formats staged C/C++ before it can be pushed, so the +# clang-format CI gate can never fail on a local commit again. +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.3 # Tap-wide clang-format version (matches CI) + hooks: + - id: clang-format + types_or: [c, c++] + exclude: '^third_party/' # vendored sources are formatted upstream, never by us diff --git a/README.md b/README.md index 9a9b941..4f5fd46 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ same either way. | Kernel | Max object | Contents | |---|---|---| -| `include/taptools/autowah.h` | `tap.autowah~` | Snow White-style envelope filter (`taptools::autowah`) | -| `include/taptools/diode_ladder.h` | `tap.diode~` | ZDF TB-303 diode ladder (`taptools::diode`) | -| `include/taptools/tb303_voice.h` | `tap.303~` | TB-303 acid-bass voice (`taptools::tb303`) | -| `include/taptools/ladder.h` | `tap.ladder~` | ZDF Moog-style ladder (`taptools::ladder`) | -| `include/taptools/svf.h` | `tap.svf~` | Simper/Cytomic morphing SVF (`taptools::svf`) | -| `include/taptools/vco.h` | `tap.vco~` | Virtual-analog oscillator (`taptools::vco`) | -| `include/taptools/grm_comb.h` | `tap.5comb~` | GRM comb-bank recreation (`taptools::fivecomb`) | -| `include/taptools/grm_pitchaccum.h` | `tap.pitchaccum~` | GRM PitchAccum recreation (`taptools::pitchaccum`) | -| `include/taptools/conv_engine.h` | `tap.convolve~` | Partitioned (UPOLS) true-stereo convolution (`taptools::conv_engine`) | +| `include/taptools/autowah.h` | `tap.autowah~` | Snow White-style envelope filter (`tap::tools::autowah`) | +| `include/taptools/diode_ladder.h` | `tap.diode~` | ZDF TB-303 diode ladder (`tap::tools::diode`) | +| `include/taptools/tb303_voice.h` | `tap.303~` | TB-303 acid-bass voice (`tap::tools::tb303`) | +| `include/taptools/ladder.h` | `tap.ladder~` | ZDF Moog-style ladder (`tap::tools::ladder`) | +| `include/taptools/svf.h` | `tap.svf~` | Simper/Cytomic morphing SVF (`tap::tools::svf`) | +| `include/taptools/vco.h` | `tap.vco~` | Virtual-analog oscillator (`tap::tools::vco`) | +| `include/taptools/grm_comb.h` | `tap.5comb~` | GRM comb-bank recreation (`tap::tools::fivecomb`) | +| `include/taptools/grm_pitchaccum.h` | `tap.pitchaccum~` | GRM PitchAccum recreation (`tap::tools::pitchaccum`) | +| `include/taptools/conv_engine.h` | `tap.convolve~` | Partitioned (UPOLS) true-stereo convolution (`tap::tools::conv_engine`) | Plus, all Max-free: diff --git a/bench/diode_bench.cpp b/bench/diode_bench.cpp index 9c9dc14..efc9c57 100644 --- a/bench/diode_bench.cpp +++ b/bench/diode_bench.cpp @@ -21,7 +21,7 @@ #include -namespace dio = taptools::diode; +namespace dio = tap::tools::diode; namespace { diff --git a/bench/svf_bench.cpp b/bench/svf_bench.cpp index 73f1d15..3883e56 100644 --- a/bench/svf_bench.cpp +++ b/bench/svf_bench.cpp @@ -26,7 +26,7 @@ #include -namespace ksv = taptools::svf; +namespace ksv = tap::tools::svf; namespace { diff --git a/book/src/machine/autowah.md b/book/src/machine/autowah.md index 3c0557a..8418ab4 100644 --- a/book/src/machine/autowah.md +++ b/book/src/machine/autowah.md @@ -14,7 +14,7 @@ proved in [the SVF appendix](svf.md) — is A-stability under per-sample cutoff modulation. An envelope-swept filter moves its cutoff *every sample by construction*; the property the wah needs most is exactly the one `svf.h` already guarantees by theorem. So `wah_filter` owns a -`taptools::svf::svf_filter` member (`m_svf`) and drives it through the +`tap::tools::svf::svf_filter` member (`m_svf`) and drives it through the signal-rate path, `m_svf.tick(m_cutoff)` then `m_svf.process(0, x)`, once per sample. The house rule makes this legal: objects under `source/projects/` stay self-contained, but *inside the kernel repo* sharing diff --git a/book/src/machine/comb.md b/book/src/machine/comb.md index d7c15f0..a5e5798 100644 --- a/book/src/machine/comb.md +++ b/book/src/machine/comb.md @@ -7,7 +7,7 @@ tune*, and that `phase` at 100 cancels the even harmonics — exactly. This appendix derives all three the way the file was designed, then walks the code-level decisions. The behavioral claims below are pinned by the kernel scenarios in `tap.5comb_tilde_test.cpp`, which drive -`taptools::fivecomb::comb_bank` directly (no Max in the loop); the few +`tap::tools::fivecomb::comb_bank` directly (no Max in the loop); the few numbers outside the test suite are marked as measured on the kernel for this chapter. diff --git a/book/src/machine/pitchaccum.md b/book/src/machine/pitchaccum.md index 60909a9..f212b48 100644 --- a/book/src/machine/pitchaccum.md +++ b/book/src/machine/pitchaccum.md @@ -6,7 +6,7 @@ tenth pass is as steady as the first." The image is a topology claim and the promise is an identity about a pair of window functions, and both are provable. This appendix proves them with the file's own names, then walks the pitch follower's failure mode and the ledger. The kernel scenarios in -`tap.pitchaccum_tilde_test.cpp` drive `taptools::pitchaccum::accum_bank` +`tap.pitchaccum_tilde_test.cpp` drive `tap::tools::pitchaccum::accum_bank` directly and pin every measured claim; the sibling `tap.shift~` tests pin the envelope identity to nine decimal places. diff --git a/include/taptools/autowah.h b/include/taptools/autowah.h index 0880ec5..e25fb88 100644 --- a/include/taptools/autowah.h +++ b/include/taptools/autowah.h @@ -55,7 +55,7 @@ #include "svf.h" -namespace taptools { +namespace tap::tools { namespace autowah { constexpr double k_pi = 3.14159265358979323846; @@ -480,4 +480,4 @@ namespace taptools { }; } // namespace autowah -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/bridged_t.h b/include/taptools/bridged_t.h index 8724d06..80dca30 100644 --- a/include/taptools/bridged_t.h +++ b/include/taptools/bridged_t.h @@ -39,7 +39,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace tr808 { constexpr double k_pi = 3.14159265358979323846; @@ -200,4 +200,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/conv_engine.h b/include/taptools/conv_engine.h index ce77bf1..01616c1 100644 --- a/include/taptools/conv_engine.h +++ b/include/taptools/conv_engine.h @@ -32,7 +32,7 @@ #include "fft.h" // the shared radix-2 FFT (formerly a private copy of this exact routine) -namespace taptools { +namespace tap::tools { class conv_engine { public: @@ -231,4 +231,4 @@ namespace taptools { int m_fdl{0}; // ring index of the newest input spectrum }; -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/diode_ladder.h b/include/taptools/diode_ladder.h index b400841..92e5652 100644 --- a/include/taptools/diode_ladder.h +++ b/include/taptools/diode_ladder.h @@ -75,7 +75,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace diode { constexpr int k_presets = 16; @@ -558,4 +558,4 @@ namespace taptools { }; } // namespace diode -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/fft.h b/include/taptools/fft.h index c40a2ea..dabf7a4 100644 --- a/include/taptools/fft.h +++ b/include/taptools/fft.h @@ -15,7 +15,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace fft { inline constexpr double k_pi = 3.14159265358979323846; @@ -68,4 +68,4 @@ namespace taptools { } } // namespace fft -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/grm_comb.h b/include/taptools/grm_comb.h index a484608..25b03a9 100644 --- a/include/taptools/grm_comb.h +++ b/include/taptools/grm_comb.h @@ -36,7 +36,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace fivecomb { constexpr int k_voices = 5; @@ -523,4 +523,4 @@ namespace taptools { }; } // namespace fivecomb -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/grm_pitchaccum.h b/include/taptools/grm_pitchaccum.h index 1511acd..8ca8851 100644 --- a/include/taptools/grm_pitchaccum.h +++ b/include/taptools/grm_pitchaccum.h @@ -32,7 +32,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace pitchaccum { constexpr int k_voices = 2; @@ -666,4 +666,4 @@ namespace taptools { }; } // namespace pitchaccum -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/ladder.h b/include/taptools/ladder.h index fe41312..a241417 100644 --- a/include/taptools/ladder.h +++ b/include/taptools/ladder.h @@ -43,7 +43,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace ladder { constexpr int k_presets = 16; @@ -498,4 +498,4 @@ namespace taptools { }; } // namespace ladder -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/metal_bank.h b/include/taptools/metal_bank.h index 3709618..bd13343 100644 --- a/include/taptools/metal_bank.h +++ b/include/taptools/metal_bank.h @@ -40,7 +40,7 @@ #include "bridged_t.h" // k_pi #include "swing_vca.h" // white_noise (seed machinery) -namespace taptools { +namespace tap::tools { namespace tr808 { constexpr int k_bank_oscs = 6; @@ -174,4 +174,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/nr.h b/include/taptools/nr.h index b26a6bc..1aadf35 100644 --- a/include/taptools/nr.h +++ b/include/taptools/nr.h @@ -18,7 +18,7 @@ #include "stft.h" -namespace taptools { +namespace tap::tools { namespace nr { class reducer { @@ -66,4 +66,4 @@ namespace taptools { }; } // namespace nr -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/spectra.h b/include/taptools/spectra.h index b9f94bb..296c5d8 100644 --- a/include/taptools/spectra.h +++ b/include/taptools/spectra.h @@ -18,7 +18,7 @@ #include "stft.h" -namespace taptools { +namespace tap::tools { namespace spectra { class remapper { @@ -81,4 +81,4 @@ namespace taptools { }; } // namespace spectra -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/step_seq.h b/include/taptools/step_seq.h index ad023ad..c22c0f2 100644 --- a/include/taptools/step_seq.h +++ b/include/taptools/step_seq.h @@ -58,7 +58,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace seq { constexpr int k_max_steps = 64; @@ -326,4 +326,4 @@ namespace taptools { }; } // namespace seq -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/stft.h b/include/taptools/stft.h index c30b6b0..d0b0ee6 100644 --- a/include/taptools/stft.h +++ b/include/taptools/stft.h @@ -20,7 +20,7 @@ #include "fft.h" -namespace taptools { +namespace tap::tools { class stft { public: @@ -121,4 +121,4 @@ namespace taptools { std::vector m_im; // scratch FFT imag }; -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/svf.h b/include/taptools/svf.h index cf2d221..6454643 100644 --- a/include/taptools/svf.h +++ b/include/taptools/svf.h @@ -58,7 +58,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace svf { constexpr double k_pi = 3.14159265358979323846; @@ -667,4 +667,4 @@ namespace taptools { }; } // namespace svf -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/swing_vca.h b/include/taptools/swing_vca.h index d0a0257..2cac9cd 100644 --- a/include/taptools/swing_vca.h +++ b/include/taptools/swing_vca.h @@ -27,9 +27,9 @@ #include #include -#include "vca.h" // taptools::vca::swing_shape — the shared swing-type saturator +#include "vca.h" // tap::tools::vca::swing_shape — the shared swing-type saturator -namespace taptools { +namespace tap::tools { namespace tr808 { /// Deterministic white noise in [-1, 1] — xorshift64* keyed by seed. @@ -114,11 +114,11 @@ namespace taptools { /// The swing-type VCA: envelope as gain. Linear by default (`drive` 0 → `x * env`, the /// calibrated model, bit-for-bit); `drive > 0` engages the swing VCA's symmetric harmonic /// saturation (the "many high harmonics" the Service Notes note) on the enveloped signal, - /// via the shared taptools::vca::swing_shape. The character rides the envelope — quiet tails + /// via the shared tap::tools::vca::swing_shape. The character rides the envelope — quiet tails /// stay clean, hot transients pick up grit and gentle compression. inline double swing_vca(double x, double env, double drive = 0.0) { return vca::swing_shape(x * env, drive); } } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tb303_voice.h b/include/taptools/tb303_voice.h index 0a57ad3..22c45a8 100644 --- a/include/taptools/tb303_voice.h +++ b/include/taptools/tb303_voice.h @@ -4,7 +4,7 @@ /// diode ladder -> VCA, with the envelope generators and gate/slide logic that make /// the instrument. Composition of two existing kernels plus the voice circuits: /// -/// - Oscillator: vco.h (`taptools::vco::vco_osc`) running the polyBLEP saw, driven +/// - Oscillator: vco.h (`tap::tools::vco::vco_osc`) running the polyBLEP saw, driven /// per sample through `process_at()` so pitch (note + tuning + slide) is /// signal-rate. The 303's square is not a pulse — the hardware derives it from /// the saw with a transistor shaper. Slice 4 adopts Open303's measured shaper: @@ -15,7 +15,7 @@ /// it to the BLEP-smoothed saw keeps the edges bandlimited. `waveform` is a /// continuous 0 (saw) .. 1 (square) blend riding the ramps, like Open303's /// blend oscillator. -/// - Filter: diode_ladder.h (`taptools::diode::diode_filter`), cutoff overridden +/// - Filter: diode_ladder.h (`tap::tools::diode::diode_filter`), cutoff overridden /// per sample with the envelope-modulated value; `resonance`/`solver`/ /// `oversample` pass through. Input/output coupling: a 44.486 Hz one-pole /// high-pass before the filter and a 24.167 Hz one-pole high-pass after it — @@ -114,7 +114,7 @@ #include "vca.h" #include "vco.h" -namespace taptools { +namespace tap::tools { namespace tb303 { constexpr int k_presets = 16; @@ -179,10 +179,10 @@ namespace taptools { enum vca_mode : int { vca_clean = 0, vca_warm, k_num_vca_modes }; // Phase-2 transistor-VCA saturator (see header): informed constants, probe-calibrated. - // The saturator itself lives in the shared vca.h kernel (taptools::vca) so tap.303~ and the + // The saturator itself lives in the shared vca.h kernel (tap::tools::vca) so tap.303~ and the // standalone tap.vca~ run one implementation; these are the values the voice configures it with. - constexpr double k_vca_sat_drive = taptools::vca::k_default_drive; // 2.0 - constexpr double k_vca_sat_bias = taptools::vca::k_default_bias; // 0.3 + constexpr double k_vca_sat_drive = tap::tools::vca::k_default_drive; // 2.0 + constexpr double k_vca_sat_bias = tap::tools::vca::k_default_bias; // 0.3 constexpr int k_factory_presets = 8; // slots 0..7 ship authored; 8..15 are defaults @@ -669,9 +669,9 @@ namespace taptools { double m_vca_decay{0.9999}, m_vca_release{0.99}; double m_slide_coef{0.001}; - // phase-2 VCA circuit — the saturator math lives in the shared taptools::vca stage - int m_vca_mode{vca_clean}; - ::taptools::vca m_vca_stage; // shape() only; the voice runs its own coupling + gain + // phase-2 VCA circuit — the saturator math lives in the shared tap::tools::vca stage + int m_vca_mode{vca_clean}; + ::tap::tools::vca m_vca_stage; // shape() only; the voice runs its own coupling + gain // per-unit component spread (seed/tolerance) double m_unit_tune_cents{0.0}; @@ -690,4 +690,4 @@ namespace taptools { }; } // namespace tb303 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_clap.h b/include/taptools/tr808_clap.h index a9da1ea..6132b08 100644 --- a/include/taptools/tr808_clap.h +++ b/include/taptools/tr808_clap.h @@ -50,7 +50,7 @@ #include "bridged_t.h" // first_order + k_pi #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // Handclap band-pass, from the IC21 multiple-feedback filter (see header). IC21 is a @@ -218,4 +218,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_cowbell.h b/include/taptools/tr808_cowbell.h index 3787c09..6423cc2 100644 --- a/include/taptools/tr808_cowbell.h +++ b/include/taptools/tr808_cowbell.h @@ -38,7 +38,7 @@ #include "metal_bank.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // Two-slope envelope (see header): the fast C9 component and the R82/C34 tail. @@ -117,4 +117,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_cymbal.h b/include/taptools/tr808_cymbal.h index 76f9dbc..a0a4264 100644 --- a/include/taptools/tr808_cymbal.h +++ b/include/taptools/tr808_cymbal.h @@ -47,7 +47,7 @@ #include "metal_bank.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // Per-band decay time constants (behavioral fits to the p.14 chart; see header). @@ -156,4 +156,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_hat.h b/include/taptools/tr808_hat.h index ff34061..3dcacec 100644 --- a/include/taptools/tr808_hat.h +++ b/include/taptools/tr808_hat.h @@ -37,7 +37,7 @@ #include "metal_bank.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // Decay classes: chart fits for the OH span (90/450/600 ms); CH calibrated to the @@ -183,4 +183,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_kick.h b/include/taptools/tr808_kick.h index 5c583dc..55e5ab3 100644 --- a/include/taptools/tr808_kick.h +++ b/include/taptools/tr808_kick.h @@ -65,7 +65,7 @@ #include "bridged_t.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // TR-808 Service Notes component values (bass drum voice, schematic designators). @@ -295,4 +295,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_rim.h b/include/taptools/tr808_rim.h index 539d73f..d50518c 100644 --- a/include/taptools/tr808_rim.h +++ b/include/taptools/tr808_rim.h @@ -40,7 +40,7 @@ #include "bridged_t.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // p.14 chart voicings. @@ -185,4 +185,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_snare.h b/include/taptools/tr808_snare.h index 390d54c..306d501 100644 --- a/include/taptools/tr808_snare.h +++ b/include/taptools/tr808_snare.h @@ -58,7 +58,7 @@ #include "bridged_t.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // Service Notes schematic values (snare drum voice). Later-revision arm capacitors — @@ -242,4 +242,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/tr808_tom.h b/include/taptools/tr808_tom.h index 79f1c32..2186c9a 100644 --- a/include/taptools/tr808_tom.h +++ b/include/taptools/tr808_tom.h @@ -45,7 +45,7 @@ #include "bridged_t.h" #include "swing_vca.h" -namespace taptools { +namespace tap::tools { namespace tr808 { // p.14 chart tuning spans [low, high] in Hz per size; decay classes calibrated to @@ -232,4 +232,4 @@ namespace taptools { }; } // namespace tr808 -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/vca.h b/include/taptools/vca.h index 86681bf..e6a6d75 100644 --- a/include/taptools/vca.h +++ b/include/taptools/vca.h @@ -36,7 +36,7 @@ #include #include -namespace taptools { +namespace tap::tools { /// Selectable-circuit gain stage: linear multiply, or the 303's class-A transistor saturator. class vca { @@ -142,4 +142,4 @@ namespace taptools { dc_hp m_dc; }; -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/vco.h b/include/taptools/vco.h index 70167b2..6be91bb 100644 --- a/include/taptools/vco.h +++ b/include/taptools/vco.h @@ -54,7 +54,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace vco { constexpr int k_presets = 16; @@ -551,4 +551,4 @@ namespace taptools { }; } // namespace vco -} // namespace taptools +} // namespace tap::tools diff --git a/include/taptools/vocoder.h b/include/taptools/vocoder.h index a22d0ab..4c3d4e4 100644 --- a/include/taptools/vocoder.h +++ b/include/taptools/vocoder.h @@ -19,7 +19,7 @@ #include #include -namespace taptools { +namespace tap::tools { namespace vocoder { class bank { @@ -152,4 +152,4 @@ namespace taptools { }; } // namespace vocoder -} // namespace taptools +} // namespace tap::tools diff --git a/tests/autowah_test.cpp b/tests/autowah_test.cpp index c9e22e9..fc14736 100644 --- a/tests/autowah_test.cpp +++ b/tests/autowah_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the envelope-filter kernel (taptools::autowah::wah_filter). +/// @brief Unit tests for the envelope-filter kernel (tap::tools::autowah::wah_filter). /// @details Pins the behaviors that define the Snow White model: follower attack/decay timing, /// the exponential sweep law and its ceiling, upward (and inverted) sweep motion on a /// burst, the sensitivity-off "cocked wah" equivalence against a bare svf_filter, Q @@ -19,7 +19,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - namespace wah = taptools::autowah; + namespace wah = tap::tools::autowah; double sine(int t, double f, double sr = k_sr) { return std::sin(2.0 * k_pi * f * t / sr); @@ -161,11 +161,11 @@ SCENARIO("sensitivity at the floor is the cocked-wah: bit-close to a bare svf at w.set_bias(800.0); w.set_resonance(0.7); - taptools::svf::svf_filter ref; + tap::tools::svf::svf_filter ref; ref.prepare(k_sr, 1); ref.set_smooth_ms(0.0); ref.set_order(2); - ref.set_mode(taptools::svf::mode_lowpass); + ref.set_mode(tap::tools::svf::mode_lowpass); ref.set_resonance(0.7); double maxerr = 0.0; diff --git a/tests/conv_engine_test.cpp b/tests/conv_engine_test.cpp index f852dc3..ce82235 100644 --- a/tests/conv_engine_test.cpp +++ b/tests/conv_engine_test.cpp @@ -1,6 +1,6 @@ /// @file /// @brief Unit tests for the partitioned convolution engine behind tap.convolve~. -/// @details `taptools::conv_engine` is a pure-C++ kernel, so these tests drive it directly — no +/// @details `tap::tools::conv_engine` is a pure-C++ kernel, so these tests drive it directly — no /// Max, min-api, or mock kernel needed — and check its output against a plain /// time-domain convolution computed here as the reference. // SPDX-License-Identifier: BSD-3-Clause @@ -48,7 +48,7 @@ SCENARIO("the engine reproduces a true-stereo convolution, latency-shifted by on const int len = 40; // IR length -> 3 partitions const int n = 300; // signal length - taptools::conv_engine engine; + tap::tools::conv_engine engine; engine.configure(B, Pmax); GIVEN("four distinct IR paths and two distinct input channels") { @@ -113,7 +113,7 @@ SCENARIO("a delayed unit impulse on one path is a pure delay on that path only") const int B = 8; const int Pmax = 8; - taptools::conv_engine engine; + tap::tools::conv_engine engine; engine.configure(B, Pmax); GIVEN("h_ll = delta at index 5, all other paths silent") { @@ -151,7 +151,7 @@ SCENARIO("a delayed unit impulse on one path is a pure delay on that path only") } SCENARIO("with no IR loaded the engine is silent") { - taptools::conv_engine engine; + tap::tools::conv_engine engine; engine.configure(32, 4); REQUIRE(engine.has_ir() == false); @@ -174,7 +174,7 @@ SCENARIO("a hot IR swap while running settles to the new response") { const int B = 16; const int Pmax = 8; - taptools::conv_engine engine; + tap::tools::conv_engine engine; engine.configure(B, Pmax); GIVEN("an initial decaying IR on the diagonal paths, running mid-stream") { diff --git a/tests/diode_ladder_test.cpp b/tests/diode_ladder_test.cpp index a775936..88644b7 100644 --- a/tests/diode_ladder_test.cpp +++ b/tests/diode_ladder_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the diode-ladder kernel (taptools::diode::diode_filter). +/// @brief Unit tests for the diode-ladder kernel (tap::tools::diode::diode_filter). /// @details Pins the topology against Tim Stinchcombe's published TB-303 analysis: the exact /// normalized magnitude response (|D(j*2^(1/4))| = 17 at fc, the ~14 dB first octave, /// the 24 dB/oct asymptote), the k = 17 / sqrt(2)-rate oscillation results, the @@ -20,7 +20,7 @@ namespace { constexpr double k_pi = 3.14159265358979323846; - namespace dio = taptools::diode; + namespace dio = tap::tools::diode; dio::diode_filter make(double sr = 48000.0) { dio::diode_filter f; diff --git a/tests/fft_test.cpp b/tests/fft_test.cpp index 900150d..5ea7a30 100644 --- a/tests/fft_test.cpp +++ b/tests/fft_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the shared radix-2 FFT (taptools::fft::transform). +/// @brief Unit tests for the shared radix-2 FFT (tap::tools::fft::transform). /// @details Checks the forward transform against a naive O(N^2) DFT, forward→inverse /// reconstruction, linearity of the convention (forward unscaled, inverse /N), and a /// couple of closed-form cases (impulse → flat spectrum, single cosine → two bins). @@ -16,7 +16,7 @@ namespace { constexpr double k_pi = 3.14159265358979323846; - // Naive O(N^2) DFT reference, same sign convention as taptools::fft (forward: exp(-i...)). + // Naive O(N^2) DFT reference, same sign convention as tap::tools::fft (forward: exp(-i...)). void naive_dft(const std::vector& re, const std::vector& im, std::vector& ore, std::vector& oim) { const int n = static_cast(re.size()); @@ -63,7 +63,7 @@ SCENARIO("the forward FFT matches a naive DFT") { naive_dft(re, im, ref_re, ref_im); std::vector fre = re, fim = im; - taptools::fft::transform(fre, fim, false); + tap::tools::fft::transform(fre, fim, false); THEN("the outputs agree to within numerical tolerance") { REQUIRE(max_abs_diff(fre, ref_re) < 1e-9); @@ -78,8 +78,8 @@ SCENARIO("forward followed by inverse reconstructs the input") { std::vector re = noise(n, 7u), im = noise(n, 8u); const std::vector re0 = re, im0 = im; - taptools::fft::transform(re, im, false); - taptools::fft::transform(re, im, true); + tap::tools::fft::transform(re, im, false); + tap::tools::fft::transform(re, im, true); THEN("the round trip returns the original (inverse divides by N)") { REQUIRE(max_abs_diff(re, re0) < 1e-9); @@ -91,7 +91,7 @@ SCENARIO("a unit impulse transforms to a flat unit spectrum") { const int n = 16; std::vector re(n, 0.0), im(n, 0.0); re[0] = 1.0; - taptools::fft::transform(re, im, false); + tap::tools::fft::transform(re, im, false); bool flat = true; for (int k = 0; k < n; ++k) { if (std::abs(re[k] - 1.0) > 1e-12 || std::abs(im[k]) > 1e-12) { @@ -108,7 +108,7 @@ SCENARIO("a real cosine lands on the two symmetric bins") { for (int t = 0; t < n; ++t) { re[t] = std::cos(2.0 * k_pi * freq * t / n); } - taptools::fft::transform(re, im, false); + tap::tools::fft::transform(re, im, false); THEN("energy is N/2 at bin freq and N-freq, ~0 elsewhere") { REQUIRE(std::abs(re[freq] - n / 2.0) < 1e-9); diff --git a/tests/grm_comb_test.cpp b/tests/grm_comb_test.cpp index 0f80b91..5fefa92 100644 --- a/tests/grm_comb_test.cpp +++ b/tests/grm_comb_test.cpp @@ -21,7 +21,7 @@ namespace { constexpr double k_sr = 48000.0; - namespace fc = taptools::fivecomb; + namespace fc = tap::tools::fivecomb; fc::comb_bank make_single_voice(double freq, double res, double lp) { fc::comb_bank bank; diff --git a/tests/nr_test.cpp b/tests/nr_test.cpp index a9419e3..e56e623 100644 --- a/tests/nr_test.cpp +++ b/tests/nr_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the spectral noise-reduction kernel (taptools::nr::reducer). +/// @brief Unit tests for the spectral noise-reduction kernel (tap::tools::nr::reducer). /// @details Exercises the three behaviours that define the object: with the gate open the STFT /// perfectly reconstructs the input (delayed by one frame); a tone below the threshold /// is strongly attenuated; a tone above it passes through. @@ -46,8 +46,8 @@ namespace { } // namespace SCENARIO("with the gate open the STFT reconstructs the input, delayed by one frame") { - const int N = 256; - taptools::nr::reducer r; + const int N = 256; + tap::tools::nr::reducer r; r.configure(N); r.set_threshold(0.0); // gate disabled → identity spectral op @@ -74,8 +74,8 @@ SCENARIO("with the gate open the STFT reconstructs the input, delayed by one fra } SCENARIO("a tone below the threshold is strongly attenuated") { - const int N = 512; - taptools::nr::reducer r; + const int N = 512; + tap::tools::nr::reducer r; r.configure(N); r.set_threshold(0.5); // high threshold r.set_slope(4.0); @@ -98,8 +98,8 @@ SCENARIO("a tone below the threshold is strongly attenuated") { } SCENARIO("a tone above the threshold passes through") { - const int N = 512; - taptools::nr::reducer r; + const int N = 512; + tap::tools::nr::reducer r; r.configure(N); r.set_threshold(0.01); // low threshold r.set_slope(4.0); diff --git a/tests/spectra_test.cpp b/tests/spectra_test.cpp index 222dddf..3da1e71 100644 --- a/tests/spectra_test.cpp +++ b/tests/spectra_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the spectral-remapping kernel (taptools::spectra::remapper). +/// @brief Unit tests for the spectral-remapping kernel (tap::tools::spectra::remapper). /// @details remap = 1 reconstructs the input (delayed by one frame); remap = 2 relocates a tone /// at input bin 2k to output bin k (checked by transforming the steady-state output). // SPDX-License-Identifier: BSD-3-Clause @@ -37,7 +37,7 @@ namespace { // Peak magnitude bin of an N-sample slice of `sig` starting at `off` (rectangular window). int peak_bin(const std::vector& sig, int off, int N) { std::vector re(sig.begin() + off, sig.begin() + off + N), im(N, 0.0); - taptools::fft::transform(re, im, false); + tap::tools::fft::transform(re, im, false); int best = 0; double bestmag = -1.0; for (int k = 1; k <= N / 2; ++k) { @@ -53,8 +53,8 @@ namespace { } // namespace SCENARIO("remap = 1 reconstructs the input, delayed by one frame") { - const int N = 256; - taptools::spectra::remapper r; + const int N = 256; + tap::tools::spectra::remapper r; r.configure(N); r.set_remap(1.0); @@ -76,8 +76,8 @@ SCENARIO("remap = 1 reconstructs the input, delayed by one frame") { } SCENARIO("remap = 2 relocates input bin 2k to output bin k") { - const int N = 512; - taptools::spectra::remapper r; + const int N = 512; + tap::tools::spectra::remapper r; r.configure(N); r.set_remap(2.0); diff --git a/tests/step_seq_test.cpp b/tests/step_seq_test.cpp index 7df6e27..c5fc8e1 100644 --- a/tests/step_seq_test.cpp +++ b/tests/step_seq_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the shared step-sequencer engine (taptools::seq). +/// @brief Unit tests for the shared step-sequencer engine (tap::tools::seq). /// @details Pins the plans/tap.seq.md contract: sample-accurate step derivation from a /// phase ramp, the swing warp, polymeter off one ramp, reverse phase, the /// trigger row's amplitude-as-accent impulses with re-arming gaps, the note @@ -22,9 +22,9 @@ namespace { constexpr double k_freq = 2.0; // pattern cycles per second constexpr int k_cycle = static_cast(k_sr / k_freq); - using taptools::seq::engine; - using taptools::seq::note_row; - using taptools::seq::trigger_row; + using tap::tools::seq::engine; + using tap::tools::seq::note_row; + using tap::tools::seq::trigger_row; double phase_at(int n) { const double p = static_cast(n) * (k_freq / k_sr); @@ -127,8 +127,8 @@ SCENARIO("the trigger row emits velocities as amplitudes and rests as nothing") trigger_row row; row.prepare(k_sr); auto& p = row.clock().data(); - p.steps[0].velocity = taptools::seq::k_trig_plain; - p.steps[4].velocity = taptools::seq::k_trig_accented; + p.steps[0].velocity = tap::tools::seq::k_trig_plain; + p.steps[4].velocity = tap::tools::seq::k_trig_accented; p.steps[8].velocity = 1.0; // full 14 V accent int fired = 0; @@ -220,7 +220,7 @@ SCENARIO("the note row opens at the step start and closes at the gate duty") { prev = o.gate; } CHECK(near(rise, 0)); - CHECK(near(fall, static_cast(step_len * taptools::seq::k_gate_duty), 2)); + CHECK(near(fall, static_cast(step_len * tap::tools::seq::k_gate_duty), 2)); } SCENARIO("accented steps gate at 2.0, plain at 1.0") { @@ -240,8 +240,8 @@ SCENARIO("accented steps gate at 2.0, plain at 1.0") { if (k == 2) accented = std::max(accented, o.gate); } - CHECK(plain == taptools::seq::k_gate_plain); - CHECK(accented == taptools::seq::k_gate_accent); + CHECK(plain == tap::tools::seq::k_gate_plain); + CHECK(accented == tap::tools::seq::k_gate_accent); } SCENARIO("a slide step holds the gate through the boundary while the pitch steps") { @@ -384,7 +384,7 @@ SCENARIO("recall quantize now applies immediately") { e.data().steps[0].velocity = 0.5; e.store(0); e.data().steps[0].velocity = 1.0; - e.set_quantize(taptools::seq::quantize_now); + e.set_quantize(tap::tools::seq::quantize_now); e.recall(0); CHECK(e.data().steps[0].velocity == 0.5); CHECK(e.armed() == -1); @@ -424,7 +424,7 @@ SCENARIO("the note row drives the tb303 voice: slid steps glide, plain steps ret p.steps[4].gate = true; p.steps[4].pitch = 33.0; - taptools::tb303::voice v; + tap::tools::tb303::voice v; v.prepare(k_sr); // The tap.303~ wrapper loop, verbatim. diff --git a/tests/tb303_voice_test.cpp b/tests/tb303_voice_test.cpp index 09a6709..24a1c66 100644 --- a/tests/tb303_voice_test.cpp +++ b/tests/tb303_voice_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TB-303 voice kernel (taptools::tb303::voice). +/// @brief Unit tests for the TB-303 voice kernel (tap::tools::tb303::voice). /// @details Pins the slice-2 voice behaviors: gate/retrigger/legato-slide semantics (the /// melodic-voice contract), pitch and tuning accuracy, the envelope-modulated /// cutoff sweep and its decay-knob scaling, the fixed VCA envelope, the accent @@ -23,7 +23,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - namespace tb = taptools::tb303; + namespace tb = tap::tools::tb303; tb::voice make() { tb::voice v; diff --git a/tests/tr808_clap_test.cpp b/tests/tr808_clap_test.cpp index 5ef888c..c5815e0 100644 --- a/tests/tr808_clap_test.cpp +++ b/tests/tr808_clap_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 handclap/maracas kernel (taptools::tr808::clap). +/// @brief Unit tests for the TR-808 handclap/maracas kernel (tap::tools::tr808::clap). /// @details Pins the Service Notes documentation: the clap's three sawtooth teeth ~10 ms /// apart inside the 30 ms window (Figure 13), the reverberation tail and its /// disconnection bend, the ~2 kHz band-pass voicing, the ~100 ms decay class; @@ -19,7 +19,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::clap; + using tap::tools::tr808::clap; clap make(int model = clap::model_clap) { clap c; diff --git a/tests/tr808_cowbell_test.cpp b/tests/tr808_cowbell_test.cpp index 78c42c3..5b4ebe4 100644 --- a/tests/tr808_cowbell_test.cpp +++ b/tests/tr808_cowbell_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 cowbell kernel (taptools::tr808::cowbell). +/// @brief Unit tests for the TR-808 cowbell kernel (tap::tools::tr808::cowbell). /// @details Pins the documented behaviors: the 540/800 Hz oscillator pair (the chart's own /// values), the ~50 ms decay class with the two-slope "abrupt initial decay" /// envelope, accent, determinism, silence. @@ -17,7 +17,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::cowbell; + using tap::tools::tr808::cowbell; cowbell make() { cowbell c; diff --git a/tests/tr808_cymbal_test.cpp b/tests/tr808_cymbal_test.cpp index 3180ead..995ca35 100644 --- a/tests/tr808_cymbal_test.cpp +++ b/tests/tr808_cymbal_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 cymbal kernel (taptools::tr808::cymbal), plus the +/// @brief Unit tests for the TR-808 cymbal kernel (tap::tools::tr808::cymbal), plus the /// shared metal bank it exposes. /// @details Pins the documented behaviors: the bank's six oscillator fundamentals and the /// tolerance/seed spread, the p.14 chart's 350-1200 ms decay range across the @@ -19,8 +19,8 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::cymbal; - using taptools::tr808::metal_bank; + using tap::tools::tr808::cymbal; + using tap::tools::tr808::metal_bank; cymbal make(double tone = 0.5, double decay = 0.5) { cymbal c; @@ -86,7 +86,7 @@ SCENARIO("the metal bank runs six squares at the documented fundamentals") { v = bank.sum(); } // Each nominal fundamental beats everything a quartertone away. - for (double f : taptools::tr808::k_bank_hz) { + for (double f : tap::tools::tr808::k_bank_hz) { const double at = goertzel(y, f, 0, y.size()); const double off = goertzel(y, f * 1.06, 0, y.size()); INFO(f << " Hz: " << at << " vs +6% " << off); diff --git a/tests/tr808_hat_test.cpp b/tests/tr808_hat_test.cpp index 7cf9882..f42b592 100644 --- a/tests/tr808_hat_test.cpp +++ b/tests/tr808_hat_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 hi-hat kernel (taptools::tr808::hat). +/// @brief Unit tests for the TR-808 hi-hat kernel (tap::tools::tr808::hat). /// @details Pins the documented behaviors: the closed hat's fixed ~50 ms class, the open /// hat's 90-600 ms decay-pot range, the hardware choke (a CH trigger terminates a /// sounding OH), per-path levels, accent, determinism, silence. @@ -16,7 +16,7 @@ namespace { constexpr double k_sr = 48000.0; - using taptools::tr808::hat; + using tap::tools::tr808::hat; hat make(double decay = 0.5) { hat h; diff --git a/tests/tr808_kick_test.cpp b/tests/tr808_kick_test.cpp index 21a4214..e0dcd8a 100644 --- a/tests/tr808_kick_test.cpp +++ b/tests/tr808_kick_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 bass drum kernel (taptools::tr808::kick). +/// @brief Unit tests for the TR-808 bass drum kernel (tap::tools::tr808::kick). /// @details Pins the behaviors the DAFx-14 analysis documents: the ~49 Hz nominal ring, the /// attack frequency jump (~an octave-plus for the first few ms), the pitch sigh (and /// its disconnection bend), decay-knob monotonicity and range, accent as excitation @@ -19,7 +19,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::kick; + using tap::tools::tr808::kick; kick make(double decay = 0.5, double tone = 0.5, double level = 1.0) { kick k; diff --git a/tests/tr808_rim_test.cpp b/tests/tr808_rim_test.cpp index 84b282a..fdf092d 100644 --- a/tests/tr808_rim_test.cpp +++ b/tests/tr808_rim_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 rimshot/claves kernel (taptools::tr808::rim). +/// @brief Unit tests for the TR-808 rimshot/claves kernel (tap::tools::tr808::rim). /// @details Pins the p.14 chart: the rimshot's ~1667 + ~455 Hz pair in the ~10 ms class /// (with the VCA's harmonic generation), the claves' pure ~2500 Hz ~25 ms tick, /// accent, determinism, silence. @@ -17,7 +17,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::rim; + using tap::tools::tr808::rim; rim make(int model = rim::model_rimshot) { rim r; diff --git a/tests/tr808_snare_test.cpp b/tests/tr808_snare_test.cpp index 57d562c..74772b7 100644 --- a/tests/tr808_snare_test.cpp +++ b/tests/tr808_snare_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 snare drum kernel (taptools::tr808::snare). +/// @brief Unit tests for the TR-808 snare drum kernel (tap::tools::tr808::snare). /// @details Pins the Service Notes documentation: the two resonators near the late-revision /// 173/336 Hz pair, the VR8 tone crossfade, the VR9 snappy noise path (bright, /// enveloped, ~60 ms-class decay per the p.14 chart), accent monotonicity, seeded @@ -18,7 +18,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::snare; + using tap::tools::tr808::snare; snare make(double tone = 0.5, double snappy = 0.5) { snare s; diff --git a/tests/tr808_tom_test.cpp b/tests/tr808_tom_test.cpp index 50f5e90..2c8d6b1 100644 --- a/tests/tr808_tom_test.cpp +++ b/tests/tr808_tom_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the TR-808 tom/conga kernel (taptools::tr808::tom). +/// @brief Unit tests for the TR-808 tom/conga kernel (tap::tools::tr808::tom). /// @details Pins the p.14 chart tunings and decay classes per size/model, the tuning knob's /// low..high sweep, the D80/D81 attack pitch fall, the tom-only noise layer, /// accent, determinism, silence. @@ -17,7 +17,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - using taptools::tr808::tom; + using tap::tools::tr808::tom; tom make(int size = 0, int model = tom::model_tom, double tuning = 0.5) { tom t; diff --git a/tests/vca_test.cpp b/tests/vca_test.cpp index d056643..34b723c 100644 --- a/tests/vca_test.cpp +++ b/tests/vca_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the VCA kernel (taptools::vca). +/// @brief Unit tests for the VCA kernel (tap::tools::vca). /// @details Pins the two-circuit contract: `clean` is an exact linear multiply; `warm` is the /// 303's slope-normalized biased-tanh transistor stage — unity slope through zero /// (quiet signals near-clean), asymmetric even-harmonic saturation and compression on @@ -46,9 +46,9 @@ namespace { } // namespace SCENARIO("the clean circuit is an exact linear multiply") { - taptools::vca a; + tap::tools::vca a; a.prepare(k_sr); - REQUIRE(a.circuit() == taptools::vca::mode_clean); // default + REQUIRE(a.circuit() == tap::tools::vca::mode_clean); // default THEN("process(x, gain) == x * gain to the bit, for any gain incl. negative and > 1") { for (double g : {0.0, 0.5, 1.0, 2.5, -0.75}) { @@ -64,11 +64,11 @@ SCENARIO("the clean circuit is an exact linear multiply") { } SCENARIO("the warm circuit reproduces the 303 transistor saturator exactly") { - taptools::vca a; + tap::tools::vca a; a.prepare(k_sr); - a.set_mode(taptools::vca::mode_warm); - REQUIRE(a.drive() == taptools::vca::k_default_drive); // stock 303 constants - REQUIRE(a.bias() == taptools::vca::k_default_bias); + a.set_mode(tap::tools::vca::mode_warm); + REQUIRE(a.drive() == tap::tools::vca::k_default_drive); // stock 303 constants + REQUIRE(a.bias() == tap::tools::vca::k_default_bias); THEN("shape(v) matches the closed-form reference at the stock constants, bit for bit") { for (double v : {-1.2, -0.5, -0.1, 0.0, 0.1, 0.5, 1.0, 1.7}) { @@ -91,7 +91,7 @@ SCENARIO("the warm circuit reproduces the 303 transistor saturator exactly") { } SCENARIO("the extraction left the TB-303 voice routed through the shared stage") { - namespace tb = taptools::tb303; + namespace tb = tap::tools::tb303; auto play = [](int mode) { tb::voice v; @@ -119,9 +119,9 @@ SCENARIO("the extraction left the TB-303 voice routed through the shared stage") SCENARIO("the warm circuit's output DC block sheds signal-dependent DC on AC material") { auto run = [](bool dc_block) { - taptools::vca a; + tap::tools::vca a; a.prepare(k_sr); - a.set_mode(taptools::vca::mode_warm); + a.set_mode(tap::tools::vca::mode_warm); a.set_dc_block(dc_block); std::vector out; out.reserve(static_cast(k_sr)); @@ -146,25 +146,25 @@ SCENARIO("the warm circuit's output DC block sheds signal-dependent DC on AC mat SCENARIO("the swing circuit is the TR-808 symmetric harmonic saturator") { THEN("swing_shape is the exact linear passthru at drive 0 (calibrated voices stay bit-identical)") { for (double v : {-1.3, -0.4, 0.0, 0.25, 0.9, 1.6}) - REQUIRE(taptools::vca::swing_shape(v, 0.0) == v); + REQUIRE(tap::tools::vca::swing_shape(v, 0.0) == v); } THEN("with drive > 0 it is an odd function — symmetric, no even harmonics, no DC") { for (double d : {0.5, 2.0, 6.0}) for (double v : {0.15, 0.6, 1.2}) - REQUIRE(std::abs(taptools::vca::swing_shape(v, d) + taptools::vca::swing_shape(-v, d)) < 1e-12); + REQUIRE(std::abs(tap::tools::vca::swing_shape(v, d) + tap::tools::vca::swing_shape(-v, d)) < 1e-12); } THEN("unity slope through zero (quiet signals near-clean) and compression on hot signals") { const double d = 2.0; - REQUIRE(std::abs(taptools::vca::swing_shape(1e-4, d) - 1e-4) < 1e-7); - REQUIRE(std::abs(taptools::vca::swing_shape(1.5, d)) < 1.5); + REQUIRE(std::abs(tap::tools::vca::swing_shape(1e-4, d) - 1e-4) < 1e-7); + REQUIRE(std::abs(tap::tools::vca::swing_shape(1.5, d)) < 1.5); } GIVEN("a vca in swing mode") { - taptools::vca a; + tap::tools::vca a; a.prepare(k_sr); - a.set_mode(taptools::vca::mode_swing); + a.set_mode(tap::tools::vca::mode_swing); a.set_drive(2.0); THEN("shape() routes through the shared swing_shape and needs no DC block (symmetric)") { - REQUIRE(a.shape(0.7) == taptools::vca::swing_shape(0.7, a.drive())); + REQUIRE(a.shape(0.7) == tap::tools::vca::swing_shape(0.7, a.drive())); // a symmetric shaper on a symmetric sweep has zero mean either way double mean_on = 0.0; int n = 0; @@ -176,9 +176,9 @@ SCENARIO("the swing circuit is the TR-808 symmetric harmonic saturator") { } SCENARIO("drive and bias are live and reshape the curve") { - taptools::vca a; + tap::tools::vca a; a.prepare(k_sr); - a.set_mode(taptools::vca::mode_warm); + a.set_mode(tap::tools::vca::mode_warm); THEN("more drive means more compression on a hot signal") { a.set_drive(1.0); diff --git a/tests/vco_test.cpp b/tests/vco_test.cpp index c6f5283..901b91a 100644 --- a/tests/vco_test.cpp +++ b/tests/vco_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the vco kernel's analog-character section (taptools::vco::vco_osc). +/// @brief Unit tests for the vco kernel's analog-character section (tap::tools::vco::vco_osc). /// @details Pins the four analog upgrades added 2026-07-15 — waveform imperfection (saw /// curvature + corner rounding, triangle asymmetry, seeded pulse-width tolerance), /// fast pitch jitter, V/oct tracking error — plus the invariant that makes them safe: @@ -19,7 +19,7 @@ namespace { constexpr double k_sr = 48000.0; constexpr double k_pi = 3.14159265358979323846; - namespace vco = taptools::vco; + namespace vco = tap::tools::vco; vco::vco_osc make(uint32_t seed = 1) { vco::vco_osc o; diff --git a/tests/vocoder_test.cpp b/tests/vocoder_test.cpp index 3ef38c1..3e45288 100644 --- a/tests/vocoder_test.cpp +++ b/tests/vocoder_test.cpp @@ -1,5 +1,5 @@ /// @file -/// @brief Unit tests for the channel-vocoder kernel (taptools::vocoder::bank). +/// @brief Unit tests for the channel-vocoder kernel (tap::tools::vocoder::bank). /// @details Checks the structural invariants: a silent carrier yields silence; makeup gain /// scales the output linearly; a silent modulator lets the per-band envelopes decay to /// silence; and processing is deterministic. @@ -23,7 +23,7 @@ namespace { } // namespace SCENARIO("a silent carrier yields a silent output regardless of the modulator") { - taptools::vocoder::bank v; + tap::tools::vocoder::bank v; v.prepare(48000.0); double peak = 0.0; @@ -35,7 +35,7 @@ SCENARIO("a silent carrier yields a silent output regardless of the modulator") } SCENARIO("makeup gain scales the output linearly") { - taptools::vocoder::bank a, b; + tap::tools::vocoder::bank a, b; a.prepare(48000.0); b.prepare(48000.0); a.set_gain(1.0); @@ -53,7 +53,7 @@ SCENARIO("makeup gain scales the output linearly") { } SCENARIO("a silent modulator lets the output decay to silence") { - taptools::vocoder::bank v; + tap::tools::vocoder::bank v; v.prepare(48000.0); v.set_response_ms(20.0); @@ -80,7 +80,7 @@ SCENARIO("a silent modulator lets the output decay to silence") { SCENARIO("processing is deterministic") { auto run = []() { - taptools::vocoder::bank v; + tap::tools::vocoder::bank v; v.prepare(44100.0); v.set_q(30.0); std::vector out; diff --git a/tools/capi/taptools_capi.cpp b/tools/capi/taptools_capi.cpp index 091ad99..4cfe6de 100644 --- a/tools/capi/taptools_capi.cpp +++ b/tools/capi/taptools_capi.cpp @@ -16,7 +16,7 @@ #include #include -using taptools::conv_engine; +using tap::tools::conv_engine; extern "C" { @@ -91,7 +91,7 @@ extern "C" { // ---- tap.svf~ ---------------------------------------------------------------------------------- -using taptools::svf::svf_filter; +using tap::tools::svf::svf_filter; taptools_svf taptools_svf_create(void) { return static_cast(new svf_filter()); @@ -151,7 +151,7 @@ int taptools_svf_process_mod(taptools_svf h, const double* in, const double* cut // ---- tap.ladder~ ------------------------------------------------------------------------------- -using taptools::ladder::ladder_filter; +using tap::tools::ladder::ladder_filter; taptools_ladder taptools_ladder_create(void) { return static_cast(new ladder_filter()); @@ -207,7 +207,7 @@ int taptools_ladder_process_mod(taptools_ladder h, const double* in, const doubl // ---- tap.vco~ ---------------------------------------------------------------------------------- -using taptools::vco::vco_osc; +using tap::tools::vco::vco_osc; taptools_vco taptools_vco_create(void) { return static_cast(new vco_osc()); @@ -255,7 +255,7 @@ int taptools_vco_process_mod(taptools_vco h, const double* fm_hz, const double* // ---- tap.diode~ -------------------------------------------------------------------------------- -using taptools::diode::diode_filter; +using tap::tools::diode::diode_filter; taptools_diode taptools_diode_create(void) { return static_cast(new diode_filter()); @@ -310,7 +310,7 @@ int taptools_diode_process_mod(taptools_diode h, const double* in, const double* // ---- tap.303~ ---------------------------------------------------------------------------------- -using tb303_voice = taptools::tb303::voice; +using tb303_voice = tap::tools::tb303::voice; taptools_tb303 taptools_tb303_create(void) { return static_cast(new tb303_voice()); @@ -389,7 +389,7 @@ int taptools_tb303_process(taptools_tb303 h, double* out, int n) { // ---- tap.autowah~ ------------------------------------------------------------------------------ -using taptools::autowah::wah_filter; +using tap::tools::autowah::wah_filter; taptools_wah taptools_wah_create(void) { return static_cast(new wah_filter()); @@ -448,7 +448,7 @@ int taptools_wah_process(taptools_wah h, const double* in, const double* key, do // ---- tap.808.seq~ ------------------------------------------------------------------------------ -using seq_trigger = taptools::seq::trigger_row; +using seq_trigger = tap::tools::seq::trigger_row; taptools_seqtrig taptools_seqtrig_create(void) { return static_cast(new seq_trigger()); @@ -479,7 +479,7 @@ int taptools_seqtrig_set_pulse_ms(taptools_seqtrig h, double ms) { } int taptools_seqtrig_set_step(taptools_seqtrig h, int step, double velocity) { - if (step < 0 || step >= taptools::seq::k_max_steps) { + if (step < 0 || step >= tap::tools::seq::k_max_steps) { return -1; } return with(h, [&](seq_trigger& r) { r.clock().data().steps[step].velocity = velocity; }); @@ -510,7 +510,7 @@ int taptools_seqtrig_process(taptools_seqtrig h, const double* phase, double* ou // ---- tap.303.seq~ ------------------------------------------------------------------------------ -using seq_note = taptools::seq::note_row; +using seq_note = tap::tools::seq::note_row; taptools_seqnote taptools_seqnote_create(void) { return static_cast(new seq_note()); @@ -541,7 +541,7 @@ int taptools_seqnote_set_transpose(taptools_seqnote h, double semitones) { } int taptools_seqnote_set_step(taptools_seqnote h, int step, double pitch, int gate, int accent, int slide) { - if (step < 0 || step >= taptools::seq::k_max_steps) { + if (step < 0 || step >= tap::tools::seq::k_max_steps) { return -1; } return with(h, [&](seq_note& r) { @@ -580,7 +580,7 @@ int taptools_seqnote_process(taptools_seqnote h, const double* phase, double* pi // ---- tap.808.kick~ ----------------------------------------------------------------------------- -using tr808_kick = taptools::tr808::kick; +using tr808_kick = tap::tools::tr808::kick; taptools_kick taptools_kick_create(void) { return static_cast(new tr808_kick()); diff --git a/tools/capi/taptools_capi.h b/tools/capi/taptools_capi.h index d30d442..8ba7b41 100644 --- a/tools/capi/taptools_capi.h +++ b/tools/capi/taptools_capi.h @@ -52,7 +52,7 @@ TAPTOOLS_API int taptools_conv_block_size(taptools_conv engine); // partitio TAPTOOLS_API int taptools_conv_max_partitions(taptools_conv engine); // capacity in partitions TAPTOOLS_API int taptools_conv_has_ir(taptools_conv engine); // 1 if an IR is published, else 0 -// ---- tap.svf~ (taptools::svf::svf_filter, mono) ----------------------------------------------- +// ---- tap.svf~ (tap::tools::svf::svf_filter, mono) ----------------------------------------------- typedef void* taptools_svf; @@ -71,7 +71,7 @@ TAPTOOLS_API int taptools_svf_process(taptools_svf h, const double* in, TAPTOOLS_API int taptools_svf_process_mod(taptools_svf h, const double* in, const double* cutoff_hz, double* out, int n); -// ---- tap.ladder~ (taptools::ladder::ladder_filter) -------------------------------------------- +// ---- tap.ladder~ (tap::tools::ladder::ladder_filter) -------------------------------------------- typedef void* taptools_ladder; @@ -88,7 +88,7 @@ TAPTOOLS_API int taptools_ladder_process(taptools_ladder h, const do TAPTOOLS_API int taptools_ladder_process_mod(taptools_ladder h, const double* in, const double* cutoff_hz, double* out, int n); -// ---- tap.vco~ (taptools::vco::vco_osc) --------------------------------------------------------- +// ---- tap.vco~ (tap::tools::vco::vco_osc) --------------------------------------------------------- typedef void* taptools_vco; @@ -103,7 +103,7 @@ TAPTOOLS_API int taptools_vco_process(taptools_vco h, double* out, int /// Through-zero FM (Hz) and/or hard-sync inputs, either may be NULL. TAPTOOLS_API int taptools_vco_process_mod(taptools_vco h, const double* fm_hz, const double* sync, double* out, int n); -// ---- tap.diode~ (taptools::diode::diode_filter) ------------------------------------------------ +// ---- tap.diode~ (tap::tools::diode::diode_filter) ------------------------------------------------ typedef void* taptools_diode; @@ -119,7 +119,7 @@ TAPTOOLS_API int taptools_diode_process(taptools_diode h, const doubl TAPTOOLS_API int taptools_diode_process_mod(taptools_diode h, const double* in, const double* cutoff_hz, double* out, int n); -// ---- tap.303~ (taptools::tb303::voice) --------------------------------------------------------- +// ---- tap.303~ (tap::tools::tb303::voice) --------------------------------------------------------- typedef void* taptools_tb303; @@ -144,7 +144,7 @@ TAPTOOLS_API int taptools_tb303_set_pitch(taptools_tb303 h, double midi_note) TAPTOOLS_API double taptools_tb303_accent_charge(taptools_tb303 h); // the C13 wow memory, 0..~1 TAPTOOLS_API int taptools_tb303_process(taptools_tb303 h, double* out, int n); -// ---- tap.autowah~ (taptools::autowah::wah_filter) ---------------------------------------------- +// ---- tap.autowah~ (tap::tools::autowah::wah_filter) ---------------------------------------------- typedef void* taptools_wah; @@ -163,7 +163,7 @@ TAPTOOLS_API int taptools_wah_clear(taptools_wah h); TAPTOOLS_API int taptools_wah_process(taptools_wah h, const double* in, const double* key, double* out, double* env_out, double* cutoff_out, int n); -// ---- tap.808.seq~ (taptools::seq::trigger_row) ------------------------------------------------- +// ---- tap.808.seq~ (tap::tools::seq::trigger_row) ------------------------------------------------- typedef void* taptools_seqtrig; @@ -182,7 +182,7 @@ TAPTOOLS_API int taptools_seqtrig_reset(taptools_seqtrig h); /// Run n samples of the phase ramp through the row; impulses land in `out`. TAPTOOLS_API int taptools_seqtrig_process(taptools_seqtrig h, const double* phase, double* out, int n); -// ---- tap.303.seq~ (taptools::seq::note_row) ---------------------------------------------------- +// ---- tap.303.seq~ (tap::tools::seq::note_row) ---------------------------------------------------- typedef void* taptools_seqnote; @@ -203,7 +203,7 @@ TAPTOOLS_API int taptools_seqnote_reset(taptools_seqnote h); TAPTOOLS_API int taptools_seqnote_process(taptools_seqnote h, const double* phase, double* pitch_out, double* gate_out, int n); -// ---- tap.808.kick~ (taptools::tr808::kick) ----------------------------------------------------- +// ---- tap.808.kick~ (tap::tools::tr808::kick) ----------------------------------------------------- typedef void* taptools_kick; diff --git a/tools/render/autowah_render.cpp b/tools/render/autowah_render.cpp index f53a8ef..2f8130d 100644 --- a/tools/render/autowah_render.cpp +++ b/tools/render/autowah_render.cpp @@ -24,8 +24,8 @@ #include -using taptools::autowah::wah_filter; -namespace k = taptools::autowah; +using tap::tools::autowah::wah_filter; +namespace k = tap::tools::autowah; namespace { diff --git a/tools/render/diode_render.cpp b/tools/render/diode_render.cpp index af8f4a7..d000c14 100644 --- a/tools/render/diode_render.cpp +++ b/tools/render/diode_render.cpp @@ -17,7 +17,7 @@ #include -using taptools::diode::diode_filter; +using tap::tools::diode::diode_filter; namespace { diff --git a/tools/render/grm_comb_render.cpp b/tools/render/grm_comb_render.cpp index b1a84f4..1996f15 100644 --- a/tools/render/grm_comb_render.cpp +++ b/tools/render/grm_comb_render.cpp @@ -16,8 +16,8 @@ #include -using taptools::fivecomb::comb_bank; -namespace k = taptools::fivecomb; +using tap::tools::fivecomb::comb_bank; +namespace k = tap::tools::fivecomb; namespace { diff --git a/tools/render/grm_pitchaccum_render.cpp b/tools/render/grm_pitchaccum_render.cpp index 161bce5..5e1e206 100644 --- a/tools/render/grm_pitchaccum_render.cpp +++ b/tools/render/grm_pitchaccum_render.cpp @@ -15,8 +15,8 @@ #include -using taptools::pitchaccum::accum_bank; -namespace k = taptools::pitchaccum; +using tap::tools::pitchaccum::accum_bank; +namespace k = tap::tools::pitchaccum; namespace { diff --git a/tools/render/ladder_render.cpp b/tools/render/ladder_render.cpp index b7ea1a6..bf4da60 100644 --- a/tools/render/ladder_render.cpp +++ b/tools/render/ladder_render.cpp @@ -16,8 +16,8 @@ #include -using taptools::ladder::ladder_filter; -namespace k = taptools::ladder; +using tap::tools::ladder::ladder_filter; +namespace k = tap::tools::ladder; namespace { diff --git a/tools/render/tb303_render.cpp b/tools/render/tb303_render.cpp index be1a46e..7208384 100644 --- a/tools/render/tb303_render.cpp +++ b/tools/render/tb303_render.cpp @@ -17,8 +17,8 @@ #include -using taptools::tb303::voice; -namespace tb = taptools::tb303; +using tap::tools::tb303::voice; +namespace tb = tap::tools::tb303; namespace { diff --git a/tools/render/tr808_render.cpp b/tools/render/tr808_render.cpp index 715935e..06cfab7 100644 --- a/tools/render/tr808_render.cpp +++ b/tools/render/tr808_render.cpp @@ -37,7 +37,7 @@ #include #include -using namespace taptools::tr808; +using namespace tap::tools::tr808; namespace { diff --git a/tools/render/vco_render.cpp b/tools/render/vco_render.cpp index 4d835d2..e52f91e 100644 --- a/tools/render/vco_render.cpp +++ b/tools/render/vco_render.cpp @@ -16,8 +16,8 @@ #include -using taptools::vco::vco_osc; -namespace k = taptools::vco; +using tap::tools::vco::vco_osc; +namespace k = tap::tools::vco; namespace {