mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
fix(bridge): respect the hard limit of 64 delay lines to avoid crashes.
This commit is contained in:
parent
e649b9ec54
commit
e9834110ec
@ -23,6 +23,9 @@ func (s BridgeService) Compile(patch sointu.Patch) (sointu.Synth, error) {
|
|||||||
|
|
||||||
func Synth(patch sointu.Patch) (*C.Synth, error) {
|
func Synth(patch sointu.Patch) (*C.Synth, error) {
|
||||||
s := new(C.Synth)
|
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{})
|
comPatch, err := vm.Encode(patch, vm.AllFeatures{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("error compiling patch: %v", err)
|
return nil, fmt.Errorf("error compiling patch: %v", err)
|
||||||
@ -103,6 +106,9 @@ func (s *C.Synth) Release(voice int) {
|
|||||||
|
|
||||||
// Update
|
// Update
|
||||||
func (s *C.Synth) Update(patch sointu.Patch) error {
|
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{})
|
comPatch, err := vm.Encode(patch, vm.AllFeatures{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error compiling patch: %v", err)
|
return fmt.Errorf("error compiling patch: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user