mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 22:43:01 +00:00
bang bang bang
This commit is contained in:
parent
0687a6f217
commit
5f7078db42
1 changed files with 5 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue