Javascript Macro Action Requests

Discussion about: tracktion.com
HansP
KVRist
196 posts since 9 Sep, 2017

Post Tue Feb 27, 2018 12:54 pm

Allow me a suggestion, that goes to the developers and the contributors.

Please, develop a meta-plugin to be used by macros, that can also store edit-based macros, i.e. that have been customized to do some work that is particular to the current mix, referencing to certain distinct tracks etc.

I would call it MacroTron :)
It should follow the technical principles of the "text" stock plugin. The text is stored in the edit XML.

Features:

* the MacroTron should have its own little object model. This has the main purpose, that it can store permanent macro data in the edit.
So, we can assign a js variable value to a MacroTron object, and it will be saved as if it were some plugin eq parameter. A numbered parameter array or a named collection would do.
When we run a macro, it can use data that is particular to the current edit.

* instead of memo texts, MacroTron can save a bunch of macro scripts, as well as respective help texts, and somehow communicate with the UI to quickly click those macros, and show the help when hovering before click. The UI can also edit those plugin parameters that are actually macro permanent data, with knob controls and text edit controls.

* the MacroTron plugin sits in a track, and the user who does program a macro for it, can use the track reference (that exists in the object model), or not use it, and just have the track be some home of some metaplugin without further direct connection.

* with the preset mechanism, we can proliferate a particular complex MacroTron that we had put together, to other projects and edits.


(I am optimistic that a big part of this task can be done with reusing good code that already exists.)

iwaiwa
KVRer
5 posts since 17 Dec, 2006

Re: Javascript Macro Action Requests

Post Tue Mar 27, 2018 2:09 pm

-- just recently discovered Keyboard Shortcut Macros (Scripts)

thanks Tracktion Devs :)

No rush, but I have been struggling with finding a way to GoTo / JumpTo or even Select the First Track -- I think that would be (Track[0])

for now, as long as I physically select a Track, I can run this script to Mute a Track I am already on (already selected):

var track = Tracktion.getTrackFromSelectedObject();
Tracktion.setMute (track, true);

also Interestingly:

as long as I have already selected a track, this command works:

Tracktion.selectItem ('bottom');

(which will 'JumpTo' and highlight/select the highest numbered track)

but this command does not work:

Tracktion.selectItem ('top');

doesn't seem to do anything


no rush

thanks much

keep up the awesome work

Ira

San Jose, CA
USA

User avatar
Robert Randolph
KVRAF
2208 posts since 25 May, 2003 from Saint Petersburg, Florida

Re: Javascript Macro Action Requests

Post Sat Mar 31, 2018 9:20 am

Is there a reason why the (for .. in .. ) construct does not work in scripts?

Actually... most anything for working with objects is missing :( :x
http://admiralbumblebee.com/
Audio Software Reviews, Woodworking, Programming and more...

dRowAudio
KVRAF
1507 posts since 30 Dec, 2012

Re: Javascript Macro Action Requests

Post Tue Apr 03, 2018 5:55 am

Robert Randolph wrote:Is there a reason why the (for .. in .. ) construct does not work in scripts?

Actually... most anything for working with objects is missing :( :x
It's not implemented in the JUCE Javascript interpreter I'm afraid. We'll have to use ".length" for now.

User avatar
whyterabbyt
Beware the Quoth
27737 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair

Re: Javascript Macro Action Requests

Post Wed Aug 29, 2018 3:38 am

dRowAudio wrote:
busywait wrote:Event handlers for selections and marker clips on the Marker Track.

I want to register a macro to be run when the selected region is entered for the first time.

Like, I want to be able to turn on loop mode when the play head enters the selected region (that is, when and if the cursor hits the 'in' marker)

I don't know if registering handlers for these events would be best done in code or with a bit more UI. Certainly there is room in the Marker Clip properties panel for a macro to be referenced.

Maybe code would look like
selection.onEnter( toggleTransport('loop') );
or
Markers( 'Marker 1' ).onEnter( selectCurrentMarkerAndLoop() );
That's a very cool idea. It's not something the current engine would support though as all these scripts are parsed and run when the action is called (i.e. a key press or "Run Script" button).
It might be possible to add dispatchers to events like this which would yield a slightly different paradigm: select marker clip -> add action -> on enter -> run script X

I do like the idea of more Javascript-esque event handlers though. Perhaps it's something we'll look into in the future.
bump, from a couple of years ago. any possibility yet of some kind of callback from specific selection/deselection events happening?
Last edited by whyterabbyt on Wed Aug 29, 2018 3:40 am, edited 1 time in total.
"The bearer of this signature is a genuine and authorised pope."

User avatar
whyterabbyt
Beware the Quoth
27737 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair

Re: Javascript Macro Action Requests

Post Wed Aug 29, 2018 3:39 am

Axl wrote:- trigger scripts via midi commands (not an action but essential feature)
bump. would make controllers more flexible.
"The bearer of this signature is a genuine and authorised pope."

User avatar
whyterabbyt
Beware the Quoth
27737 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair

Re: Javascript Macro Action Requests

Post Wed Aug 29, 2018 3:42 am

dRowAudio wrote:
whyterabbyt wrote:Those, like the examples in the video, all seem to imply that X is fixed; hardcoded into the script. Are we likely to get user-interaction capabilities that let us define them at runtime eg

Code: Select all

var track = Tracktion.insertTrack ('audio');
var trackName = prompt.String("Track Name?);
Tracktion.setName (track, trackName);

var currentPos = Tracktion.getPosition ('transport');
var rewindTime = prompt.Float("Rewind By (secs)?);
Tracktion.setPosition ('transport', currentPos - rewindTime);
This isn't currently possible but is certainly something I'll be looking into once the feature is out of beta.
bump, from 2015. any news on some kind of user interaction with macros yet?
"The bearer of this signature is a genuine and authorised pope."

User avatar
whyterabbyt
Beware the Quoth
27737 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair

Re: Javascript Macro Action Requests

Post Wed Aug 29, 2018 3:43 am

Kang wrote:Would it be possible to control armed inputs?
kvruserr wrote:FR regarding record arm/enable
first macro: only record arm track x and y
second macro only record arm track a and b
bump, from 2015 and 2016. Control over inputs and arming still seems to be lacking?
"The bearer of this signature is a genuine and authorised pope."

User avatar
whyterabbyt
Beware the Quoth
27737 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair

Re: Javascript Macro Action Requests

Post Wed Aug 29, 2018 3:46 am

dRowAudio wrote:
Rock wrote:Does something like Tracktion.isArmed or Tracktion.isRecordEnabled exist? Is there another way of determining if a track is record enabled? If there is no way, please add.
Currently no, and because these properties are stored in a different part of the Edit, not with the track node, there's no way to get them using the raw tree object.

I've added them to the list of scripts to add but we're finalising a new release at the moment so are unlike to get added in the next few weeks. Hopefully soon after that though.
Bump from 2017. Querying stuff is good....
"The bearer of this signature is a genuine and authorised pope."

jk-nau
KVRer
1 posts since 7 Oct, 2018

Re: Javascript Macro Action Requests

Post Sun Oct 07, 2018 2:14 am

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
dRowAudio wrote:
Tue Jul 07, 2015 2:22 am
Kang wrote:Also, what about named markers on the fly?
Just added this. You can now add the clip types: 'barsBeatsMarker' & 'absoluteMarker'.
insertClip also returns an object so you can rename it or move it around etc.

Code: Select all (#)

// Insert Bars/Beats Marker Clip
var clip = Tracktion.insertClip ('barsBeatsMarker');
Tracktion.setName (clip, "Hello world!");
I defined macros for both marker types:
Tracktion.insertClip ('barsBeatsMarker');
Tracktion.insertClip ('absoluteMarker');
Both create a B&B-marker.
What are the Codes for a TC-marker and a Wave-File marker Could anybody help?

dRowAudio
KVRAF
1507 posts since 30 Dec, 2012

Re: Javascript Macro Action Requests

Post Mon Oct 08, 2018 2:25 am

This looks like a bug. I can't think of an easy work around at the moment but will add it to the bug tracker.

dRowAudio
KVRAF
1507 posts since 30 Dec, 2012

Re: Javascript Macro Action Requests

Post Mon Oct 08, 2018 2:26 am

whyterabbyt wrote:
Wed Aug 29, 2018 3:46 am
dRowAudio wrote:
Rock wrote:Does something like Tracktion.isArmed or Tracktion.isRecordEnabled exist? Is there another way of determining if a track is record enabled? If there is no way, please add.
Currently no, and because these properties are stored in a different part of the Edit, not with the track node, there's no way to get them using the raw tree object.

I've added them to the list of scripts to add but we're finalising a new release at the moment so are unlike to get added in the next few weeks. Hopefully soon after that though.
Bump from 2017. Querying stuff is good....
Sorry, we're absolutely swamped at the moment. I don't know when we'll get a chance to add this but I would certainly like to...

User avatar
gesslr
KVRian
541 posts since 8 Apr, 2014 from USA

Re: Javascript Macro Action Requests

Post Fri Oct 12, 2018 12:23 am

Any chance this topic could become a “sticky”?
------------
MacPro 5,1 | 64gb | OSX 10.14.5 | Studio One 4.5 | Waveform 10 | Logic Pro X | BWS 3b10 | CubasePro 10 |

http://www.soundwaremedia.com
http://www.facebook.com/geo.napier3

Rock
KVRian
1218 posts since 11 Apr, 2002 from Nashville, TN

Re: Javascript Macro Action Requests

Post Wed Jul 10, 2019 1:08 pm

• Tracktion.armSelectedTracks(); (to work like Tracktion.soloSelectedTracks() Perhaps a way to also get the status.

• I tried to create a macro to name each track after its input, but there seems to be no way to get the input names.
_______________________________________________________
As a related suggestion. Please include %input% as a variable for auto-naming clip files.

For example currently the default is: %projectdir%\%edit%_%track%_Take_%take%
_______________________________________________________

jonljacobi
KVRian
1318 posts since 16 Jan, 2013 from USA

Re: Javascript Macro Action Requests

Post Wed Jul 10, 2019 2:02 pm

I was looking at this to see if there was some way to automate transient marker insertion. Seems there's only getTransients and scroll to transient, but not insert marker. Am I missing something, or is this the case?

Return to “Tracktion”