Separate Synth and SynthState: SynthState is the part that Render changes.

This should make testing easier, as Synth can be assumed to stay the same
during each call. Synth is also the part that we can parse from .asm/.json file
and a Patch can be compiled into a synth. Synth can be eventually made
quite opaque to the user. The user should not need to worry about opcodes
etc.
This commit is contained in:
Veikko Sariola
2020-10-28 13:44:34 +02:00
parent 64afa9fb48
commit 8183c698da
13 changed files with 196 additions and 156 deletions

View File

@ -38,7 +38,12 @@ func TestSongRender(t *testing.T) {
if err != nil {
t.Fatalf("NewSong failed: %v", err)
}
buffer, err := song.Render()
synth, err := bridge.Compile(patch)
if err != nil {
t.Fatalf("Compiling patch failed: %v", err)
}
state := bridge.NewSynthState()
buffer, err := song.Render(synth, state)
if err != nil {
t.Fatalf("Render failed: %v", err)
}