Compare commits
33 Commits
23d91d1080
...
main
Author | SHA1 | Date | |
---|---|---|---|
6b07a8e90b | |||
aa2359c468 | |||
69cbe9b235 | |||
76ad31163f | |||
4df1c2b7e1 | |||
5b3b12e613 | |||
f9a3711507 | |||
af803d109e | |||
3214f0c673 | |||
65dd0ca8e0 | |||
83dc04b993 | |||
6f7ac37a05 | |||
5792689842 | |||
1f6e2b5c5a | |||
3b387c66d2 | |||
e07e8ef9ca | |||
8b91c7ad5d | |||
f0a41a6687 | |||
198718e2d2 | |||
03fb521851 | |||
c82a9053bb | |||
b85e2ff66b | |||
66faf94f77 | |||
8149b21855 | |||
2b27dee78f | |||
ec4e876d09 | |||
8c9691e18f | |||
e997380e76 | |||
154e9cdf40 | |||
9c5a750832 | |||
0835a07c52 | |||
4792644b03 | |||
5c983add1c |
@@ -17,12 +17,15 @@ A [jsui] replacement for the [preset] object in Cycling'74 Max.
|
||||
- More look customization
|
||||
- Dynamically adapts to resize both in Edit and Presentation mode
|
||||
- Select mode: simple click selects the slot, double click recalls it (allows for organizing presets without recalling them)
|
||||
- Color mode: ability to color sstored presets with 6 customizable colors (currently colors are only assigned automatically depending on slot number)
|
||||
- Color mode: various ways to colorize preset slots
|
||||
|
||||
## How to install
|
||||
- [Download](https://github.com/Teufeuleu/tc.preset/archive/refs/heads/main.zip) this repository (and please consider donating on the [gumroad page](https://glucose47.gumroad.com/l/tc_preset) if you like this package)
|
||||
- Unzip the downloaded file and place the tc.preset folder in your Max Library package.
|
||||
- Restart Max
|
||||
|
||||
## How to use
|
||||
- Place `tc.preset.js` in the same directory as your patch, or somewhere in the Max search path
|
||||
- Create a [`jsui @filename tc.preset.js`].
|
||||
- In your Max patch, reate a [`tc.preset`] object (or a more lenghty [`jsui @filename tc.preset.js`])
|
||||
- Connect the [pattrstorage] outlet to the [jsui] inlet
|
||||
- Set the jsui attribute named "pattrstorage" to the name of the pattrstorage you just connected (or send a message like "pattrstorage my_pattrstorage_name")
|
||||
|
||||
|
@@ -53,12 +53,24 @@
|
||||
<description>Function depends on inlet</description>
|
||||
</method> -->
|
||||
<method name="color_wheel">
|
||||
<digest>Set the slot colors</digest>
|
||||
<digest>Define color wheel colors</digest>
|
||||
<description>The message "color_wheel", followed by an integer and four float, defines one of the 6 available slot colors when color_mode is enabled.
|
||||
The integer argument, between 1 and 6, defines which color in being modifier, and next the four floats define the color in the RGBA format.
|
||||
The integer argument, between 1 and 6, defines which color in being modified, and next the four floats define the color in the RGBA format.
|
||||
The message "color_wheel" without argument resets the six colors to their default values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="setcolor">
|
||||
<digest>Set the preset colors</digest>
|
||||
<description>The message "setcolor" allows to set the color of a preset as shown when in color_mode 2 (select) or 3 (custom).
|
||||
With 1 or 2 integer arguments, it allows to set a preset color as seen in color mode 2. With 4 float arguments or 1 integer followed by 4 floats, it allows to set a preset color for the color mode 3.
|
||||
With 1 integer argument, the currently selected preset color wheel's color is set to the argument's value.
|
||||
With two integer arguments, the preset number defined by first argument is set to color wheel's color defined by the second argument.
|
||||
With 4 float arguments, the currently selected preset is set to a custom color defined by the four arguments (in RGBA format).
|
||||
With 1 integer followed by 4 float arguments, the preset number defined by first argument is set to a custom color defined by the four arguments (in RGBA format).
|
||||
The integer argument, between 1 and 6, defines which color in being modifier, and next the four floats define the color in the RGBA format.
|
||||
With no argument, it resets colors for the select preset to default values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="pattrstorage">
|
||||
<digest>Link to named pattrstorage object</digest>
|
||||
<description>The word 'pattrstorage' followed by the name of an existing pattrstorage links the jsui to that pattrstorage.
|
||||
@@ -66,6 +78,11 @@
|
||||
If the word `pattrstorage`is sent alone, the jsui is unlinked from any pattrstorage.
|
||||
</description>
|
||||
</method>
|
||||
<method name="recall_filled">
|
||||
<digest>Recalls nth filled preset</digest>
|
||||
<description>Recalls the nth filled preset. Example: 'recall_filled 3' will recall the third available filled preset from the preset list, regardless of its slot number.
|
||||
</description>
|
||||
</method>
|
||||
<method name="resync">
|
||||
<digest>Resync the jsui to the pattrstorage</digest>
|
||||
<description>The word 'resync' will repopulate the jsui with the current preset list from the pattrstorage. It is usefull in case you add/remove/edit presets without using the jsui.
|
||||
@@ -113,7 +130,13 @@
|
||||
</attribute>
|
||||
<attribute name='color_mode' get='1' set='1' type='int' size='1' >
|
||||
<digest>Color mode</digest>
|
||||
<description>When set to 0, all preset slots have the same color (same as the preset object). When set to 1, stored preset slots are colored. See color_1 to color_6 as well as the color_wheel message.</description>
|
||||
<description>When set to 0, all preset slots have the same color (same as the preset object) defined by the stored_slot_color attribute.
|
||||
When set to 1, stored preset slots are colored according to one of the six colors of the color wheel, in a repeating pattern.
|
||||
In mode 2, stored preset colors can be freely set to one of the six colors of the color wheel.
|
||||
In mode 3, stored preset color can be set to any color in RGBA format.
|
||||
To define colors of the color wheel for modes 1 and 2, see color_1 to color_6 as well as the color_wheel message.
|
||||
To define preset color as in mode 2 or 3, see the setcolor message. Modes 2 and 3 require a pattr object named 'preset_color' to be at the same patcher level as the tc.preset object.
|
||||
</description>
|
||||
</attribute>
|
||||
<attribute name='color_1' get='1' set='1' type='list' size='4' >
|
||||
<digest>Slot color 1</digest>
|
||||
@@ -156,6 +179,10 @@
|
||||
<digest>Object margin</digest>
|
||||
<description>Defines the size, in pixels, of the margin between the jsui border and the preset slots.</description>
|
||||
</attribute>
|
||||
<attribute name='menu_mode' get='1' set='1' type='int' size='1' >
|
||||
<digest>Menu mode</digest>
|
||||
<description>Populates the umenu connected to 2nd outlet with preset number and name (0), preset number only (1), or name only (2). See recall_filled when using mode 2</description>
|
||||
</attribute>
|
||||
<attribute name='min_rows' get='1' set='1' type='int' size='1' >
|
||||
<digest>Minimum number of rows to display</digest>
|
||||
<description>Defines the minimum number of rows to display if scrollable is enabled and layout is set to 1.
|
||||
@@ -164,7 +191,7 @@
|
||||
</attribute>
|
||||
<attribute name='scrollable' get='1' set='1' type='int' size='1' >
|
||||
<digest>Scroll through your presets</digest>
|
||||
<description>When set to 1, you can through the jsui to see all your presets, or at least up to the slot number defined by the min_rows attributes. Currently only works with the list layout.
|
||||
<description>When set to 1, you can through the jsui to see all your presets, or at least up to the row defined by the min_rows attributes.
|
||||
</description>
|
||||
</attribute>
|
||||
<attribute name='select_mode' get='1' set='1' type='int' size='1' >
|
||||
|
File diff suppressed because it is too large
Load Diff
217
extras/tc.preset Launch.maxpat
Normal file
217
extras/tc.preset Launch.maxpat
Normal file
@@ -0,0 +1,217 @@
|
||||
{
|
||||
"patcher" : {
|
||||
"fileversion" : 1,
|
||||
"appversion" : {
|
||||
"major" : 8,
|
||||
"minor" : 6,
|
||||
"revision" : 4,
|
||||
"architecture" : "x64",
|
||||
"modernui" : 1
|
||||
}
|
||||
,
|
||||
"classnamespace" : "box",
|
||||
"rect" : [ 391.0, 289.0, 483.0, 443.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" : 0,
|
||||
"lefttoolbarpinned" : 2,
|
||||
"toptoolbarpinned" : 2,
|
||||
"righttoolbarpinned" : 2,
|
||||
"bottomtoolbarpinned" : 2,
|
||||
"toolbars_unpinned_last_save" : 15,
|
||||
"tallnewobj" : 0,
|
||||
"boxanimatetime" : 200,
|
||||
"enablehscroll" : 0,
|
||||
"enablevscroll" : 0,
|
||||
"devicewidth" : 0.0,
|
||||
"description" : "",
|
||||
"digest" : "",
|
||||
"tags" : "",
|
||||
"style" : "",
|
||||
"subpatcher_template" : "",
|
||||
"assistshowspatchername" : 0,
|
||||
"boxes" : [ {
|
||||
"box" : {
|
||||
"hidden" : 1,
|
||||
"id" : "obj-17",
|
||||
"linecount" : 5,
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 9.0, 354.0, 116.0, 76.0 ],
|
||||
"text" : ";\rmax launchbrowser https://glucose47.gumroad.com/l/tc_preset"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"id" : "obj-13",
|
||||
"linecount" : 3,
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 166.5, 373.0, 150.0, 47.0 ],
|
||||
"text" : "GPL 3.0\n© Théophile Clet, 2024\nClick here to support",
|
||||
"textcolor" : [ 0.0, 0.0, 0.0, 0.5 ],
|
||||
"textjustification" : 1
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"fontsize" : 16.0,
|
||||
"id" : "obj-11",
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 99.0, 81.0, 285.0, 24.0 ],
|
||||
"text" : "A jsui replacement for the preset object"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"embedstate" : [ [ "spacing", 4 ], [ "color_3", 0.527, 0.459, 0.756, 1 ], [ "text_bg_color", 1, 1, 1, 0.5 ], [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], [ "select_mode", 0 ], [ "scrollable", 0 ], [ "bubblesize", 14 ], [ "margin", 4 ], [ "fontsize", 14 ], [ "color_mode", 0 ], [ "color_5", 0.283, 0.606, 0.559, 1 ], [ "ignoreslotzero", 1 ], [ "min_rows", 10 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], [ "fontname", "Arial" ], [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], [ "color_6", 0.316, 0.616, 0.377, 1 ], [ "display_interp", 1 ], [ "bgcolor", 0.2, 0.2, 0.2, 1 ], [ "slot_round", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], [ "autowriteagain", 0 ], [ "layout", 1 ] ],
|
||||
"filename" : "tc.preset",
|
||||
"id" : "obj-8",
|
||||
"maxclass" : "jsui",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 4,
|
||||
"outlettype" : [ "", "", "", "" ],
|
||||
"parameter_enable" : 0,
|
||||
"patching_rect" : [ 254.0, 153.0, 130.0, 58.0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"hidden" : 1,
|
||||
"id" : "obj-7",
|
||||
"maxclass" : "newobj",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 9.0, 301.0, 51.0, 22.0 ],
|
||||
"text" : "pcontrol"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"hidden" : 1,
|
||||
"id" : "obj-6",
|
||||
"maxclass" : "message",
|
||||
"numinlets" : 2,
|
||||
"numoutlets" : 1,
|
||||
"outlettype" : [ "" ],
|
||||
"patching_rect" : [ 9.0, 274.0, 129.0, 22.0 ],
|
||||
"text" : "load tc.preset.maxhelp"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"fontsize" : 20.0,
|
||||
"id" : "obj-4",
|
||||
"maxclass" : "textbutton",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 3,
|
||||
"outlettype" : [ "", "", "int" ],
|
||||
"parameter_enable" : 0,
|
||||
"patching_rect" : [ 162.0, 282.0, 159.0, 41.0 ],
|
||||
"text" : "Open helper file"
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"embedstate" : [ [ "spacing", 4 ], [ "color_3", 0.527, 0.459, 0.756, 1 ], [ "text_bg_color", 1, 1, 1, 0.5 ], [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], [ "select_mode", 0 ], [ "scrollable", 0 ], [ "bubblesize", 14 ], [ "margin", 4 ], [ "fontsize", 14 ], [ "color_mode", 0 ], [ "color_5", 0.283, 0.606, 0.559, 1 ], [ "ignoreslotzero", 1 ], [ "min_rows", 10 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], [ "fontname", "Arial" ], [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], [ "color_6", 0.316, 0.616, 0.377, 1 ], [ "display_interp", 1 ], [ "bgcolor", 0.2, 0.2, 0.2, 1 ], [ "slot_round", 0 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], [ "autowriteagain", 0 ], [ "layout", 0 ] ],
|
||||
"filename" : "tc.preset",
|
||||
"id" : "obj-3",
|
||||
"maxclass" : "jsui",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 4,
|
||||
"outlettype" : [ "", "", "", "" ],
|
||||
"parameter_enable" : 0,
|
||||
"patching_rect" : [ 99.0, 153.0, 130.0, 58.0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"fontface" : 1,
|
||||
"fontsize" : 48.0,
|
||||
"id" : "obj-2",
|
||||
"maxclass" : "comment",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 0,
|
||||
"patching_rect" : [ 137.0, 16.0, 209.0, 60.0 ],
|
||||
"text" : "tc.preset",
|
||||
"textjustification" : 1
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"box" : {
|
||||
"bgcolor" : [ 0.2, 0.2, 0.2, 0.0 ],
|
||||
"fontsize" : 20.0,
|
||||
"id" : "obj-15",
|
||||
"maxclass" : "textbutton",
|
||||
"numinlets" : 1,
|
||||
"numoutlets" : 3,
|
||||
"outlettype" : [ "", "", "int" ],
|
||||
"parameter_enable" : 0,
|
||||
"patching_rect" : [ 166.5, 373.0, 150.0, 47.0 ],
|
||||
"text" : "Open helper file",
|
||||
"textoncolor" : [ 0.807843137254902, 0.898039215686275, 0.909803921568627, 0.0 ],
|
||||
"textovercolor" : [ 0.929411764705882, 0.929411764705882, 0.352941176470588, 0.0 ]
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"lines" : [ {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-17", 0 ],
|
||||
"hidden" : 1,
|
||||
"source" : [ "obj-15", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-6", 0 ],
|
||||
"hidden" : 1,
|
||||
"source" : [ "obj-4", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
, {
|
||||
"patchline" : {
|
||||
"destination" : [ "obj-7", 0 ],
|
||||
"hidden" : 1,
|
||||
"source" : [ "obj-6", 0 ]
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
"dependency_cache" : [ {
|
||||
"name" : "tc.preset.js",
|
||||
"bootpath" : "~/Documents/Max 8/Packages/tc.preset/code",
|
||||
"patcherrelativepath" : "../code",
|
||||
"type" : "TEXT",
|
||||
"implicit" : 1
|
||||
}
|
||||
],
|
||||
"autosave" : 0
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
||||
max objectfile tc.preset tc.preset;
|
||||
max definesubstitution tc.preset jsui @filename tc.preset
|
||||
max definesubstitution tc.preset jsui @filename tc.preset;
|
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@
|
||||
"authors" : [ ],
|
||||
"description" : "A jsui replacement for the preset object",
|
||||
"tags" : ["preset", "pattrstorage", "jsui"],
|
||||
"website" : "",
|
||||
"website" : "https://github.com/Teufeuleu/tc.preset/",
|
||||
"extends" : "",
|
||||
"extensible" : 0,
|
||||
"max_version_min" : "8.6.2",
|
||||
@@ -24,5 +24,5 @@
|
||||
|
||||
}
|
||||
,
|
||||
"homepatcher" : "tc.preset_demo.maxpat"
|
||||
"homepatcher" : "tc.preset Launch.maxpat"
|
||||
}
|
||||
|
643
snippets/tc.preset all-in-one-color.maxsnip
Normal file
643
snippets/tc.preset all-in-one-color.maxsnip
Normal file
File diff suppressed because one or more lines are too long
@@ -400,7 +400,7 @@
|
||||
"numinlets" : 1,
|
||||
"filename" : "tc.preset.js",
|
||||
"numoutlets" : 4,
|
||||
"embedstate" : [ [ "bgcolor", 0.2, 0.2, 0.2, 1 ], [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "text_bg_color", 1, 1, 1, 0.5 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], [ "color_3", 0.527, 0.459, 0.756, 1 ], [ "layout", 0 ], [ "spacing", 4 ], [ "autowriteagain", 0 ], [ "scrollable", 1 ], [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], [ "ignoreslotzero", 1 ], [ "slot_round", 0 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], [ "bubblesize", 14 ], [ "min_rows", 50 ], [ "display_interp", 1 ], [ "color_5", 0.283, 0.606, 0.559, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], [ "margin", 4 ], [ "select_mode", 0 ], [ "fontsize", 14 ], [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "color_mode", 0 ], [ "color_6", 0.316, 0.616, 0.377, 1 ] ]
|
||||
"embedstate" : [ [ "bgcolor", 0.2, 0.2, 0.2, 1 ], [ "active_slot_color", 0.808, 0.898, 0.91, 1 ], [ "fontname", "Arial" ], [ "pattrstorage", "mypat" ], [ "color_2", 0.679, 0.405, 0.669, 1 ], [ "text_bg_color", 1, 1, 1, 0.5 ], [ "interp_slot_color", 1, 1, 1, 0.8 ], [ "color_3", 0.527, 0.459, 0.756, 1 ], [ "layout", 0 ], [ "spacing", 4 ], [ "autowriteagain", 0 ], [ "scrollable", 0 ], [ "empty_slot_color", 0.349, 0.349, 0.349, 1 ], [ "color_4", 0.367, 0.542, 0.712, 1 ], [ "ignoreslotzero", 1 ], [ "slot_round", 0 ], [ "stored_slot_color", 0.502, 0.502, 0.502, 1 ], [ "bubblesize", 14 ], [ "min_rows", 10 ], [ "display_interp", 1 ], [ "color_5", 0.283, 0.606, 0.559, 1 ], [ "text_color", 0.129, 0.129, 0.129, 1 ], [ "margin", 4 ], [ "select_mode", 0 ], [ "fontsize", 14 ], [ "color_1", 0.743, 0.41, 0.501, 1 ], [ "color_mode", 0 ], [ "color_6", 0.316, 0.616, 0.377, 1 ] ]
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user