<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Saving data with patch</title>
		<atom:link href="http://cycling74.com/forums/topic/saving-data-with-patch/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/saving-data-with-patch/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 13:24:26 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-50535</guid>
					<title><![CDATA[Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-50535</link>
					<pubDate>Mon, 24 May 2010 14:49:08 +0000</pubDate>
					<dc:creator>danieleghisi</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;d like to save some datas of an ui external (essentially a dynamic array of longs) with the patcher, so that they are automatically restored on reload.<br />
It should be the same thing as preserving values on copy/paste, so I&#8217;ve seen the thread <a href="http://cycling74.com/forums/topic.php?id=26378" rel="nofollow">http://cycling74.com/forums/topic.php?id=26378</a> where emmanuel suggested to add a  method</p>
<p>void yourobject_jsave(t_yourobject *x, t_dictionary *d){<br />
dictionary_appendlong(d, gensym(&#8220;hey&#8221;), 74);<br />
}</p>
<p>I did it: the method is correctly called, but still the message &#8220;hey&#8221; with argument 74 is never executed, neither on pasting, nor on reloading. (obviously i&#8217;ve also created a &#8220;hey&#8221; method, A_LONG &#8211; but it is never evaluated).</p>
<p>Shouldn&#8217;t the &#8220;hey 74&#8243; be parsed automatically at the object initialization with attr_dictionary_process(x, d)? Am I wrong in some part of the process? </p>
<p>Thanks a lot,<br />
Daniele Ghisi</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181287</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181287</link>
					<pubDate>Mon, 19 Jul 2010 05:28:14 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello maxers,</p>
<p>I want to save an array of double <em>with the patch</em>, as CLASS_ATTR_SAVE does ; </p>
<p>but as i don&#8217;t know how many values : i want to use a dynamic array to collect them ; (weights of a neural network so i don&#8217;t want / need user interaction) &#8230;.</p>
<p>so :</p>
<p>- have you any clue/strategy/idea for saving that kind of stuff ? (my external is not UI).</p>
<p>- in case of using CLASS_ATTR_DOUBLE_ARRAY ; is it safe to deal with big size array (thousands of values) ?</p>
<p>Thanks.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181288</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181288</link>
					<pubDate>Fri, 23 Jul 2010 12:25:48 +0000</pubDate>
					<dc:creator>Timothy Place</dc:creator>

					<description>
						<![CDATA[
						<p>Hi,</p>
<p>Is your object a UI object?</p>
<p>Cheers</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181289</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181289</link>
					<pubDate>Fri, 23 Jul 2010 14:22:03 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Timothy,</p>
<p>NO, that&#8217;s not an UI. </p>
<p>i&#8217;m doing an absurd/nut external who scan the patch and create a <em>&#8220;neural network&#8221;</em> with jbox and jpatcherline ; and my problem was to save synapse weights with the patcher.</p>
<p>Finally i start to do it using two CLASS_ATTR_DOUBLE_ARRAY in a very very complex approach ;-) I set the size of these arrays : 2048 ; hope that&#8217;s not too much. </p>
<p>Another idea (should be great, because what i&#8217;m currently doing is crazy) ?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181290</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181290</link>
					<pubDate>Fri, 23 Jul 2010 16:27:04 +0000</pubDate>
					<dc:creator>Timothy Place</dc:creator>

					<description>
						<![CDATA[
						<p>The jsave method only works for ui objects, so that&#8217;s why it did not work for you.  </p>
<p>For non-ui objects you should instead use the appendtodictionary method.  In your class definition:</p>
<pre>class_addmethod(c, (method)myobj_appendtodictionary,	"appendtodictionary", A_CANT, 0);</pre><p>Then you can implement the method like this:</p>
<pre>void myobj_appendtodictionary(t_myobj *x, t_dictionary *bd)
{
	// bd is a dictionary for our object that is going to be stored in the patcher
	// we can append data to the dictionary using the usual dictionary methods

	t_atom a[2];

	atom_setlong(a+0, 1234);
	atom_setsym(a+1, gensym("foo"));

	dictionary_appendatoms(bd, gensym("my_data"), 2, a);
}</pre><p>To restore the data when the patcher is opened (and your object is created, you can get the dictionary for your object in the new method using the #D symbol like this:</p>
<pre>t_dictionary *d = (t_dictionary *)gensym("#D")->s_thing;
	if (d)
		// do something with the dictionary, like get the atoms associated with the "my_data" key</pre><p>HTH,<br />
  Tim</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181291</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181291</link>
					<pubDate>Sat, 24 Jul 2010 10:58:22 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello Timothy,</p>
<p>Thank you ; much more easy to code my external now.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181292</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181292</link>
					<pubDate>Thu, 26 Aug 2010 08:39:20 +0000</pubDate>
					<dc:creator>pizza olives</dc:creator>

					<description>
						<![CDATA[
						<p>Hello maxers,</p>
<p>i implement a <em>SaveDataWithPatcher</em> stuff with Tim&#8217;s <em>appendtodictionnary</em> tips ; but i suspect this to crash sometimes my [papa] external (once for now freeing the patcher, but &#8230;) ; is it possible than a thread conflict between <code>myobj_free</code> function and <code>myobj_appendtodictionnary</code> function occurs as both are referring to the same data structure ? or are they called strictly one before the other ?</p>
<p>thanks for help.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181293</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181293</link>
					<pubDate>Thu, 06 Jan 2011 18:42:00 +0000</pubDate>
					<dc:creator>Wes Jackson</dc:creator>

					<description>
						<![CDATA[
						<p>Hey, hopefully this isn&#8217;t too old but what if I want something like appendtodictionary above, but the name of the dictionary is specified by an argument to the object like a buffer? Therefore if I have multiple instantiations of the object, they each can use their own database&#8230;</p>
<p>Thanks!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181294</guid>
					<title><![CDATA[Re: Saving data with patch]]></title>
					<link>http://cycling74.com/forums/topic/saving-data-with-patch/#post-181294</link>
					<pubDate>Fri, 07 Jan 2011 15:18:11 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello gerladhammings,</p>
<p>i was not sure so i did a quick test (mac only, sources with) ; keys you add to the t_dictionary is local for each instantiation of your object so each object can use/save is own database ; Somebody to correct me ?</p>
<blockquote><p>
but the name of the dictionary is specified by an argument to the object like a buffer ?</p>
</blockquote>
<p>i don&#8217;t really understand what you mean with &#8220;the name of the dictionary&#8221; ;</p>
<p><code>t_dictionary *d = (t_dictionary *)gensym("#D")->s_thing ;</code> &#8230;</p>
<p>HTH</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

