mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-18 06:20:17 +00:00
better global pitch effect
still work in progress
This commit is contained in:
parent
11478fbdfe
commit
1605f4f3c0
3 changed files with 6 additions and 3 deletions
|
@ -121,7 +121,7 @@ void DivPlatformNES::tick() {
|
||||||
if (i==3) { // noise
|
if (i==3) { // noise
|
||||||
chan[i].freq=noiseTable[chan[i].baseFreq];
|
chan[i].freq=noiseTable[chan[i].baseFreq];
|
||||||
} else {
|
} else {
|
||||||
chan[i].freq=(chan[i].baseFreq*(ONE_SEMITONE-chan[i].pitch))/ONE_SEMITONE;
|
chan[i].freq=(chan[i].baseFreq*pow(2,(double)-chan[i].pitch/(12.0*128.0)));
|
||||||
if (chan[i].freq>2047) chan[i].freq=2047;
|
if (chan[i].freq>2047) chan[i].freq=2047;
|
||||||
}
|
}
|
||||||
if (chan[i].keyOn) {
|
if (chan[i].keyOn) {
|
||||||
|
|
|
@ -522,10 +522,14 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
extValuePresent=true;
|
extValuePresent=true;
|
||||||
break;
|
break;
|
||||||
case 0xef: // global pitch
|
case 0xef: // global pitch
|
||||||
globalPitch+=(signed char)(effectVal-0x80)*120;
|
for (int i=0; i<chans; i++) {
|
||||||
|
chan[i].pitch-=globalPitch;
|
||||||
|
}
|
||||||
|
globalPitch+=(signed char)(effectVal-0x80)*(120-globalPitch/28);
|
||||||
printf("setting global pitch to %d\n",globalPitch);
|
printf("setting global pitch to %d\n",globalPitch);
|
||||||
for (int i=0; i<chans; i++) {
|
for (int i=0; i<chans; i++) {
|
||||||
chan[i].pitch+=globalPitch;
|
chan[i].pitch+=globalPitch;
|
||||||
|
dispatchCmd(DivCommand(DIV_CMD_PITCH,i,chan[i].pitch+(((chan[i].vibratoDepth*vibTable[chan[i].vibratoPos]*chan[i].vibratoFine)>>4)/15)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1985,7 +1985,6 @@ void FurnaceGUI::doUndo() {
|
||||||
updateScroll(cursor.y);
|
updateScroll(cursor.y);
|
||||||
e->setOrder(us.order);
|
e->setOrder(us.order);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue