mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-21 22:44:50 -04:00
refactor(go4k): Remove all special treatment from samples and map Song 1-1 to what's in the .asm file.
Whoever uses it, probably wants their own Patch format, as now it is pretty cumbersome to work with sampleoffsets and delays, as the user needs to construct the delaytimes tables and sampleoffset tables.
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -101,15 +102,18 @@ func TestSerializingAllAsmFiles(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Could not serialize asm file: %v", err)
|
||||
}
|
||||
song, err = go4k.DeserializeAsm(str) // deserialize again. The rendered song should still give same results.
|
||||
song2, err := go4k.DeserializeAsm(str) // deserialize again. The rendered song should still give same results.
|
||||
if err != nil {
|
||||
t.Fatalf("could not parse the serialized asm code: %v", err)
|
||||
}
|
||||
synth, err := bridge.Synth(song.Patch)
|
||||
if !reflect.DeepEqual(song, song2) {
|
||||
t.Fatalf("serialize/deserialize does not result equal songs, before: %v, after %v", song, song2)
|
||||
}
|
||||
synth, err := bridge.Synth(song2.Patch)
|
||||
if err != nil {
|
||||
t.Fatalf("Compiling patch failed: %v", err)
|
||||
}
|
||||
buffer, err := go4k.Play(synth, *song)
|
||||
buffer, err := go4k.Play(synth, *song2)
|
||||
if err != nil {
|
||||
t.Fatalf("Play failed: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user