mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-27 19:00:25 -04:00
refactor(vm): rename Encode to NewBytecode
This commit is contained in:
parent
01bf409929
commit
9f7bbce761
@ -68,7 +68,7 @@ type bytecodeBuilder struct {
|
||||
Bytecode
|
||||
}
|
||||
|
||||
func Encode(patch sointu.Patch, featureSet FeatureSet, bpm int) (*Bytecode, error) {
|
||||
func NewBytecode(patch sointu.Patch, featureSet FeatureSet, bpm int) (*Bytecode, error) {
|
||||
if patch.NumVoices() > 32 {
|
||||
return nil, fmt.Errorf("Sointu does not support more than 32 concurrent voices; patch uses %v", patch.NumVoices())
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ func Synth(patch sointu.Patch, bpm int) (*NativeSynth, error) {
|
||||
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{}, bpm)
|
||||
comPatch, err := vm.NewBytecode(patch, vm.AllFeatures{}, bpm)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error compiling patch: %v", err)
|
||||
}
|
||||
@ -120,7 +120,7 @@ func (bridgesynth *NativeSynth) Update(patch sointu.Patch, bpm int) 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{}, bpm)
|
||||
comPatch, err := vm.NewBytecode(patch, vm.AllFeatures{}, bpm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error compiling patch: %v", err)
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ func (com *Compiler) Song(song *sointu.Song) (map[string]string, error) {
|
||||
}
|
||||
features := vm.NecessaryFeaturesFor(song.Patch)
|
||||
retmap := map[string]string{}
|
||||
encodedPatch, err := vm.Encode(song.Patch, features, song.BPM)
|
||||
encodedPatch, err := vm.NewBytecode(song.Patch, features, song.BPM)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(`could not encode patch: %v`, err)
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ success:
|
||||
}
|
||||
|
||||
func Synth(patch sointu.Patch, bpm int) (sointu.Synth, error) {
|
||||
bytecode, err := Encode(patch, AllFeatures{}, bpm)
|
||||
bytecode, err := NewBytecode(patch, AllFeatures{}, bpm)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error compiling %v", err)
|
||||
}
|
||||
@ -113,7 +113,7 @@ func (s *GoSynth) Release(voiceIndex int) {
|
||||
}
|
||||
|
||||
func (s *GoSynth) Update(patch sointu.Patch, bpm int) error {
|
||||
bytecode, err := Encode(patch, AllFeatures{}, bpm)
|
||||
bytecode, err := NewBytecode(patch, AllFeatures{}, bpm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error compiling %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user