Correct me if I'm wrong, but it looks like there's no way to set `sample->notify` through FluidSynth API.
Indeed... I think the only way that doesn't involve changing FluidSynth is to keep track of voice/sample mapping, and release the previously associated sample/wave whenever a voice is seen again (as `fluid_synth_alloc_voice` recycles voices), or when the synth is destroyed.
We could then either create the samples with the waves, or separately, depending on whether we want to avoid a copy. But maybe we can just keep the copy after all.
Anyway, as you say we'll still have to offset the loop, so the change here seems fine and the sample leak fix could be done separately.