mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-14 02:54:37 -04:00
feat: add ability to disable units temporarily
Quite often the user wants to experiment what particular unit(s) add to the sound. This commit adds ability to disable any set of units temporarily, without actually deleting them. Ctrl-D disables and re-enables the units. Disabled units are considered non-existent in the patch. Closes #116.
This commit is contained in:
parent
2b3f6d8200
commit
17312bbe4e
@ -78,7 +78,7 @@ func NewBytecode(patch sointu.Patch, featureSet FeatureSet, bpm int) (*Bytecode,
|
||||
return nil, errors.New("Each instrument must have at least 1 voice")
|
||||
}
|
||||
for unitIndex, unit := range instr.Units {
|
||||
if unit.Type == "" { // empty units are just ignored & skipped
|
||||
if unit.Type == "" || unit.Disabled { // empty units are just ignored & skipped
|
||||
continue
|
||||
}
|
||||
opcode, ok := featureSet.Opcode(unit.Type)
|
||||
|
@ -118,7 +118,7 @@ func NecessaryFeaturesFor(patch sointu.Patch) NecessaryFeatures {
|
||||
features := NecessaryFeatures{opcodes: map[string]int{}, supportsParamValue: map[paramKey](map[int]bool){}, supportsModulation: map[paramKey]bool{}}
|
||||
for instrIndex, instrument := range patch {
|
||||
for _, unit := range instrument.Units {
|
||||
if unit.Type == "" {
|
||||
if unit.Type == "" || unit.Disabled {
|
||||
continue
|
||||
}
|
||||
if _, ok := features.opcodes[unit.Type]; !ok {
|
||||
|
Reference in New Issue
Block a user