bang bang bang
This commit is contained in:
parent
0687a6f217
commit
5f7078db42
|
@ -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) {
|
int DivEngine::calcFreq(int base, int pitch, bool period, int octave) {
|
||||||
if (song.linearPitch) {
|
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;
|
pitch+=2048;
|
||||||
if (pitch<0) pitch=0;
|
if (pitch<0) pitch=0;
|
||||||
if (pitch>4095) pitch=4095;
|
if (pitch>4095) pitch=4095;
|
||||||
return period?
|
return period?
|
||||||
((base*(reversePitchTable[pitch]))>>10):
|
((base*(reversePitchTable[pitch]))/whatTheFuck):
|
||||||
(((base*(pitchTable[pitch]))>>10)*(16+globalPitch))/16;
|
(((base*(pitchTable[pitch]))>>10)*whatTheFuck)/1024;
|
||||||
/*
|
|
||||||
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;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
return period?
|
return period?
|
||||||
base-pitch:
|
base-pitch:
|
||||||
|
|
Loading…
Reference in a new issue