diff --git a/vite/src/pipedal/Lv2Plugin.tsx b/vite/src/pipedal/Lv2Plugin.tsx index 341425f..ebe4165 100644 --- a/vite/src/pipedal/Lv2Plugin.tsx +++ b/vite/src/pipedal/Lv2Plugin.tsx @@ -1138,18 +1138,20 @@ export function makeSplitUiPlugin(): UiPlugin { has_midi_output: 0, description: "", controls: [ - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "splitType", name: "Type", index: 0, is_input: true, min_value: 0.0, max_value: 2.0, + default_value: 0.0, + enumeration_property: true, scale_points: [ new ScalePoint().deserialize({ value: 0, label: "A/B" }), - new ScalePoint().deserialize({ value: 1, label: "mix" }), - new ScalePoint().deserialize({ value: 1, label: "L/R" }), + new ScalePoint().deserialize({ value: 1, label: "Mix" }), + new ScalePoint().deserialize({ value: 2, label: "L/R" }), ], is_bypass: false, is_program_controller: false, @@ -1157,84 +1159,97 @@ export function makeSplitUiPlugin(): UiPlugin { connection_optional: false, }), - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "select", name: "Select", index: 1, is_input: true, min_value: 0.0, max_value: 1.0, + default_value: 0.0, + enumeration_property: true, scale_points: [ new ScalePoint().deserialize({ value: 0, label: "A" }), new ScalePoint().deserialize({ value: 1, label: "B" }), ], + controlType: ControlType.ABSwitch, + is_bypass: false, is_program_controller: false, custom_units: "", connection_optional: false, }), - - new UiControl().applyProperties({ + + new UiControl().deserialize({ symbol: "mix", name: "Mix", index: 2, is_input: true, min_value: -1.0, max_value: 1.0, + default_value: 0.0, + controlType: ControlType.Dial, is_bypass: false, is_program_controller: false, custom_units: "", connection_optional: false, }), - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "panL", name: "Pan Top", index: 3, is_input: true, min_value: -1.0, max_value: 1.0, + default_value: 0.0, + controlType: ControlType.Dial, is_bypass: false, is_program_controller: false, custom_units: "", connection_optional: false, }), - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "volL", - name: "Vol Top", index: 4, is_input: true, min_value: -60.0, max_value: 12.0, + default_value: 0.0, is_bypass: false, + controlType: ControlType.Dial, is_program_controller: false, custom_units: "", connection_optional: false, }), - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "panR", name: "Pan Bottom", index: 5, is_input: true, min_value: -1.0, max_value: 1.0, + default_value: 0.0, + controlType: ControlType.Dial, is_bypass: false, is_program_controller: false, custom_units: "", connection_optional: false, }), - new UiControl().applyProperties({ + new UiControl().deserialize({ symbol: "volR", name: "Vol Bottom", index: 6, is_input: true, min_value: -60.0, max_value: 12.0, + default_value: 0.0, + controlType: ControlType.Dial, is_bypass: false, is_program_controller: false, custom_units: "", diff --git a/vite/src/pipedal/Pedalboard.tsx b/vite/src/pipedal/Pedalboard.tsx index 1012687..fde63cf 100644 --- a/vite/src/pipedal/Pedalboard.tsx +++ b/vite/src/pipedal/Pedalboard.tsx @@ -686,9 +686,9 @@ export class Pedalboard implements Deserializable { new ControlValue(PedalboardSplitItem.SELECT_KEY,0), new ControlValue(PedalboardSplitItem.MIX_KEY,0), new ControlValue(PedalboardSplitItem.PANL_KEY,0), - new ControlValue(PedalboardSplitItem.VOLL_KEY,-3), + new ControlValue(PedalboardSplitItem.VOLL_KEY,0), new ControlValue(PedalboardSplitItem.PANR_KEY,0), - new ControlValue(PedalboardSplitItem.VOLR_KEY,-3) + new ControlValue(PedalboardSplitItem.VOLR_KEY,0) ]; diff --git a/vite/src/pipedal/PiPedalModel.tsx b/vite/src/pipedal/PiPedalModel.tsx index 7f4fd54..0f971c0 100644 --- a/vite/src/pipedal/PiPedalModel.tsx +++ b/vite/src/pipedal/PiPedalModel.tsx @@ -1721,11 +1721,19 @@ export class PiPedalModel //implements PiPedalModel if (pedalboard === undefined) throw new PiPedalStateError("Pedalboard not ready."); let newPedalboard = pedalboard.clone(); - let item = newPedalboard.getItem(instanceId); + let item: PedalboardItem = newPedalboard.getItem(instanceId); let changed = value !== item.isEnabled; if (changed) { item.isEnabled = value; + let pluginInfo: UiPlugin | null = this.getUiPlugin(item.uri); + if (pluginInfo !== null) { + for (let uiControl of pluginInfo.controls) { + if (uiControl.is_bypass) { + this._setPedalboardControlValue(instanceId, uiControl.symbol, value ? 0.0 : 1.0, false); + } + } + } this.setModelPedalboard(newPedalboard); if (notifyServer) { let body: PedalboardItemEnableBody = { diff --git a/vite/src/pipedal/SplitUiControls.tsx b/vite/src/pipedal/SplitUiControls.tsx index 4e4b7cd..2171980 100644 --- a/vite/src/pipedal/SplitUiControls.tsx +++ b/vite/src/pipedal/SplitUiControls.tsx @@ -27,6 +27,7 @@ export const SplitTypeControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.TYPE_KEY, name: "Type", index: 0, + is_input: true, min_value: 0, max_value: 2, default_value: 0, @@ -53,6 +54,8 @@ export const SplitAbControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.SELECT_KEY, name: "Select", index: 1, + is_input: true, + min_value: 0, max_value: 1, default_value: 0, @@ -78,6 +81,7 @@ export const SplitMixControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.MIX_KEY, name: "Mix", index: 2, + is_input: true, min_value: -1, max_value: 1, default_value: 0, @@ -99,6 +103,7 @@ export const SplitPanLeftControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.PANL_KEY, name: "Pan Top", index: 3, + is_input: true, min_value: -1, max_value: 1, default_value: 0, @@ -119,9 +124,10 @@ export const SplitVolLeftControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.VOLL_KEY, name: "Vol Top", index: 4, + is_input: true, min_value: -60, max_value: 12, - default_value: -3, + default_value: 0, range_steps: 0, is_logarithmic: false, display_priority: -1, @@ -146,6 +152,7 @@ export const SplitPanRightControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.PANR_KEY, name: "Pan Bottom", index: 5, + is_input: true, min_value: -1, max_value: 1, default_value: 0, @@ -166,9 +173,10 @@ export const SplitVolRightControl: UiControl = new UiControl().deserialize({ symbol: PedalboardSplitItem.VOLR_KEY, name: "Vol Bottom", index: 6, + is_input: true, min_value: -60, max_value: 12, - default_value: -3, + default_value: 0, range_steps: 0, is_logarithmic: false, display_priority: -1,