fix: display correct exponent in tracker, switch directions, i.e. meaning of exp 0 <-> 128

This commit is contained in:
qm210
2024-10-22 00:29:09 +02:00
parent 15c1126d11
commit cf05e68471
3 changed files with 28 additions and 27 deletions

View File

@ -0,0 +1 @@
go build -buildmode=c-shared -tags="plugin","native" -o sointu-vsti.dll .\cmd\sointu-vsti\

View File

@ -257,6 +257,10 @@ func engineeringTime(sec float64) (string, string) {
return fmt.Sprintf("%.2f", sec), "s" return fmt.Sprintf("%.2f", sec), "s"
} }
func envelopExpDisplayFunc(v int) (string, string) {
return fmt.Sprintf("= %.3f", math.Pow(2, 2*float64(64-v)/32)), ""
}
func formatFloat(f float64) string { func formatFloat(f float64) string {
return strconv.FormatFloat(f, 'f', -1, 64) return strconv.FormatFloat(f, 'f', -1, 64)
} }
@ -469,7 +473,3 @@ func (p Patch) FindUnit(id int) (instrIndex int, unitIndex int, err error) {
} }
return 0, 0, fmt.Errorf("could not find a unit with id %v", id) return 0, 0, fmt.Errorf("could not find a unit with id %v", id)
} }
func envelopExpDisplayFunc(v int) (string, string) {
return fmt.Sprintf("= %.3f", math.Pow(2, float64(v-64)/32)), ""
}

View File

@ -151,7 +151,7 @@ su_op_envelopexp_applyexp:
fld dword [r10] ; stack: [ expo, x' ] fld dword [r10] ; stack: [ expo, x' ]
{{.Prepare (.Float 0.5)}} {{.Prepare (.Float 0.5)}}
fld dword [{{.Use (.Float 0.5)}}] ; stack: [ 0.5, expo, x' ] fld dword [{{.Use (.Float 0.5)}}] ; stack: [ 0.5, expo, x' ]
fsubp st1, st0 ; stack: [ expo-0.5, x' ] fsubrp st1, st0 ; stack: [ expo-0.5, x' ]
{{.Prepare (.Int 6)}} {{.Prepare (.Int 6)}}
fimul dword [{{.Use (.Int 6)}}] ; stack: [ 6*(expo-0.5), x' ] fimul dword [{{.Use (.Int 6)}}] ; stack: [ 6*(expo-0.5), x' ]
{{.Call "su_power"}} ; stack: [ kappa, x' ] {{.Call "su_power"}} ; stack: [ kappa, x' ]