mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 04:54:27 -04:00
fix(vm): change crush resolution to bits (closes #79)
BREAKING CHANGE: The problem with crush was that it had very few usable values. This changes the crush to map the value nonlinearly, so the crush resolution is bits. Still the upper portion of the values is not very usable (bits 12-24 i.e. hardly any crushing), but at least the lower portion is usable. But now crush resolution has slightly different meaning.
This commit is contained in:
parent
1ac2ad3c75
commit
7df8103bf9
@ -611,7 +611,8 @@ func clip(value float32) float32 {
|
||||
}
|
||||
|
||||
func crush(value, amount float32) float32 {
|
||||
return float32(math.Round(float64(value/amount)) * float64(amount))
|
||||
n := nonLinearMap(amount)
|
||||
return float32(math.Round(float64(value/n)) * float64(n))
|
||||
}
|
||||
|
||||
func waveshape(value, amount float32) float32 {
|
||||
|
Reference in New Issue
Block a user