Saving now, this is some seriously complex shit trying to make this inherently-not-guaranteed-to-be-sample-accurate stuff into something resembling sample-accurate-to-the-greatest-extent-possible...  It's on the verge of becoming usable, at least for the most basic of use cases...