Max/MSP Tutorials
Patches within patches
- Create a new patch;
- Save it as a text file - something like 'MyPatch.txt' in a new directory.
- Within the patch create a new object box and type in it 'p MySubPatch'.
- A new patcher will open: within this new patcher create two inlets and an outlet - you should see the new inlets and outlets appear on the original object in the original patch if you have a look.
- In the new patcher create a new object box and type in it '+ 2'. Create a connection between the left inlet and the left inlet of your new object. Create a connection between the outlet of your new object and the outlet of your patch: this will mean that whatever is put through the left inlet will have 2 added to it, and the result will be available from the outlet. Useful!
- Create a connection between the right inlet of your subpatch and the right inlet of the '+ 2' object: this means you'll have control of what number is added via this inlet.
- Close the patch called 'MySubPatch'.
- In the original patch 'MyPatch', connect number boxes to each of the inlets and the outlet of the subpatch object.
- Test it!
You can also create subpatches by creating a new patch in the same directory as the original, saving it, creating a new object box in the original and then naming it with precisely the same name as your new patch.