varlayout=0;// 0: grid mode (same as [preset]). 1: list mode
vardisplay_interp=1;// Enable/disable the UI feedback when interpolating between presets
varignore_slot_zero=1;// Makes previous_active_slot and interpolation display to ignore slot 0. Can be usefull when using slot 0 as a temporary step for interpolation.
varauto_writeagain=0;// When enabled, will send a "writeagain" to pattrstorage any time a preset is stored/deleted/moved/renamed/(un)locked
varmenu_number_only=0;// Populates the umenu connected to 2nd outlet with stored preset number only, instead of number and name
varscrollable=1;// Defines weither the object can be scrolled or not
varmin_rows=50;// Minimum number of rows to display is scrollable is enabled
varmin_rows=50;// Minimum number of rows to display if scrollable is enabled
varcolor_mode=0;// Change the way the filled slots (stored presets) color is handeld. 0: stored_slot_color. 1: looping through color_1 to color_6
varselect_mode=0;// 0: single click to select and recall the slot. 1: single click to select the slot, double click to recall it.
// (WORK)
varpattrstorage_name,pattrstorage_obj=null;
@ -75,7 +87,8 @@ var filled_slots = []; // List of stored slots
// Rather than using an array of colors, each color has its own variable, so they can be declared as attributes and saved with the patch
// But that makes the code sooo ugly...
varargs=arrayfromargs(arguments);
if(args.length==0){
color_wheel_custom=[];
color_wheel_custom=color_wheel_default.slice();
color_1=color_wheel_default[0];
color_2=color_wheel_default[1];
color_3=color_wheel_default[2];
color_4=color_wheel_default[3];
color_5=color_wheel_default[4];
color_6=color_wheel_default[5];
}elseif(args.length==5){
varn=args[0];
varcol=[args[1],args[2],args[3],args[4]]
if(n>0&&n<7){
switch(n){
case1:
color_1=col;
break;
case2:
color_2=col;
break;
case3:
color_3=col;
break;
case4:
color_4=col;
break;
case5:
color_5=col;
break;
case6:
color_6=col;
break;
}
color_wheel_custom[n-1]=col;
}else{
error('color_wheel: index out of range\n');
}
}
paint_base();
}
functionanything(){
// Here just to avoid error messages in case pattrstorage sends unhandled message, like when using getstoredvalue, getsubscriptionlist, getalias, etc.
@ -494,27 +581,23 @@ function slotlist() {
to_pattrstorage("getslotname",filled_slots[i]);
}
}
// paint_base();
}
functionslotname(){
varargs=arrayfromargs(arguments);
if(args[0]>0&&args[1]!="(undefined)"){
slots[args[0]][4]=args[1];
}
}
functionsetslotname(){
// Because [pattrstorage] doesn't output anything when renaming presets with "slotname", we use a custom "setslotname" instead, that will rename the active preset
"text" : "Minimum number of slots to display when scrollable is enabled. If a preset is stored in a slot higher than that value, then it is ignored."
"patching_rect" : [ 901.0, 1017.0, 164.0, 20.0 ],
"text" : "Reset a given color to default"
}
}
, {
"box" : {
"id" : "obj-62",
"linecount" : 3,
"id" : "obj-122",
"linecount" : 2,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 573.0, 538.0, 150.0, 47.0 ],
"text" : "Enable to scroll through your presets! (Only work in list mode currently)"
"patching_rect" : [ 959.0, 908.0, 131.0, 33.0 ],
"text" : "Set a given color (from 1 to 6)"
}
}
, {
"box" : {
"id" : "obj-60",
"maxclass" : "number",
"id" : "obj-120",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 830.0, 927.0, 123.0, 22.0 ],
"presentation_linecount" : 2,
"text" : "color_wheel 3 0 1 1 1"
}
}
, {
"box" : {
"id" : "obj-119",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 768.0, 550.0, 50.0, 22.0 ]
"numoutlets" : 0,
"patching_rect" : [ 927.0, 993.0, 150.0, 20.0 ],
"text" : "Reset all colors to default"
}
}
, {
"box" : {
"id" : "obj-57",
"id" : "obj-117",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 768.0, 583.0, 77.0, 22.0 ],
"text" : "min_rows $1"
"patching_rect" : [ 830.0, 1017.0, 48.0, 22.0 ],
"text" : "color_3"
}
}
, {
"box" : {
"id" : "obj-39",
"linecount" : 2,
"id" : "obj-115",
"linecount" : 8,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 361.0, 546.0, 150.0, 33.0 ],
"text" : "Choose to display presets as a grid (0) or a list (1)!"
"patching_rect" : [ 876.0, 145.0, 150.0, 114.0 ],
"text" : "When select mode is enabled, a single click selects a stored preset without recalling it. It allows to drag it, set its name and lock state while keeping the last recalled preset active. "
}
}
, {
"box" : {
"id" : "obj-33",
"id" : "obj-113",
"linecount" : 6,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 928.0, 780.0, 150.0, 87.0 ],
"text" : "When color mode is set to cycle, stored presets are shown in colors from color_1 to color_6, cyclically depending on their slot number."
}
}
, {
"box" : {
"id" : "obj-111",
"items" : [ "Off", ",", "Cycle" ],
"maxclass" : "umenu",
"numinlets" : 1,
"numoutlets" : 3,
"outlettype" : [ "int", "", "" ],
"parameter_enable" : 0,
"patching_rect" : [ 835.0, 780.0, 62.0, 22.0 ]
}
}
, {
"box" : {
"id" : "obj-108",
"maxclass" : "toggle",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"parameter_enable" : 0,
"patching_rect" : [ 545.0, 549.0, 24.0, 24.0 ]
"patching_rect" : [ 849.0, 235.0, 24.0, 24.0 ]
}
}
, {
"box" : {
"id" : "obj-35",
"id" : "obj-104",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 545.0, 583.0, 76.0, 22.0 ],
"text" : "scrollable $1"
"patching_rect" : [ 835.0, 812.0, 88.0, 22.0 ],
"text" : "color_mode $1"
}
}
, {
"box" : {
"id" : "obj-29",
"maxclass" : "toggle",
"numinlets" : 1,
"id" : "obj-99",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"parameter_enable" : 0,
"patching_rect" : [ 334.0, 550.0, 24.0, 24.0 ]
"outlettype" : [ "" ],
"patching_rect" : [ 830.0, 900.0, 88.0, 22.0 ],
"text" : "color_3 1 0 1 1"
}
}
, {
"box" : {
"id" : "obj-15",
"id" : "obj-95",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 334.0, 583.0, 57.0, 22.0 ],
"text" : "layout $1"
"patching_rect" : [ 830.0, 991.0, 73.0, 22.0 ],
"text" : "color_wheel"
}
}
, {
"box" : {
"id" : "obj-65",
"linecount" : 6,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 959.0, 534.0, 153.0, 87.0 ],
"text" : "Minimum number of slots to display when scrollable is enabled. If a preset is stored in a slot higher than that value, then it is ignored."
}
}
, {
"box" : {
"id" : "obj-62",
"linecount" : 3,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 949.5, 460.0, 150.0, 47.0 ],
"text" : "Enable to scroll through your presets! (Only work in list mode currently)"
}
}
, {
"box" : {
"id" : "obj-60",
"maxclass" : "number",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 849.0, 540.0, 50.0, 22.0 ]
}
}
, {
"box" : {
"id" : "obj-39",
"linecount" : 2,
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 932.5, 368.5, 150.0, 33.0 ],
"text" : "Choose to display presets as a grid (0) or a list (1)!"