One of the main problems, when starting building lots of processes in a Max patcher, is that you quickly run out of space. Another problem is that some of the code is quite repetitive, and it would be much easier to have something modular to copy and paste rather than keep rebuilding synthesis modules all over the places. Encapsulating is a technique simple but very useful to help you arrange more efficiently the space on your patcher.
Encapsulation is a technique simple but very useful to help you arrange more efficiently the space on your patcher.
As you can see from the last synth image here, several points could be potentially used for interaction and musical expansion, but other parts and components of your coding, don’t need to be seen at all, if not for remembering what it is. They do occupy much space and it would be nice to hide them away, although keeping them perfectly accessible and functional. That is why the Max people have invented the encapsulation.
To encapsulate something means to select some objects and put them away in a higher level object, keeping all their connections already in place. Look at this video to see it in action.
Once you selected some objects press CMD+Shift+E and you will encapsulate. The objects disappear within an apparently new blank object, but their connections with the patcher remain. This newly created object, that contains your encapsulated code is called the subpatch. You can also do the inverse operation by de-encapsulating to have your objects back where they were (with some reshuffling). After that you can name the subpatch.
The encapsulation process also speeds up the duplication of code in your patch, and it is quite fast to customise each of the clones to have different sonic results.