Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion bench/diode_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <taptools/diode_ladder.h>

namespace dio = taptools::diode;
namespace dio = tap::tools::diode;

namespace {

Expand Down
2 changes: 1 addition & 1 deletion bench/svf_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <taptools/svf.h>

namespace ksv = taptools::svf;
namespace ksv = tap::tools::svf;

namespace {

Expand Down
2 changes: 1 addition & 1 deletion book/src/machine/autowah.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion book/src/machine/comb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion book/src/machine/pitchaccum.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions include/taptools/autowah.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

#include "svf.h"

namespace taptools {
namespace tap::tools {
namespace autowah {

constexpr double k_pi = 3.14159265358979323846;
Expand Down Expand Up @@ -480,4 +480,4 @@ namespace taptools {
};

} // namespace autowah
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/bridged_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <algorithm>
#include <cmath>

namespace taptools {
namespace tap::tools {
namespace tr808 {

constexpr double k_pi = 3.14159265358979323846;
Expand Down Expand Up @@ -200,4 +200,4 @@ namespace taptools {
};

} // namespace tr808
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/conv_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -231,4 +231,4 @@ namespace taptools {
int m_fdl{0}; // ring index of the newest input spectrum
};

} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/diode_ladder.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include <cmath>
#include <cstddef>

namespace taptools {
namespace tap::tools {
namespace diode {

constexpr int k_presets = 16;
Expand Down Expand Up @@ -558,4 +558,4 @@ namespace taptools {
};

} // namespace diode
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/fft.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cmath>
#include <vector>

namespace taptools {
namespace tap::tools {
namespace fft {

inline constexpr double k_pi = 3.14159265358979323846;
Expand Down Expand Up @@ -68,4 +68,4 @@ namespace taptools {
}

} // namespace fft
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/grm_comb.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <cstddef>
#include <vector>

namespace taptools {
namespace tap::tools {
namespace fivecomb {

constexpr int k_voices = 5;
Expand Down Expand Up @@ -523,4 +523,4 @@ namespace taptools {
};

} // namespace fivecomb
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/grm_pitchaccum.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <cstdint>
#include <vector>

namespace taptools {
namespace tap::tools {
namespace pitchaccum {

constexpr int k_voices = 2;
Expand Down Expand Up @@ -666,4 +666,4 @@ namespace taptools {
};

} // namespace pitchaccum
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/ladder.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <cmath>
#include <cstddef>

namespace taptools {
namespace tap::tools {
namespace ladder {

constexpr int k_presets = 16;
Expand Down Expand Up @@ -498,4 +498,4 @@ namespace taptools {
};

} // namespace ladder
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/metal_bank.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -174,4 +174,4 @@ namespace taptools {
};

} // namespace tr808
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/nr.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "stft.h"

namespace taptools {
namespace tap::tools {
namespace nr {

class reducer {
Expand Down Expand Up @@ -66,4 +66,4 @@ namespace taptools {
};

} // namespace nr
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/spectra.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "stft.h"

namespace taptools {
namespace tap::tools {
namespace spectra {

class remapper {
Expand Down Expand Up @@ -81,4 +81,4 @@ namespace taptools {
};

} // namespace spectra
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/step_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <algorithm>
#include <cmath>

namespace taptools {
namespace tap::tools {
namespace seq {

constexpr int k_max_steps = 64;
Expand Down Expand Up @@ -326,4 +326,4 @@ namespace taptools {
};

} // namespace seq
} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/stft.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "fft.h"

namespace taptools {
namespace tap::tools {

class stft {
public:
Expand Down Expand Up @@ -121,4 +121,4 @@ namespace taptools {
std::vector<double> m_im; // scratch FFT imag
};

} // namespace taptools
} // namespace tap::tools
4 changes: 2 additions & 2 deletions include/taptools/svf.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
#include <cstddef>
#include <vector>

namespace taptools {
namespace tap::tools {
namespace svf {

constexpr double k_pi = 3.14159265358979323846;
Expand Down Expand Up @@ -667,4 +667,4 @@ namespace taptools {
};

} // namespace svf
} // namespace taptools
} // namespace tap::tools
8 changes: 4 additions & 4 deletions include/taptools/swing_vca.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include <cmath>
#include <cstdint>

#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.
Expand Down Expand Up @@ -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
Loading
Loading