diff --git a/config/config.go b/config/config.go index 0c71e1e..4d00729 100644 --- a/config/config.go +++ b/config/config.go @@ -38,6 +38,7 @@ type ConfigS struct { ParticleDrag float32 DefaultToSingleChannel bool PeakDetectSeparator int + SingleChannelWindow uint32 } var DefaultConfig = ConfigS{ @@ -65,6 +66,7 @@ var DefaultConfig = ConfigS{ ParticleDrag: 5.0, DefaultToSingleChannel: false, PeakDetectSeparator: 100, + SingleChannelWindow: 1000, } var Config ConfigS diff --git a/main.go b/main.go index 17f7ad5..b3205b5 100644 --- a/main.go +++ b/main.go @@ -105,7 +105,7 @@ func (g *Game) Draw(screen *ebiten.Image) { for i := uint32(0); i < numSamples-1; i++ { fAX := float32(FFTBuffer[(i+offset)%numSamples]) * config.Config.Gain * float32(scale) fBX := float32(FFTBuffer[(i+1+offset)%numSamples]) * config.Config.Gain * float32(scale) - vector.StrokeLine(screen, float32(config.Config.WindowWidth)*float32(i)/float32(numSamples), float32(config.Config.WindowHeight/2)+fAX, float32(config.Config.WindowWidth)*float32(i+1)/float32(numSamples), float32(config.Config.WindowHeight/2)+fBX, config.Config.LineThickness, config.ThirdColorAdj, true) + vector.StrokeLine(screen, float32(config.Config.WindowWidth)*float32(i%config.Config.SingleChannelWindow)/float32(config.Config.SingleChannelWindow), float32(config.Config.WindowHeight/2)+fAX, float32(config.Config.WindowWidth)*float32(i%config.Config.SingleChannelWindow+1)/float32(config.Config.SingleChannelWindow), float32(config.Config.WindowHeight/2)+fBX, config.Config.LineThickness, config.ThirdColorAdj, true) } }