diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f02934..59a343d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). options ### Fixed +- The stereo version of delay in the go virtual machine (executables / plugins + not ending with -native) applied the left delay taps on the right channel, and + the right delay taps on the left channel. - The sointu-vsti-native plugin has different plugin ID and plugin name to not confuse it with the non-native one - The VSTI waits for the gioui actually have quit when closing the diff --git a/vm/interpreter.go b/vm/interpreter.go index 59e633f..6eba690 100644 --- a/vm/interpreter.go +++ b/vm/interpreter.go @@ -524,9 +524,10 @@ func (s *Interpreter) Render(buffer sointu.AudioBuffer, maxtime int) (samples in var index, count byte index, count, values = values[0], values[1], values[2:] t := uint16(s.synth.globalTime) + stackIndex := l - channels for i := 0; i < channels; i++ { var d *delayline - signal := stack[l-1-i] + signal := stack[stackIndex] output := params[1] * signal // dry output for j := byte(0); j < count; j += 2 { d, delaylines = &delaylines[0], delaylines[1:] @@ -542,7 +543,8 @@ func (s *Interpreter) Render(buffer sointu.AudioBuffer, maxtime int) (samples in } d.dcFiltState = output + (0.99609375*d.dcFiltState - d.dcIn) d.dcIn = output - stack[l-1-i] = d.dcFiltState + stack[stackIndex] = d.dcFiltState + stackIndex++ } unit.ports[4] = 0 case opCompressor: