Skip to content

[FEATURE, BREAKING] Support 1-to-n and n-to-1 channel configurations in Linear models - #335

Merged
sdatkinson merged 4 commits into
mainfrom
334-1n-n1-linear
Sep 18, 2026
Merged

sdatkinson merged 4 commits into
mainfrom
334-1n-n1-linear

Conversation

@sdatkinson

Copy link
Copy Markdown
Owner

Summary

Extend Linear to support one input feeding multiple outputs and multiple inputs summing into one output. Previously, unequal channel counts silently ignored extra inputs or silenced extra outputs.

This is a breaking change to no longer support "N-to-M" with N,M>1.

  • 1→N: Apply a separate impulse response to each output.
  • N→1: Sum separately filtered inputs without normalization, adding the output bias once.
  • Preserve existing mono and equal-channel models.
  • Reject unequal channel counts when both exceed one.

Both direct and FFT implementations support these mappings, sample-rate conversion, and in-place processing. Document the weight layout and bias semantics.

Validation

  • Full test suite passes.
  • Render tool builds successfully.
  • Regression coverage includes channel mapping, parameter validation, bias handling, sample-rate changes, irregular processing blocks, in-place processing, and allocation-free audio processing.

Resolves #334.

@sdatkinson
sdatkinson merged commit 928ccd6 into main Sep 18, 2026
4 checks passed
@sdatkinson
sdatkinson deleted the 334-1n-n1-linear branch September 18, 2026 22:57
dfernandes83 added a commit to dfernandes83/NeuralAmpModelerCore that referenced this pull request Sep 21, 2026
Brings in NAM Core 0.6.0 from sdatkinson/NeuralAmpModelerCore:
- models with variable sample rate (sdatkinson#333): Linear reports
  SupportsArbitrarySampleRate() and resamples in Reset()
- 1-to-n and n-to-1 channel configurations in Linear models (sdatkinson#335, breaking:
  a Linear model now needs one kernel per output/input path)
- Linear models instantiated from .wav files through get_dsp() (sdatkinson#337)
- version bump to 0.6.0 (sdatkinson#336)

Conflicts:
- NAM/get_dsp.cpp: kept all three includes (<algorithm> and <cctype> from
  upstream, <cmath> from our validation code).
- NAM/linear.cpp: took upstream's rewritten direct-convolution loop. Our side
  only had a static_cast to silence an MSVC conversion warning in the code
  that upstream replaced.

Consumers now have to compile NAM/wav.cpp too: get_dsp.cpp calls
nam::detail::load_wav_ir().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Support one-to-many and many-to-one Linear convolution channel mappings

1 participant