mirror of
https://github.com/vsariola/sointu.git
synced 2025-09-27 07:36:06 -04:00
feat(vm): add dbgain unit, where gain is defined in decibels
Closes #78
This commit is contained in:
parent
f698986718
commit
04fbc9f6a7
8
patch.go
8
patch.go
@ -82,6 +82,9 @@ var UnitTypes = map[string]([]UnitParameter){
|
||||
"invgain": []UnitParameter{
|
||||
{Name: "stereo", MinValue: 0, MaxValue: 1, CanSet: true, CanModulate: false},
|
||||
{Name: "invgain", MinValue: 0, MaxValue: 128, CanSet: true, CanModulate: true}},
|
||||
"dbgain": []UnitParameter{
|
||||
{Name: "stereo", MinValue: 0, MaxValue: 1, CanSet: true, CanModulate: false},
|
||||
{Name: "decibels", MinValue: 0, MaxValue: 128, CanSet: true, CanModulate: true}},
|
||||
"filter": []UnitParameter{
|
||||
{Name: "stereo", MinValue: 0, MaxValue: 1, CanSet: true, CanModulate: false},
|
||||
{Name: "frequency", MinValue: 0, MaxValue: 128, CanSet: true, CanModulate: true},
|
||||
@ -494,6 +497,11 @@ func (p Patch) ParamHintString(instrIndex, unitIndex int, param string) string {
|
||||
return "aux3 right"
|
||||
}
|
||||
}
|
||||
case "dbgain":
|
||||
switch param {
|
||||
case "decibels":
|
||||
return fmt.Sprintf("%.2f dB", 40*(float32(value)/64-1))
|
||||
}
|
||||
case "crush":
|
||||
switch param {
|
||||
case "resolution":
|
||||
|
Reference in New Issue
Block a user