[L2Ork-dev] Patch private abstractions

Guillem Bartrina guillembartrina at gmail.com
Wed Jul 29 12:13:03 EDT 2020

Hi everyone,

in the last meeting I did a small presentation about the feature I'm 
going to implement next.

A quick reminder:


### Allow the user to store additional patch definitions within a pd 
file, which can be instantiated as abstractions ###

- creating new abstractions won't require accessing the filesystem

- patch portability is improved, due to the fact that the patch and all 
its abstraction dependencies can be packed into a single pd file

- it fosters the use of abstractions when they should be used. 
Currently, sub-patches are often used only because they are easier to 
create than abstractions, and this leads to code repetition.

Key aspects:

 > the .pd file structure: one main patch and multiple additional patches

 > scope for additional sub-patches: only instantiable by the main patch 
and its sub-patches. They might be instantiable by the additional 
sub-patches themselves too, to be determined.


Matt suggested implementing this feature in a similar way to how [array] 
or [text] works:

 > There is a template object that contains the abstraction definition. 
This object is not usable: it doesn't accept incoming messages, it 
doesn't have xlets, ... . It basically behaves like a comment, but it 
can be opened to edit the abstraction. For instance, it could be [ab 
define <name>].

 > If the corresponding [ab define <name>] abstraction definition exists 
within the scope (the definition is somewhere in the subpatch subtree), 
it can be instantiated by typing, for instance, [ab <name>] in an object.

 > If the abstraction definition is edited, all instances of that 
abstraction are updated, as is currently the case with ordinary 

I think this one above is an easy and clean way to do this for both 
users and developers.


I've already spent some time trying to figure out how some of the 
related parts of the codebase work, in order to get some inspiration. 
I've checked: [array], [text], [clone], [declare], templates, scalars, ...

I would like to know your point of view in order to build a clear and 
well-defined objective, which will allow me to progress in the most 
direct way.

More information about the L2Ork-dev mailing list