Skip to content

Fix v23.0 bugs - #126

Merged
pingdynasty merged 5 commits into
masterfrom
fix/hvcc-py2-deps
Oct 25, 2026
Merged

pingdynasty merged 5 commits into
masterfrom
fix/hvcc-py2-deps

Conversation

@pingdynasty

Copy link
Copy Markdown
Collaborator

Fixes issues introduced in v23.0: Dockerfile hvcc installation, SimpleValue lambda.

heavy.mk runs the pingdynasty hvcc fork under python2.7, whose requirements
(enum==0.4.4, Jinja2==2.7.3) are python2 packages. The previous
'pip3 install -r Tools/hvcc/requirements.txt || true' installed them into
python3 and swallowed any error, so python2.7 never had 'enum' and every
Heavy/PD build failed with 'ImportError: No module named enum'.

ubuntu 20.04's python2 ships without pip, so bootstrap pip for python2
(get-pip.py 2.7) and install the fork's requirements into python2.

python3 is kept: emscripten 2.0.10's emcc execs 'python3 emcc.py', so the
'make web' / WASM path needs it (verified: hiding python3 breaks emcc).

Verified on OWL2: HeavyTest.pd builds via the py2 Heavy path (patch.bin)
AND make web builds patch.js via the py3 emcc path.
WavFile::getNumberOfSamples() returns frames per channel, but PatchRun used
it as the int16 count of the interleaved buffer. For the stereo input that
PatchRun requires, the end pointer landed halfway through the data, so the
second half of every output file was the unprocessed input.

Span frames*channels, and step the loop guard by a whole interleaved block.

Verified with HeavyTest on a 1 s stereo file: 47872 of the 48000 int16s in
the second half matched the input before the fix, 1 after.
lambda is a dimensionless coefficient, but SmoothValue declared it as T.
For int types it was initialised from the Q12 DEFAULT_LAMBDA (3686), and
update() mixed value*3686 + x*(1-3686) without ever rescaling, so integer
smoothing produced garbage. PatchProcessor also assigned the float result
of normal() into the int lambda, truncating it.

- SmoothValue::lambda is float (default 0.9f); the (lambda, init)
  constructor and normal() take/return float.
- PatchProcessor::getParameter keeps l as float.
- Remove SimpleValue::DEFAULT_LAMBDA, which nothing uses any more.
- Replace the doc comment's unimplemented int formula with the single
  implemented one, and correct the mean-lag note.
- int/weirdint tests assert the actual behaviour: float lambda, one-step
  smoothing, monotonic convergence and the truncated settling value.
Both were declared, and called from PatchProcessor::getParameter, but
their definitions went away with SmoothValue.cpp in the SimpleValue
refactor. Any patch that calls getFloatParameter() or getIntParameter()
failed to link with an undefined reference (e.g. BeatCounter,
BigJotReverb).

- SmoothValue::normal(lambda, blocksize) returns
  powf(lambda, blocksize/128), so a lambda given for 128-sample blocks
  keeps the same time constant at other block sizes and stays below 1.
- StiffValue::normal(delta) returns delta as a float, so an int
  parameter's fractional delta survives until it is scaled by the range.
- Test the normal() values.
@pingdynasty
pingdynasty merged commit b995f4c into master Oct 25, 2026
1 check failed
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.

1 participant