Skip to content

Commit

Permalink
Merge pull request #14 from tmhglnd/master
Browse files Browse the repository at this point in the history
A few updates
  • Loading branch information
natcl authored Oct 26, 2024
2 parents ba0285f + e9b37fd commit 391290b
Show file tree
Hide file tree
Showing 7 changed files with 882 additions and 200 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Max ToolBox : Patch faster in Max/MSP

The Max ToolBox is a tool that simplifies aspects of patching within the Max/MSP environment. The main feature is the ability to quickly connect objects using keyboard shortcuts. You can:
The Max ToolBox is a tool that simplifies aspects of patching within the Max/MSP environment. The main feature is the ability to quickly connect objects using keyboard shortcuts. The Toolbox is for Mac and Windows.

[Installation instructions below](#install-max-8)

Below a short overview of what you can do:

![](media/maxtoolbox-overview.gif)

Expand All @@ -26,6 +30,7 @@ The Max ToolBox is a tool that simplifies aspects of patching within the Max/MSP
| distribute objects diagonally with even spacing | hold `x` & `y` | |
| custom connections via shell-style interface | `±` (`shift` - `§`) | |
| send bang to selected objects | `B` (`shift` - `b`) | |
| clear the console | `K` (`shift-k`) | |
| send messages to objects via the shell | `±` (`shift` - `§`) | |
| set ascending scriptingnames for objects | | `@name myParam$` |
| customize shortkeys | | |
Expand All @@ -36,19 +41,23 @@ The Max ToolBox is a tool that simplifies aspects of patching within the Max/MSP

## Install (Max 8)

Install by downloading:

Download the latest version of the package for [Max 8](https://github.com/tmhglnd/maxtoolbox/archive/refs/heads/master.zip)

```
1. download latest code zip
2. unzip and place in Max Packages (on MacOS ~/Documents/Max 8/Packages)
2. unzip and place in Max Packages (eg. MacOS ~/Documents/Max 8/Packages)
3. restart Max8, open ToolBox from Menubar/Extras
4. click Activate
```

Or install via git clone:

```
1. open terminal
2. $ cd ~/Documents/Max\ 8/Packages
3. $ git clone https://github.com/natcl/maxtoolbox.git
3. $ git clone https://github.com/tmhglnd/maxtoolbox.git
4. restart Max8, open ToolBox from Menubar/Extras
4. click Activate
```
Expand All @@ -60,9 +69,9 @@ Download the latest version of the package for [Max 8](https://github.com/tmhgln

### For Max 7 and older

⚠️ **This version is temporarily not supported for Max 7 or older** ⚠️
⚠️ **This version does not support Max 7 or older** ⚠️

- [**Please download this older commit**](https://github.com/tmhglnd/maxtoolbox/tree/8852b5a87e939a72f0dd8647bfffe05ed96106ba)
- [**Please download the older commit**](https://github.com/tmhglnd/maxtoolbox/tree/8852b5a87e939a72f0dd8647bfffe05ed96106ba)

<!-- - [Max 5 and 6](https://github.com/natcl/maxtoolbox/archive/Version15.zip)
- [Max 4](https://maxtoolbox.googlecode.com/files/maxtoolbox_b8_max4.zip)
Expand Down
7 changes: 7 additions & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,10 @@ For the connect cascade (`shift-c`) function, you can specify a number of connec
| Shell command | `@name` |
| Arguments | `-v` (when naming a column) |
| Description | This will name a row or column of objects. To use, select the row or column open the shell, type `@name name1 name2 ... name7` for amount of selected objects. When naming a column use the following syntax: `@name –v name1 name2 ...`. You can name objects ascending with a name that includes a `$`. For example: `@name myParam$` will result in `myParam0 myParam1 ... etc` |

| | Clear console |
| - | - |
| Shortkey key | `K` (`shift-k`) |
| Shell command | `none` |
| Arguments | `none` |
| Description | Clear all the prints in the console (max-window) |
33 changes: 20 additions & 13 deletions extras/ToolBox.maxpat
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 2,
"revision" : 2,
"minor" : 6,
"revision" : 3,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -45,21 +45,21 @@
"maxclass" : "newobj",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "C74" ],
"patching_rect" : [ 449.0, 88.0, 36.0, 21.0 ],
"text" : "t C74"
"outlettype" : [ "C74:" ],
"patching_rect" : [ 449.0, 88.0, 39.0, 21.0 ],
"text" : "t C74:"
}

}
, {
"box" : {
"id" : "obj-54",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 449.0, 58.0, 61.0, 21.0 ],
"text" : "route start"
"numinlets" : 3,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 449.0, 58.0, 105.0, 21.0 ],
"text" : "route loadend start"
}

}
Expand Down Expand Up @@ -369,7 +369,7 @@
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [ 49.0, 275.0, 70.0, 22.0 ],
"save" : [ "#N", "thispatcher", ";", "#Q", "window", "flags", "nogrow", "close", "nozoom", "nofloat", "menu", "minimize", ";", "#Q", "window", "constrain", 50, 50, 32768, 32768, ";", "#Q", "window", "size", 576, 70, 744, 220, ";", "#Q", "window", "title", ";", "#Q", "window", "exec", ";", "#Q", "savewindow", 1, ";", "#Q", "end", ";" ],
"save" : [ "#N", "thispatcher", ";", "#Q", "window", "flags", "nogrow", "close", "nozoom", "float", "menu", "minimize", ";", "#Q", "window", "constrain", 50, 50, 32768, 32768, ";", "#Q", "window", "size", 576, 70, 744, 220, ";", "#Q", "window", "title", ";", "#Q", "window", "exec", ";", "#Q", "savewindow", 1, ";", "#Q", "end", ";" ],
"text" : "thispatcher"
}

Expand All @@ -387,8 +387,8 @@
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 2,
"revision" : 2,
"minor" : 6,
"revision" : 3,
"architecture" : "x64",
"modernui" : 1
}
Expand Down Expand Up @@ -2204,6 +2204,13 @@
"source" : [ "obj-53", 0 ]
}

}
, {
"patchline" : {
"destination" : [ "obj-55", 0 ],
"source" : [ "obj-54", 1 ]
}

}
, {
"patchline" : {
Expand Down
26 changes: 19 additions & 7 deletions javascript/maxtoolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ autowatch = 1;
if (max.version < "502")
post("ToolBox: Your version of Max/MSP needs to be at least 5.0.2, please update it.\n");
else
post("ToolBox v.16 - by Nathanaël Lécaudé - updated by Timo Hoogland\n");
post("ToolBox v.18 - by Nathanaël Lécaudé - updated by Timo Hoogland\n");

// Constantes
var X1 = 0;
Expand Down Expand Up @@ -246,10 +246,16 @@ function alignhorz(mouseX)
objarray.sort(alignsortx);

var newpos = [];
// width of total objects is mouseX - 1st object - window posX
var width = Math.max(0, mouseX - objarray[0].obj.rect[X1] - max.frontpatcher.wind.location[X1]);

if (mouseX === 'no_mouse'){
// if no mouse movement then immediately reorder the objects
var width = Math.max(0, objarray[objarray.length-1].obj.rect[X1] - objarray[0].obj.rect[X1]);
} else {
// width of total objects is mouseX - (1st object + window posX + toolbar width)
var width = Math.max(0, mouseX - (objarray[0].obj.rect[X1] + max.frontpatcher.wind.location[X1] + 36));
}
// distance between object is width divided by total objects
var deltax = width / objarray.length;
var deltax = width / (objarray.length-1);

if (patching_mode){
// adjust if in patching mode
Expand Down Expand Up @@ -294,10 +300,16 @@ function alignvert(mouseY)
objarray.sort(alignsorty);

var newpos = [];
// width of total objects is mouseX - 1st object - window posY
var height = Math.max(0, mouseY - objarray[0].obj.rect[Y1] - max.frontpatcher.wind.location[Y1]);

if (mouseY === 'no_mouse'){
// if no mouse movement then immediately reorder the objects
var height = Math.max(0, objarray[objarray.length-1].obj.rect[Y1] - objarray[0].obj.rect[Y1]);
} else {
// width of total objects is mouseX - (1st object + window posY+ toolbar width)
var height = Math.max(0, mouseY - (objarray[0].obj.rect[Y1] + max.frontpatcher.wind.location[Y1] + 36));
}
// distance between object is height divided by total objects
var deltay = height / (objarray.length);
var deltay = height / (objarray.length-1);

if (patching_mode){
// adjust if in patching mode
Expand Down
4 changes: 2 additions & 2 deletions javascript/toolbox_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const handlers = {
initpath = path.join(p, '/max-startup/');
},
'create_file' : () => {
max.post('ToolBox activates at startup');
max.post('ToolBox launches at startup');

let f = path.join(process.cwd(), '../misc/toolbox_start.txt');
let t = fs.readFileSync(f, 'utf-8');
Expand All @@ -25,7 +25,7 @@ const handlers = {
fs.writeFileSync(toolbox, t);
},
'clear_file' : () => {
max.post('ToolBox not active at startup');
max.post('ToolBox deactivated');

// remove the toolbox start from max-startup
if (fs.existsSync(toolbox)){
Expand Down
2 changes: 1 addition & 1 deletion misc/mtb_shortcuts.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
info, You can customize shortcuts here changing the letters;q, sm "connect single to multiple";a, ms "connect multiple to single";C, cc "connect cascade";w, sr "connect single to row";s, rs "connect row to single";e, rr "connect row to row";d, io "connect all inlets to all outlets";±, ss "show ToolBox shell";x, hd "horizontal distributon";y, vd "vetical distribution";I, ii "define inlet";O, oo "define outlet";N, nn "define number of connections";|, nw "new object with connection";S, no "select next object";W, po "select previous object";u, undo "undo connections";
info, You can customize shortcuts here changing the letters;q, sm "connect single to multiple";a, ms "connect multiple to single";C, cc "connect cascade";w, sr "connect single to row";s, rs "connect row to single";e, rr "connect row to row";d, io "connect all inlets to all outlets";±, ss "show ToolBox shell";x, hd "horizontal distributon";y, vd "vetical distribution";I, ii "define inlet";O, oo "define outlet";N, nn "define number of connections";|, nw "new object with connection";S, no "select next object";W, po "select previous object";u, undo "undo connections";B, bn "send bang to selected objects";K, ec "empty the console";Å, dsp "turn on/off dsp";¯, as "open audio status";
Expand Down
Loading

0 comments on commit 391290b

Please sign in to comment.