mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-01 18:42:40 +00:00
parent
603249573a
commit
eb27d61197
1 changed files with 10 additions and 2 deletions
|
@ -143,7 +143,11 @@ void DivMacroStruct::doMacro(DivInstrumentMacro& source, bool released, bool tic
|
|||
if (!linger) has=false;
|
||||
break;
|
||||
}
|
||||
val=ADSR_LOW+((pos+(ADSR_HIGH-ADSR_LOW)*pos)>>8);
|
||||
if (ADSR_HIGH>ADSR_LOW) {
|
||||
val=ADSR_LOW+((pos+(ADSR_HIGH-ADSR_LOW)*pos)>>8);
|
||||
} else {
|
||||
val=ADSR_LOW+(((ADSR_HIGH-ADSR_LOW)*pos-pos)>>8);
|
||||
}
|
||||
}
|
||||
if (type==2) { // LFO
|
||||
lfoPos+=LFO_SPEED;
|
||||
|
@ -161,7 +165,11 @@ void DivMacroStruct::doMacro(DivInstrumentMacro& source, bool released, bool tic
|
|||
lfoOut=(lfoPos&512)?255:0;
|
||||
break;
|
||||
}
|
||||
val=ADSR_LOW+((lfoOut+(ADSR_HIGH-ADSR_LOW)*lfoOut)>>8);
|
||||
if (ADSR_HIGH>ADSR_LOW) {
|
||||
val=ADSR_LOW+((lfoOut+(ADSR_HIGH-ADSR_LOW)*lfoOut)>>8);
|
||||
} else {
|
||||
val=ADSR_LOW+(((ADSR_HIGH-ADSR_LOW)*lfoOut-lfoOut)>>8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue