diff --git a/vm/compiler/bridge/bridge.go b/vm/compiler/bridge/bridge.go index fb77d5e..6f28f0e 100644 --- a/vm/compiler/bridge/bridge.go +++ b/vm/compiler/bridge/bridge.go @@ -23,6 +23,9 @@ func (s BridgeService) Compile(patch sointu.Patch) (sointu.Synth, error) { func Synth(patch sointu.Patch) (*C.Synth, error) { s := new(C.Synth) + if n := patch.NumDelayLines(); n > 64 { + return nil, fmt.Errorf("native bridge has currently a hard limit of 64 delaylines; patch uses %v", n) + } comPatch, err := vm.Encode(patch, vm.AllFeatures{}) if err != nil { return nil, fmt.Errorf("error compiling patch: %v", err) @@ -103,6 +106,9 @@ func (s *C.Synth) Release(voice int) { // Update func (s *C.Synth) Update(patch sointu.Patch) error { + if n := patch.NumDelayLines(); n > 64 { + return fmt.Errorf("native bridge has currently a hard limit of 64 delaylines; patch uses %v", n) + } comPatch, err := vm.Encode(patch, vm.AllFeatures{}) if err != nil { return fmt.Errorf("error compiling patch: %v", err)