Hi there,
I am trying my luck here, cause i am fighting with the logic of this and can not for the love of me figure it out and i think it is very easily doable.
i’m looking to use one knob to control two parameters with the use of a switch. = switch not pressed, control param 1 is the switch pressed and held control param 2.
when switching the current value is stored in a [sah] and when switching back i want a soft takeover to occur. so not a sudden change of the param value to the current knob value, but rather only change as soon as it crossed the value stored in the sah.
in attachement what i have now, i feel i am one or two nodes away of cracking it. controlling 2 params works, but the soft takeover mode is struggling. i think the answer lies within checking if the current knob value is above or below t he stored value and based on that waiting for it to [<=] or [>=] respectively before switching back to the knob value. maybe with a selector or a gate or something between the latch and the output?
my brain is exploding any help would be greatly appreciated!!
{
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "switch to change between params",
"linecount" : 2,
"id" : "obj-7",
"patching_rect" : [ 292.0, 121.0, 150.0, 33.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "param 2 sah value",
"id" : "obj-17",
"patching_rect" : [ 439.0, 384.0, 150.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "param 1 sah value",
"id" : "obj-16",
"patching_rect" : [ 181.0, 384.0, 150.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "param 2",
"id" : "obj-15",
"patching_rect" : [ 439.0, 354.0, 150.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "param 1",
"id" : "obj-14",
"patching_rect" : [ 181.0, 353.0, 150.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "number~",
"id" : "obj-12",
"outlettype" : [ "signal", "float" ],
"fontsize" : 12.0,
"mode" : 2,
"sig" : 0.0,
"fontname" : "Arial",
"patching_rect" : [ 379.0, 384.0, 56.0, 22.0 ],
"numinlets" : 2,
"fontface" : 0,
"numoutlets" : 2
}
}
, {
"box" : {
"maxclass" : "number~",
"id" : "obj-11",
"outlettype" : [ "signal", "float" ],
"fontsize" : 12.0,
"mode" : 2,
"sig" : 0.0,
"fontname" : "Arial",
"patching_rect" : [ 118.5, 384.0, 56.0, 22.0 ],
"numinlets" : 2,
"fontface" : 0,
"numoutlets" : 2
}
}
, {
"box" : {
"maxclass" : "number~",
"id" : "obj-10",
"outlettype" : [ "signal", "float" ],
"fontsize" : 12.0,
"mode" : 2,
"sig" : 0.0,
"fontname" : "Arial",
"patching_rect" : [ 379.0, 353.0, 56.0, 22.0 ],
"numinlets" : 2,
"fontface" : 0,
"numoutlets" : 2
}
}
, {
"box" : {
"maxclass" : "attrui",
"id" : "obj-9",
"parameter_enable" : 0,
"outlettype" : [ "" ],
"attr" : "sw1",
"patching_rect" : [ 285.0, 162.0, 150.0, 22.0 ],
"numinlets" : 1,
"displaymode" : 8,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "attrui",
"id" : "obj-6",
"parameter_enable" : 0,
"outlettype" : [ "" ],
"attr" : "knob1",
"patching_rect" : [ 118.5, 162.0, 150.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "number~",
"id" : "obj-3",
"outlettype" : [ "signal", "float" ],
"fontsize" : 12.0,
"mode" : 2,
"sig" : 0.0,
"fontname" : "Arial",
"patching_rect" : [ 118.5, 353.0, 56.0, 22.0 ],
"numinlets" : 2,
"fontface" : 0,
"numoutlets" : 2
}
}
, {
"box" : {
"maxclass" : "ezdac~",
"id" : "obj-2",
"patching_rect" : [ 228.0, 587.0, 45.0, 45.0 ],
"numinlets" : 2,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "gen~",
"id" : "obj-1",
"outlettype" : [ "signal", "signal", "signal", "signal" ],
"patching_rect" : [ 232.5, 249.0, 36.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 4,
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 6,
"revision" : 0,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "dsp.gen",
"rect" : [ 757.0, 106.0, 937.0, 896.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 0,
"toolbars_unpinned_last_save" : 0,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "sample when switch is unpressed",
"linecount" : 2,
"id" : "obj-59",
"patching_rect" : [ 487.0, 304.5, 122.0, 33.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "sample when switch is pressed",
"linecount" : 2,
"id" : "obj-58",
"patching_rect" : [ 205.0, 308.5, 122.0, 33.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "latch when switch is pressed",
"linecount" : 2,
"id" : "obj-57",
"patching_rect" : [ 299.0, 268.5, 122.0, 33.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "comment",
"text" : "latch when switch is unpressed",
"linecount" : 2,
"id" : "obj-55",
"patching_rect" : [ 14.0, 268.5, 122.0, 33.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "== 0",
"id" : "obj-29",
"outlettype" : [ "" ],
"patching_rect" : [ 479.0, 215.0, 33.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sah",
"id" : "obj-28",
"outlettype" : [ "" ],
"patching_rect" : [ 188.0, 274.0, 40.0, 22.0 ],
"numinlets" : 3,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "out 3",
"id" : "obj-27",
"patching_rect" : [ 188.0, 367.0, 35.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "out 4",
"id" : "obj-26",
"patching_rect" : [ 468.5, 367.0, 35.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "sah",
"id" : "obj-23",
"outlettype" : [ "" ],
"patching_rect" : [ 468.5, 274.0, 40.0, 22.0 ],
"numinlets" : 3,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "== 0",
"id" : "obj-12",
"outlettype" : [ "" ],
"patching_rect" : [ 154.0, 221.0, 33.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "out 2",
"id" : "obj-11",
"patching_rect" : [ 423.0, 577.0, 35.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "latch",
"id" : "obj-9",
"outlettype" : [ "" ],
"patching_rect" : [ 138.0, 274.0, 34.0, 22.0 ],
"numinlets" : 2,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "param sw1 @min 0 @max 1",
"id" : "obj-8",
"outlettype" : [ "" ],
"patching_rect" : [ 423.0, 110.0, 160.0, 22.0 ],
"numinlets" : 0,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "latch",
"id" : "obj-7",
"outlettype" : [ "" ],
"patching_rect" : [ 423.0, 274.0, 34.0, 22.0 ],
"numinlets" : 2,
"numoutlets" : 1
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "out 1",
"id" : "obj-6",
"patching_rect" : [ 138.0, 577.0, 35.0, 22.0 ],
"numinlets" : 1,
"numoutlets" : 0
}
}
, {
"box" : {
"maxclass" : "newobj",
"text" : "param knob1 @min 0 @max 1",
"id" : "obj-5",
"outlettype" : [ "" ],
"patching_rect" : [ 129.0, 110.0, 172.0, 22.0 ],
"numinlets" : 0,
"numoutlets" : 1
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-9", 0 ],
"destination" : [ "obj-6", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-7", 1 ],
"midpoints" : [ 432.5, 169.0, 447.5, 169.0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-29", 0 ],
"midpoints" : [ 432.5, 201.0, 488.5, 201.0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-28", 1 ],
"midpoints" : [ 432.5, 255.0, 208.0, 255.0 ],
"order" : 2
}
}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-12", 0 ],
"midpoints" : [ 432.5, 207.0, 163.5, 207.0 ],
"order" : 3
}
}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-11", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-9", 0 ],
"midpoints" : [ 138.5, 255.0, 147.5, 255.0 ],
"order" : 3
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-7", 0 ],
"midpoints" : [ 138.5, 180.0, 432.5, 180.0 ],
"order" : 1
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-28", 0 ],
"midpoints" : [ 138.5, 255.0, 197.5, 255.0 ],
"order" : 2
}
}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-23", 0 ],
"midpoints" : [ 138.5, 196.0, 478.0, 196.0 ],
"order" : 0
}
}
, {
"patchline" : {
"source" : [ "obj-29", 0 ],
"destination" : [ "obj-23", 1 ],
"midpoints" : [ 488.5, 240.0, 488.5, 240.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-28", 0 ],
"destination" : [ "obj-27", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-26", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-9", 1 ],
"midpoints" : [ 163.5, 246.0, 162.5, 246.0 ]
}
}
]
}
}
}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-9", 0 ],
"destination" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 0 ],
"destination" : [ "obj-3", 0 ],
"midpoints" : [ 242.0, 339.0, 128.0, 339.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 3 ],
"destination" : [ "obj-12", 0 ],
"midpoints" : [ 259.0, 427.0, 388.5, 427.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 2 ],
"destination" : [ "obj-11", 0 ],
"midpoints" : [ 253.333333333333314, 428.0, 128.0, 428.0 ]
}
}
, {
"patchline" : {
"source" : [ "obj-1", 1 ],
"destination" : [ "obj-10", 0 ],
"midpoints" : [ 247.666666666666657, 339.0, 388.5, 339.0 ]
}
}
],
"appversion" : {
"major" : 8,
"minor" : 6,
"revision" : 0,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box"
}