bang bang bang

This commit is contained in:
tildearrow 2022-03-25 03:41:43 -05:00
parent 0687a6f217
commit 5f7078db42

View file

@ -832,17 +832,15 @@ double DivEngine::calcBaseFreq(double clock, double divider, int note, bool peri
int DivEngine::calcFreq(int base, int pitch, bool period, int octave) {
if (song.linearPitch) {
// global pitch multiplier
int whatTheFuck=(1024+(globalPitch<<6)-(globalPitch<0?globalPitch-6:0));
if (whatTheFuck<1) whatTheFuck=1; // avoids division by zero but please kill me
pitch+=2048;
if (pitch<0) pitch=0;
if (pitch>4095) pitch=4095;
return period?
((base*(reversePitchTable[pitch]))>>10):
(((base*(pitchTable[pitch]))>>10)*(16+globalPitch))/16;
/*
return period?
base*pow(2,-(double)pitch/(12.0*128.0))/(98.0+globalPitch*6.0)*98.0:
(base*pow(2,(double)pitch/(12.0*128.0))*(98+globalPitch*6))/98;
*/
((base*(reversePitchTable[pitch]))/whatTheFuck):
(((base*(pitchTable[pitch]))>>10)*whatTheFuck)/1024;
}
return period?
base-pitch: