fix sample center rate loading

This commit is contained in:
tildearrow 2023-09-07 19:00:31 -05:00
parent 2781f1d2c1
commit a11e390d7e

View file

@ -274,10 +274,13 @@ DivSample* DivEngine::sampleFromFile(const char* path) {
{ {
// There's no documentation on libsndfile detune range, but the code // There's no documentation on libsndfile detune range, but the code
// implies -50..50. Yet when loading a file you can get a >50 value. // implies -50..50. Yet when loading a file you can get a >50 value.
// disabled for now
/*
if(inst.detune > 50) if(inst.detune > 50)
inst.detune = inst.detune - 100; inst.detune = inst.detune - 100;
short pitch = ((0x3c-inst.basenote)*100) + inst.detune; short pitch = ((0x3c-inst.basenote)*100) + inst.detune;
sample->centerRate=si.samplerate*pow(2.0,pitch/(12.0 * 100.0)); sample->centerRate=si.samplerate*pow(2.0,pitch/(12.0 * 100.0));
*/
if(inst.loop_count && inst.loops[0].mode >= SF_LOOP_FORWARD) if(inst.loop_count && inst.loops[0].mode >= SF_LOOP_FORWARD)
{ {
sample->loop=true; sample->loop=true;