Dear forum members
I've written a small controller script for my homebrew controller with 3 potentiometers, 5 faders and two push buttons.
In my workflow, I'm assigning m faders and potentiometers ad hoc to different controls. For these, the script just assigns the same names as printed on my hardware. My controller also has two push buttons. One is assigned to the generic application action to toggle the assignment panel. The second starts the next scene in the mixer view. The user can tell the controller which scene to start next using the controller menu.
You can find the code on gitlab: https://gitlab.com/mad4linux/gidim43/-/ ... type=heads
The bit tricky part was starting the next scene with a button. My solution is getting a scene bank with one scene.Then, we need to be able to read two variables later:The user input field is an ordinary text input:The code above is called during the init routine.
Then, when pressing the assigned button, the value from the text input is read, checked for non numeric values and also boundaries of the song:Then, the scene bank is moved to the desired position and the only bank in it is started:At least, the value in the text input is increased to the next number for the next button press:
I've written a small controller script for my homebrew controller with 3 potentiometers, 5 faders and two push buttons.
In my workflow, I'm assigning m faders and potentiometers ad hoc to different controls. For these, the script just assigns the same names as printed on my hardware. My controller also has two push buttons. One is assigned to the generic application action to toggle the assignment panel. The second starts the next scene in the mixer view. The user can tell the controller which scene to start next using the controller menu.
You can find the code on gitlab: https://gitlab.com/mad4linux/gidim43/-/ ... type=heads
The bit tricky part was starting the next scene with a button. My solution is getting a scene bank with one scene.
Code:
sceneStrip = host.createSceneBank(1);
Code:
sceneStrip.scrollPosition().markInterested();sceneStrip.itemCount().markInterested();
Code:
activeScene = host.DocumentState.getStringSetting("Pressing B2 starts scene", "Gidim43", 1, "1");
Then, when pressing the assigned button, the value from the text input is read, checked for non numeric values and also boundaries of the song:
Code:
let actScene = parseInt(activeScene.get()) - 1; // indexes from 0, scenes from scene1if (isNaN(actScene)) { actScene = 0; }if (actScene < 0) { actScene = 0; } else if (actScene >= parseInt(sceneStrip.itemCount().get())) { actScene = parseInt(sceneStrip.itemCount().get()) - 1; }
Code:
sceneStrip.scrollPosition().set(actScene); sceneStrip.launch(0);
Code:
activeScene.set(parseInt(actScene + 2)); // increase by one
Statistics: Posted by mad4linux — Sat Dec 23, 2023 3:51 pm — Replies 0 — Views 18