Setting post recording delay with beat time.

Post Reply New Topic
RELATED
PRODUCTS

Post

I want to set the post recording clip delay in my script with buttons for 1bar 4bar 8bar on my touch osc display. But I don’t really understand how to pass the beat time through the post recording delay function based in what it says in the api. I’m stuck.

Thanks

Post

Is this accessible with the API? I did not find anything in the API documentation but this would be great for me...

Post

Ah OK, I found getClipLauncherPostRecordingTimeOffset() for transport and I got it to work like this (with the global variable "offset"):

in init:

Code: Select all

transport.getClipLauncherPostRecordingTimeOffset().markInterested();
offset = transport.getClipLauncherPostRecordingTimeOffset()
and then with a button:

Code: Select all

offset.set(8);
This gives me a Post Recording Delay of 2 bars (8 beats).
Would there be a way to set this as a time format like 02:00:00:00 in order to make it two bars? The solution above only works with 4/4, I want to assign 4 buttons for specific numbers of bars.

Post

In order to have different LEDs light up according to the current Post Recording Delay I hade to first format the beat time value. For my script that was done with

Code: Select all

time = offset.geFormatted()
and then something like

Code: Select all

if(i == 1 && time == "002:00:00:00")
{
	colour = Colour.GREEN_FULL
}
Now I have a last question, everything else works nicely!!
I also want to show the current Defaul Clip Launch Quantization, which is a SettableEnumValue (can have values like "1", "1/2", "1/4"...). How can I check the current state for the right LED to be lit?
I have

Code: Select all

transport.defaultLaunchQuantization().markInterested();
quant = transport.defaultLaunchQuantization();
Do I need a similar procedure like getFormatted()? I can't seem to compare "quant" with a string:

Code: Select all

if(j == 5 && quant == "1")
{
	colour = Colour.RED_FULL
}
This does not work... Current version is also on github, https://github.com/TVbene/LaunchpadScriptV3/ --> launchpad_grid.js.

Post

Alright folks, script is working, just closure :lol: :

in order to set default launch quantize we had

Code: Select all

transport.defaultLaunchQuantization().set()
of course for getting the value you need

Code: Select all

transport.defaultLaunchQuantization().set()
so in my case I need something like

Code: Select all

quantValue = quant.get();
which makes it possible to have

Code: Select all

if quantValue == "1"

Post Reply

Return to “Controller Scripting”