Knuckles' Chaotix - Seascape - Oscilloscope View
Channel: nyanpasu64
Date: 2022-03-08

This is a WIP demonstration of replacing corrscope's windowed correlation trigger with an overlap-save correlation trigger.

The previous algorithm slides the history buffer and edge detector across an equally sized slice of the input wave, which suffers from edge effects. It mitigates edge effects by multiplying the input wave slice by a window, but unfortunately this biases corrscope towards picking points near the actual point in time, which causes inconsistent triggering and jitter. In corrscope videos I've made or watched, I _consistently_ noticed bad triggering drifting towards alignment, bad triggering that remains for the duration of the note, or (with low buffer strengths or ambiguous waveforms) constant jittering between multiple edges with near-identical scores. In this song, I got all of these problems in the bass channel (FM 1) when trying to tune the buffer strength for reliable triggering.

My new overlap-save algorithm takes a larger slice of the input wave than the history buffer and edge detector, and only slides the history/edge within the input wave. This algorithm is fully free of edge effects within the sliding region, making it much more deterministic (not influenced by wave offsets) than before. This improves (but does not solve) bad triggering, and does not fix notes influencing other notes (which would require more heuristics), but essentially solves the jittering problem caused by nondeterministic triggering.

I managed to stabilize FM 1 on the wide part of the wave by turning buffer strength to 0 to avoid hanging onto bad decisions made during note attack (which would previously cause a bit of jittering... I'm not actually sure if my branch is a major improvement), setting sign strength to 0 to amplify zero crossings (not doing so causes minor jitter), and relying on the edge detection kernel only. (I was still unable to reliably pick out the narrow peaks though, so I settled for the wide part.)

WIP code at https://github.com/corrscope/corrscope/tree/overlap-save. Configuration at https://gist.github.com/nyanpasu64/f21a59089c97cf88bf8412adebad3d70.