refactor(vm): use vm.GoSynther{}.Synth instead of vm.Synth

vm.Synth was used only in a few places, reduce the number of
exported functions. Also, if we ever add some global configuration
to GoSynther e.g. samplerate, we have a mechanism to do so, instead
of the Synth function.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-19 12:52:05 +03:00
parent 7675121a78
commit 960bddfae0
2 changed files with 3 additions and 8 deletions

View File

@ -78,7 +78,7 @@ func TestStackUnderflow(t *testing.T) {
patch := sointu.Patch{sointu.Instrument{NumVoices: 1, Units: []sointu.Unit{
sointu.Unit{Type: "pop", Parameters: map[string]int{}},
}}}
synth, err := vm.Synth(patch, 120)
synth, err := vm.GoSynther{}.Synth(patch, 120)
if err != nil {
t.Fatalf("bridge compile error: %v", err)
}
@ -94,7 +94,7 @@ func TestStackBalancing(t *testing.T) {
sointu.Instrument{NumVoices: 1, Units: []sointu.Unit{
sointu.Unit{Type: "push", Parameters: map[string]int{}},
}}}
synth, err := vm.Synth(patch, 120)
synth, err := vm.GoSynther{}.Synth(patch, 120)
if err != nil {
t.Fatalf("bridge compile error: %v", err)
}