<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
I have a similar solution in Context, and I rely on it so much that I have created abstractions to take care of it See the files [share] and [shared]
<a href="https://github.com/LGoodacre/context-sequencer/tree/master/ctxfiles" title="https://github.com/LGoodacre/context-sequencer/tree/master/ctxfiles">
here</a>. These objects are not documented, but I would be willing to explain them if it would help.</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Pd-list <pd-list-bounces@lists.iem.at> on behalf of Roman Haefeli <reduzent@gmail.com><br>
<b>Sent:</b> 07 May 2018 08:08<br>
<b>To:</b> pd-list@lists.iem.at<br>
<b>Subject:</b> Re: [PD] static array/text</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Mon, 2018-05-07 at 00:02 +0200, Dan Wilcox wrote:<br>
> Is there one way to define a "static" table or text data that can be<br>
> shared among abstractions? I have a few abstractions which use lookup<br>
> tables and I realize now that they are basically creating a copy with<br>
> each instance when they could really share the same data directly. I<br>
> suppose this would be somewhat related to [value].<br>
<br>
Sounds like that this is such a common pattern that it would deserve a<br>
built-in solution. <br>
<br>
In netpd, abstractions/instruments can call/create a [unpatch-singleton <br>
<some_container>] whereas <some_container> is an arbitrary abstraction<br>
holding a look-up table or similar that should be only instantiated<br>
once. [unpatch-singleton] creates exactly one copy of <some_container><br>
and it creates it in a subpatch of  the unpatch instrument manager.<br>
This way <some_container> persists for the whole session even if the<br>
instrument that initially created it is closed.<br>
<br>
<a href="https://github.com/reduzent/netpd">https://github.com/reduzent/netpd</a><br>
<br>
Roman</div>
</span></font></div>
</body>
</html>