refactor: implement Order and Pattern types: slices returning default values for out of bound indices

This commit is contained in:
vsariola
2021-05-12 11:31:38 +03:00
parent ce6e5d4942
commit a2723829da
9 changed files with 68 additions and 51 deletions

View File

@ -38,7 +38,7 @@ func TestOscillatSine(t *testing.T) {
sointu.Unit{Type: "mulp", Parameters: map[string]int{"stereo": 0}},
sointu.Unit{Type: "out", Parameters: map[string]int{"stereo": 1, "gain": 128}},
}}}
tracks := []sointu.Track{{NumVoices: 1, Order: []int{0}, Patterns: [][]byte{{64, 0, 68, 0, 32, 0, 0, 0, 75, 0, 78, 0, 0, 0, 0, 0}}}}
tracks := []sointu.Track{{NumVoices: 1, Order: []int{0}, Patterns: []sointu.Pattern{{64, 0, 68, 0, 32, 0, 0, 0, 75, 0, 78, 0, 0, 0, 0, 0}}}}
song := sointu.Song{BPM: 100, RowsPerBeat: 4, Score: sointu.Score{RowsPerPattern: 16, Length: 1, Tracks: tracks}, Patch: patch}
synth, err := bridge.Synth(patch)
if err != nil {