Check whether Playback is within in Loop Range - Delayed Output
Hey,
I made a patch that outputs 1 if the playhead is within the loop range and 0 if it is not. It works fine, it's only that when Live is playing back and then leaves the loop range, it takes a bit until the output switches to zero.
My guess is because the patch is constantly checking for every float point number of the playhead position whether it is within the range and during playback that results in a lot of operations.
If Live is not playing back, then the output changes super quick when clicking in/out of the loop range.
Would appreciate some help if someone knows how to get this reacting more quickly :)
post Copy - Compressed patches....
not .zip ...
Here is the copied patch, is that what you mean?
{
"boxes" : [ {
"box" : {
"maxclass" : "newobj",
"text" : "change",
"numinlets" : 1,
"id" : "obj-1",
"numoutlets" : 3,
"outlettype" : [ "", "int", "int" ],
"patching_rect" : [ 395.0, 692.0, 48.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "outlet",
"numinlets" : 1,
"id" : "obj-2",
"numoutlets" : 0,
"patching_rect" : [ 305.0, 787.0, 30.0, 30.0 ],
"comment" : "",
"index" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"numinlets" : 2,
"id" : "obj-4",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 207.0, 598.0, 29.5, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "<=",
"numinlets" : 2,
"id" : "obj-52",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 250.0, 480.0, 29.5, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "+",
"numinlets" : 2,
"id" : "obj-51",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 330.0, 480.0, 29.5, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : ">=",
"numinlets" : 2,
"id" : "obj-48",
"numoutlets" : 1,
"outlettype" : [ "int" ],
"patching_rect" : [ 195.75, 480.0, 29.5, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "if $i1 == 2 then 1 else 0",
"numinlets" : 1,
"id" : "obj-43",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 207.0, 631.0, 133.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadmess property loop_length",
"numinlets" : 1,
"id" : "obj-36",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 525.084662318229675, 217.16049200296402, 173.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "live.observer",
"numinlets" : 2,
"id" : "obj-35",
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 547.0, 289.0, 77.0, 22.0 ],
"saved_object_attributes" : {
"_persistence" : 1
}
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadmess property loop_start",
"numinlets" : 1,
"id" : "obj-33",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 355.5, 212.0, 163.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "live.observer",
"numinlets" : 2,
"id" : "obj-32",
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 426.0, 289.0, 77.0, 22.0 ],
"saved_object_attributes" : {
"_persistence" : 1
}
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadmess property current_song_time",
"numinlets" : 1,
"id" : "obj-28",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 115.0, 307.16049200296402, 210.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "live.observer",
"numinlets" : 2,
"id" : "obj-20",
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 115.0, 371.0, 77.0, 22.0 ],
"saved_object_attributes" : {
"_persistence" : 1
}
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "loadmess path live_set",
"numinlets" : 1,
"id" : "obj-17",
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 94.0, 65.0, 131.0, 22.0 ]
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "live.path",
"numinlets" : 1,
"id" : "obj-37",
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 94.0, 133.0, 53.0, 22.0 ]
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-52", 0 ],
"destination" : [ "obj-4", 1 ]
}
}
, {
"patchline" : {
"source" : [ "obj-51", 0 ],
"destination" : [ "obj-52", 1 ]
}
}
, {
"patchline" : {
"source" : [ "obj-48", 0 ],
"destination" : [ "obj-4", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-43", 0 ],
"destination" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-43", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-37", 0 ],
"destination" : [ "obj-35", 1 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-37", 0 ],
"destination" : [ "obj-32", 1 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-37", 0 ],
"destination" : [ "obj-20", 1 ],
"order" : 2
}
}
, {
"patchline" : {
"source" : [ "obj-36", 0 ],
"destination" : [ "obj-35", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-35", 0 ],
"destination" : [ "obj-51", 1 ]
}
}
, {
"patchline" : {
"source" : [ "obj-33", 0 ],
"destination" : [ "obj-32", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-32", 0 ],
"destination" : [ "obj-51", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-32", 0 ],
"destination" : [ "obj-48", 1 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-28", 0 ],
"destination" : [ "obj-20", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-52", 0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-48", 0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-37", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-2", 0 ]
}
}
],
"appversion" : {
"major" : 8,
"minor" : 5,
"revision" : 8,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box"
}
1~ unlock patch , then :
2~
then paste it here.
this should work
works well, thanks!
is this due to the split object reacting quicker than if or why is this quicker? just curious :)
I am not using Live, so can't really say,
but in general, no matter if max or live,
it helps to patch efficiently, using as few objects as possible.