Repository navigation
audioecho.FeedbackDelay: a splice on a fading repeat does not search on - #291
Merged
Merged
Conversation
The far search from #284 also ran where the other tap read only the last few LSB of a fading repeat, or silence. Rounding alone makes every match look poor there, so the splice moved the starting tap a whole window off the material that came next. A burst shifted once and repeated through the loop at 22.05 kHz, -5 semitones, a 30 ms window and Feedback 0.3 came back 17.6 to 20.0 dB under what Feedback leaves a repeat; through a pitch shifter with feedback, its third pass read 19 dB under, where before the far search it read 2.5 dB over. The far search now needs the other tap to read more than 8 LSB on average over the compared stretch. New trait E20 holds the burst's repeats within 6 dB of Feedback squared across one whole splice period (red before at two onsets, 3.7 dB at worst now). E18, E19 and a 450-chord sweep read the same as before: a held chord reads far above the floor. Fixes #290
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #290.
#284 let a splice search out to a whole window when nothing within half a window matched the other tap. It also did that where the other tap read only the last few LSB of a fading repeat, or silence. There, rounding alone makes every match look poor, so the search went the whole way out and left the starting tap a window off the material that came next. Through a pitch shifter with feedback, the third pass of a short burst came back 19 dB under what Feedback leaves it.
Now the far search also needs the other tap to read more than 8 LSB on average over the compared stretch. A held chord reads far above that, so everything #284 fixed stays fixed. Nothing changes in the API.
Regression, not a corrected artefact
audioeffects' PitchShifter at 22,050 Hz, -5 semitones, a 30 ms window and Feedback 0.3, pass 3 against Feedback² of pass 1:
The old reading was not inflated: each trip gains the same 1.2 dB, so +2.5 on pass 3 is two trips of it. Under #284 the energy of pass 3 had gaps in it. A trace of the splices showed why. When the far search fired, the other tap read 42 to 84 in total over 48 frames (about 1 to 2 LSB each), and once it read 0. Each time it moved the tap 660 frames.
The check also passes with the burst 20 and 40 dB quieter, where #284 still failed at -20 dB.
#246 stays fixed
Every E19 note reads the same to 0.01 dB as under #284, and so does the 450-chord sweep. The options rows that #284 moved (
audioecho.FeedbackDelay@options, with and without damping) render byte for byte as they do under #284.Tests
tests/test_cpython_audioecho.py: a 40 ms burst throughaudiodelays.PitchShiftand then the loop shifter, with feedback, as a pitch shifter wires them, at 14 onsets across one splice period. Each repeat must be within 6 dB of Feedback² of the one before. It fails on c03a357 (-17.6 and -20.0 dB at two onsets) and passes here (-3.7 dB at worst).tests/test_cpython_audioecho.py,test_cpython_free_threading,test_binding_parity,test_cpython_audiomodalandtest_cpython_audioshaperpass (117 tests).verify_dsp.py, CPython against a standalone MicroPython v1.29.0 unix build from this branch: 58 comparisons, 0 failures. The E20 chain renders byte for byte the same on both at all 14 onsets.What's left
CircuitPython wasn't built for this change, so the three-way run is still to do. The change is one integer comparison, made before the search widens.