I’m making a tool for batch-converting a sample’s bit depth, which requires copying the sample buffer data into a table and rewriting it into a new buffer of the same size.
For some reason, the sample’s loop mode is getting erased when I do this. Additionally, the loop’s end point is always reset to the last sample. This is weird for two reasons:
The loop mode has nothing to do with a renoise.SampleBuffer, so I dunno why it should be affected.
The length of the new buffer is copied from the old one, so the original loop end point shouldn’t be out of bounds (which was my original guess as the the problem).
Is this a bug? If not, I will just copy the loop values to the sample after writing.
IC. Sample.create_sample_data indeed resets loop points. Loop points are bound to their buffer, only make sense with “their” buffer.
It does in general not really make sense to retain/copy them over when recreating sample buffers. So if you want to reuse the old ones, simply copy them over too. As you’ve done it now.