mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 04:54:27 -04:00
feat(vm): add dbgain unit, where gain is defined in decibels
Closes #78
This commit is contained in:
parent
f698986718
commit
04fbc9f6a7
@ -346,6 +346,12 @@ func (s *GoSynth) Render(buffer sointu.AudioBuffer, maxtime int) (samples int, t
|
||||
stack[l-2] /= params[0]
|
||||
}
|
||||
stack[l-1] /= params[0]
|
||||
case opDbgain:
|
||||
gain := float32(math.Pow(2, float64(params[0]*2-1)*6.643856189774724))
|
||||
if stereo {
|
||||
stack[l-2] *= gain
|
||||
}
|
||||
stack[l-1] *= gain
|
||||
case opClip:
|
||||
if stereo {
|
||||
stack[l-2] = clip(stack[l-2])
|
||||
|
Reference in New Issue
Block a user