refactor(sointu): Change the signature of Play to accept SynthService instead of Synth

This is more logical as every single use of Play started with compiling the patch of a song with a SynthService.
This commit is contained in:
vsariola
2021-08-30 22:22:04 +03:00
parent a9b90c4db8
commit a8f8911f03
5 changed files with 22 additions and 39 deletions

View File

@ -88,16 +88,7 @@ func main() {
return fmt.Errorf("the song could not be parsed as .json (%v) or .yml (%v)", errJSON, errYaml)
}
}
synth, err := bridge.Synth(song.Patch)
if err != nil {
return fmt.Errorf("could not create synth based on the patch: %v", err)
}
if !*unreleased {
for i := 0; i < 32; i++ {
synth.Release(i)
}
}
buffer, _, err := sointu.Play(synth, song) // render the song to calculate its length
buffer, _, err := sointu.Play(bridge.BridgeService{}, song, !*unreleased) // render the song to calculate its length
if err != nil {
return fmt.Errorf("sointu.Play failed: %v", err)
}