mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 10:47:10 +01:00
might be more efficient
This commit is contained in:
parent
921803d066
commit
cd917dc81f
2
main.go
2
main.go
@ -6,6 +6,7 @@ import (
|
||||
"image/color"
|
||||
"log"
|
||||
"math/rand/v2"
|
||||
"sort"
|
||||
"xyosc/audio"
|
||||
"xyosc/config"
|
||||
"xyosc/fastsqrt"
|
||||
@ -99,6 +100,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
||||
}
|
||||
|
||||
indices := peaks.Get(FFTBuffer, config.Config.PeakDetectSeparator)
|
||||
sort.Ints(indices)
|
||||
offset := uint32(indices[0])
|
||||
for i := uint32(0); i < numSamples-1; i++ {
|
||||
fAX := float32(FFTBuffer[(i+offset)%numSamples]) * config.Config.Gain * float32(scale)
|
||||
|
Loading…
Reference in New Issue
Block a user