Latest News: Bitwig updates Bitwig Studio to v5.1
loop selected region
-
- KVRer
- Topic Starter
- 25 posts since 1 Oct, 2018
hi, is there a way to trigger the "loop selected region" from a script? i can't find it in the api.
i would also be able to move the loop start and length with rotary encoders.
any ideas?
thanks
i would also be able to move the loop start and length with rotary encoders.
any ideas?
thanks
- KVRAF
- 4145 posts since 13 May, 2004
All items in the shortcut list are "Actions". Get an action with
from Application and call invoke().
To find the ID you can list all actions with getActions().
Here is my test script for actions:
Code: Select all
Action getAction (String id)
To find the ID you can list all actions with getActions().
Here is my test script for actions:
Code: Select all
loadAPI(7);
host.defineController("Moss", "Dump Actions", "1.0", "A2A82633-EC3A-48AD-A5B2-51EBD38F1CB1", "Jürgen Moßgraber");
host.defineMidiPorts(0, 0);
var application = null;
var actions = null;
var formattedActions = null;
var actionList = null;
function init ()
{
application = host.createApplication ();
actions = application.getActions ();
println (actions.length + " actions available.");
formatActions ();
var preferences = host.getPreferences ();
preferences.getSignalSetting (" ", "Dump", "Dump first 200 to console").addSignalObserver (function () {
for (var i = 0; i < 200; i++)
println (i + ":" + actions[i].getId () + ":" + actions[i].getCategory ().getName () + ":" + actions[i].getName ());
});
preferences.getSignalSetting (" ", "Dump", "Dump rest to console").addSignalObserver (function () {
for (var i = 200; i < actions.length; i++)
println (i + ":" + actions[i].getId () + ":" + actions[i].getCategory ().getName () + ":" + actions[i].getName ());
});
actionList = preferences.getEnumSetting ("Actions", "Execute", formattedActions, formattedActions[0]);
actionList.markInterested ();
preferences.getSignalSetting (" ", "Execute", "Execute").addSignalObserver (function () {
var action = actionList.get ();
for (var i = 0; i < formattedActions.length; i++)
{
if (action == formattedActions[i])
{
println ("Executing: " + actions[i].getName ());
actions[i].invoke ();
}
}
});
}
function formatActions ()
{
formattedActions = [];
for (var i = 0; i < actions.length; i++)
formattedActions[i] = actions[i].getName ();
}
function callAction (actionID)
{
var action = application.getAction (actionID);
if (action == null)
println("Action not found.");
else
{
println("Executing: " + action.getName ());
action.invoke ();
}
}
function exit()
{
println ("Exit");
}
- KVRist
- 324 posts since 12 Apr, 2020
That is awesome Moss! Thanks for the handy script too!
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest