I wonder if there is a way to obtain the length of a loop region and then store it as a rounded-up int value in the user properties. I have a javascript script that helps me handle accessing and creating user properties for things such as key and tempo:
Is there a way to get the length of a loop region and then store it as a userproperty? I want to add that I will only ever have a single loop marker per event, no more than that.
An array of marker tracks of an event can be accessed from the member markerTracks - each row of logic markers in the editor corresponds to a marker track. You can then access the markers belonging to the track from the markerTrack’s markers member. In the case of just wanting to check for loop regions, you can use .isOfExactType('LoopRegion') to check whether a marker is a loop region, and then access the region’s position and length from position and length respectively.
For example, the following script will iterate through all marker tracks for loop regions, and print their names, positions, and lengths to console: