Skip to content

Commit

Permalink
feat: add support for FX BPM setting
Browse files Browse the repository at this point in the history
  • Loading branch information
fmalcher committed Oct 25, 2024
1 parent 9950317 commit be3aa8a
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 0 deletions.
226 changes: 226 additions & 0 deletions examples/page12-fx-settings.companionconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"version": 4,
"type": "page",
"page": {
"name": "FX Settings",
"controls": {
"0": {
"0": {
"type": "pageup"
},
"1": {
"type": "button",
"style": {
"text": "BPM 120\\nFX 2,3,4",
"textExpression": false,
"size": "14",
"png64": null,
"alignment": "center:center",
"pngalignment": "center:center",
"color": 16777215,
"bgcolor": 0,
"show_topbar": "default"
},
"options": {
"relativeDelay": false,
"rotaryActions": false,
"stepAutoProgress": true
},
"feedbacks": [],
"steps": {
"0": {
"action_sets": {
"down": [
{
"id": "OARPe-Gg6irO-VAkLJbRH",
"action": "setfxbpm",
"instance": "K5mVTsGHIPgqYkyqYxEWS",
"options": {
"fx": [
2,
3,
4
],
"bpm": 120
},
"delay": 0
}
],
"up": []
},
"options": {
"runWhileHeld": []
}
}
}
},
"2": {
"type": "button",
"style": {
"text": "BPM 60\\nFX 2,3,4",
"textExpression": false,
"size": "14",
"png64": null,
"alignment": "center:center",
"pngalignment": "center:center",
"color": 16777215,
"bgcolor": 0,
"show_topbar": "default"
},
"options": {
"relativeDelay": false,
"rotaryActions": false,
"stepAutoProgress": true
},
"feedbacks": [],
"steps": {
"0": {
"action_sets": {
"down": [
{
"id": "lFiVLFdmrjX8IckLqnsqR",
"action": "setfxbpm",
"instance": "K5mVTsGHIPgqYkyqYxEWS",
"options": {
"fx": [
2,
3,
4
],
"bpm": 60
},
"delay": 0
}
],
"up": []
},
"options": {
"runWhileHeld": []
}
}
}
},
"3": {
"type": "button",
"style": {
"text": "BPM 80\\nFX 4",
"textExpression": false,
"size": "14",
"png64": null,
"alignment": "center:center",
"pngalignment": "center:center",
"color": 16777215,
"bgcolor": 0,
"show_topbar": "default"
},
"options": {
"relativeDelay": false,
"rotaryActions": false,
"stepAutoProgress": true
},
"feedbacks": [],
"steps": {
"0": {
"action_sets": {
"down": [
{
"id": "TQS54cQ8UDbp8u2TNzDGo",
"action": "setfxbpm",
"instance": "K5mVTsGHIPgqYkyqYxEWS",
"options": {
"fx": [
4
],
"bpm": 80
},
"delay": 0
}
],
"up": []
},
"options": {
"runWhileHeld": []
}
}
}
},
"4": {
"type": "button",
"style": {
"text": "BPM 100\\nFX 3",
"textExpression": false,
"size": "14",
"png64": null,
"alignment": "center:center",
"pngalignment": "center:center",
"color": 16777215,
"bgcolor": 0,
"show_topbar": "default"
},
"options": {
"relativeDelay": false,
"rotaryActions": false,
"stepAutoProgress": true
},
"feedbacks": [],
"steps": {
"0": {
"action_sets": {
"down": [
{
"id": "YYPIz5BL2opF6x84x9VIX",
"action": "setfxbpm",
"instance": "K5mVTsGHIPgqYkyqYxEWS",
"options": {
"fx": [
3
],
"bpm": 100
},
"delay": 0
}
],
"up": []
},
"options": {
"runWhileHeld": []
}
}
}
}
},
"1": {
"0": {
"type": "pagenum"
}
},
"2": {
"0": {
"type": "pagedown"
}
}
},
"gridSize": {
"minColumn": 0,
"maxColumn": 7,
"minRow": 0,
"maxRow": 3
}
},
"instances": {
"K5mVTsGHIPgqYkyqYxEWS": {
"instance_type": "soundcraft-ui",
"sortOrder": 2,
"label": "ui24",
"isFirstInit": false,
"config": {
"product": "UI24",
"host": "10.75.23.95",
"import_to": "M56cJZPf5-"
},
"enabled": true,
"lastUpgradeIndex": 1
}
},
"oldPageNumber": 96
}
41 changes: 41 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export enum ActionId {
ChangeFxChannelValue = 'changefxchannelvalue',
FadeFxChannel = 'fadefxchannel',

// FX Settings
SetFxBPM = 'setfxbpm',

// Volume Buses (SOLO, Headphone)
SetVolumeBusValue = 'setvolumebusvalue',
ChangeVolumeBusValue = 'changevolumebusvalue',
Expand Down Expand Up @@ -496,6 +499,44 @@ export function GetActionsList(conn: SoundcraftUI): CompanionActionDefinitions {
},
},

/**
* FX Settings
*/
[ActionId.SetFxBPM]: {
name: 'FX: Set BPM',
description: 'Set BPM value for FX processors',
options: [
{
type: 'multidropdown',
label: 'FX',
id: 'fx',
choices: [
{ id: 1, label: 'FX 1' },
{ id: 2, label: 'FX 2' },
{ id: 3, label: 'FX 3' },
{ id: 4, label: 'FX 4' },
],
default: [2, 3, 4],
minSelection: 1,
},
{
type: 'number',
label: 'BPM',
id: 'bpm',
min: 20,
max: 400,
default: 120,
},
],
callback: (action) => {
const bpm = Number(action.options.bpm)
const chosenFx = action.options.fx as number[]
chosenFx.forEach((fxNo) => {
conn.fx(fxNo).setBpm(bpm)
})
},
},

/**
* Media Player
*/
Expand Down

0 comments on commit be3aa8a

Please sign in to comment.