<?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: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O</title>
		<atom:link href="http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 03:57:21 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-24878</guid>
					<title><![CDATA[Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-24878</link>
					<pubDate>Tue, 14 Mar 2006 14:11:07 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,</p>
<p>I have an object with 5 inlets. In new, I&#8217;m doing:<br />
   floatin(x,4);<br />
   intin(x,3);<br />
   intin(x,2);<br />
   intin(x,1);</p>
<p>in main, I&#8217;m doing:<br />
   addint((method)testobj_int);<br />
   addinx((method)testobj_in1, 1);<br />
   addinx((method)testobj_in2, 2);<br />
   addinx((method)testobj_in3, 3);<br />
   addftx((method)testobj_ft4, 4);</p>
<p>This object just post out the value received from the inlet.<br />
It&#8217;s working perfectly on Mac. On Windows, the float inlet is receiving <br />
random big big values.</p>
<p>I don&#8217;t know what&#8217;s wrong?<br />
- my code<br />
- my VCPROJ options<br />
- my maxmsp sdk install<br />
- anything else<br />
(problem is not in %f, because before being empty, my object was sending <br />
values to an outlet, and the value sent was also wrong).</p>
<p>Attached, mxo for OSX, mxe for XP, source and win project.</p>
<p>Best regards and thanks for your help,<br />
Chris</p>
<p>NB: (maxmsp 457)</p>
<p>Results of the patch on windows:<br />
sending an int gives:<br />
ft4=0.000000<br />
in3=11<br />
in2=11<br />
in1=11<br />
sending a float gives :<br />
ft4=-36893488147419103000.000000<br />
in3=0<br />
in2=0<br />
in1=0</p>
<p>The patch is:<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P flonum 261 51 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P number 175 48 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window linecount 1;<br />
#P newex 192 117 66 9109513 testobj;<br />
#P connect 1 0 0 0;<br />
#P connect 1 0 0 1;<br />
#P connect 1 0 0 2;<br />
#P connect 1 0 0 3;<br />
#P connect 1 0 0 4;<br />
#P connect 2 0 0 0;<br />
#P connect 2 0 0 1;<br />
#P connect 2 0 0 2;<br />
#P connect 2 0 0 3;<br />
#P connect 2 0 0 4;<br />
#P window clipboard copycount 3;</p>
<p>#include &#8220;ext.h&#8221;  				</p>
<p>typedef struct testobj				<br />
{<br />
	Object x_ob;				<br />
} t_testobj;</p>
<p>void *testobj_class;				</p>
<p>void testobj_int(t_testobj *x, long n);<br />
void testobj_in1(t_testobj *x, long n);<br />
void testobj_in2(t_testobj *x, long n);<br />
void testobj_in3(t_testobj *x, long n);</p>
<p>void testobj_ft4(t_testobj *x, float g);</p>
<p>void *testobj_new(Symbol *s);</p>
<p>void main(void)<br />
{<br />
	setup((t_messlist **)&#038;testobj_class, (method)testobj_new, 0L, <br />
(short)sizeof(t_testobj), 0L, 0);</p>
<p>	addint((method)testobj_int);<br />
	addinx((method)testobj_in1, 1);<br />
	addinx((method)testobj_in2, 2);<br />
	addinx((method)testobj_in3, 3);</p>
<p>	addftx((method)testobj_ft4, 4);<br />
}</p>
<p>void testobj_int(t_testobj *x, long n) { post(&#8220;int=%d&#8221;,n); }<br />
void testobj_in1(t_testobj *x, long n) { post(&#8220;in1=%d&#8221;,n); }<br />
void testobj_in2(t_testobj *x, long n) { post(&#8220;in2=%d&#8221;,n); }<br />
void testobj_in3(t_testobj *x, long n) { post(&#8220;in3=%d&#8221;,n); }<br />
void testobj_ft4(t_testobj *x, float g) { post(&#8220;ft4=%f&#8221;,g); }</p>
<p>void *testobj_new(Symbol *s)<br />
{<br />
	t_testobj *x = (t_testobj *)newobject(testobj_class);</p>
<p>	floatin(x,4);	<br />
	intin(x,3);	<br />
	intin(x,2);					<br />
	intin(x,1);					</p>
<p>	return(x);<br />
}</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72544</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72544</link>
					<pubDate>Tue, 14 Mar 2006 14:15:22 +0000</pubDate>
					<dc:creator>Jeremy Bernstein</dc:creator>

					<description>
						<![CDATA[
						<p>On Windows, arguments using float values must be doubles.</p>
<p>jb</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72545</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72545</link>
					<pubDate>Tue, 14 Mar 2006 14:17:26 +0000</pubDate>
					<dc:creator>gr@grrrr.org</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Chris,<br />
as far as i know (although being biased by PureData), float handlers <br />
take double arguments, like in<br />
void testobj_ft4(t_testobj *x, double g);</p>
<p>greetings,<br />
Thomas</p>
<p>&#8211; <br />
Thomas Grill</p>
<p><a href="http://grrrr.org" rel="nofollow">http://grrrr.org</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72546</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72546</link>
					<pubDate>Tue, 14 Mar 2006 14:25:13 +0000</pubDate>
					<dc:creator>Thijs Koerselman</dc:creator>

					<description>
						<![CDATA[
						<p>not sure, but I remember functions which interface with max need to use<br />
double instead of float. Try this:</p>
<p>void testobj_ft4(t_testobj *x, double g);<br />
void testobj_ft4(t_testobj *x, double g) { post(&#8220;ft4=%f&#8221;,g); }</p>
<p>hth, t_</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72547</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72547</link>
					<pubDate>Tue, 14 Mar 2006 14:27:25 +0000</pubDate>
					<dc:creator>Thijs Koerselman</dc:creator>

					<description>
						<![CDATA[
						<p>I need to type faster, 3rd place damn it ;-)</p>
<p>t_</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72548</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72548</link>
					<pubDate>Tue, 14 Mar 2006 14:29:21 +0000</pubDate>
					<dc:creator>gr@grrrr.org</dc:creator>

					<description>
						<![CDATA[
						<p>
Thijs Koerselman schrieb:<br />
> not sure, but I remember functions which interface with max need to <br />
> use double instead of float. Try this:<br />
>  <br />
> void testobj_ft4(t_testobj *x, double g);<br />
> void testobj_ft4(t_testobj *x, double g) { post(&#8220;ft4=%f&#8221;,g); }<br />
it&#8217;s<br />
void testobj_ft4(t_testobj *x, double g) { post(&#8220;ft4=%lf&#8221;,g); }</p>
<p>greetings,<br />
Thomas</p>
<p>&#8211; <br />
Thomas Grill</p>
<p><a href="http://grrrr.org" rel="nofollow">http://grrrr.org</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72549</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72549</link>
					<pubDate>Tue, 14 Mar 2006 14:36:02 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72550</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72550</link>
					<pubDate>Tue, 14 Mar 2006 14:42:52 +0000</pubDate>
					<dc:creator>Jeremy Bernstein</dc:creator>

					<description>
						<![CDATA[
						<p>Yes, go ahead and use double for both.</p>
<p>jb</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72551</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72551</link>
					<pubDate>Tue, 14 Mar 2006 14:49:28 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>On 14-Mar-2006, at 15:27, Thijs Koerselman wrote:</p>
<p>> I need to type faster, 3rd place damn it ;-)</p>
<p>And I need to read faster, I don&#8217;t even rate an honorable mention  <br />
this time %-}</p>
<p>The float/double thing is up there in the top 3 max-dev FAQs. And it  <br />
is, admittedly, a little weird that all Mac compilers nowadays  <br />
default to double-precision when they see float in a function  <br />
prototype while Windows compilers (universally?) insist on single- <br />
precision.</p>
<p>Given that there&#8217;s no list FAQ, it would be, imho, a Good Idea(tm) if  <br />
the SDK uniformly used explicit double in all sample code. I can  <br />
understand if this is not the absolute highest priority at C74.</p>
<p>My highest priorities are cool new stuff for Litter Power and iCE, so  <br />
I&#8217;ll get back to work (and miss the next opportunity to be a hero for  <br />
a minute).</p>
<p>&#8211; P.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;    <a href="http://www.bek.no/~pcastine/Litter/" rel="nofollow">http://www.bek.no/~pcastine/Litter/</a>    &#8212;&#8212;&#8212;&#8212;-<br />
Peter Castine    |        +&#8211;> Litter Power &#038; Litter Bundle for Jitter<br />
                  |&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
<a href="mailto:p@castine.de">p@castine.de</a>     | iCE:  Sequencing, Recording, and Interface Building<br />
<a href="mailto:pcastine@gmx.net">pcastine@gmx.net</a> |       for Max/MSP<br />
<a href="mailto:pcastine@bek.no">pcastine@bek.no</a>  | <a href="http://www.dspaudio.com/" rel="nofollow">http://www.dspaudio.com/</a>             Extremely cool<br />
<a href="mailto:4-15@kagi.com">4-15@kagi.com</a>    |&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
                  | home|chez nous|wir|i nostri  <a href="http://www.castine.de/" rel="nofollow">http://www.castine.de/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72552</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72552</link>
					<pubDate>Tue, 14 Mar 2006 15:02:37 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p>
> The float/double thing is up there in the top 3 max-dev FAQs. And it is, <br />
> admittedly, a little weird that all Mac compilers nowadays default to <br />
> double-precision when they see float in a function prototype while </p>
<p>I don&#8217;t understand&#8230;<br />
calling this code in my objects<br />
void myfunc(float f);<br />
void test()<br />
{<br />
           post(&#8220;sizeof(float)=%d <br />
sizeof(double)=%dn&#8221;,sizeof(float),sizeof(double));<br />
                   myfunc(1.0f);<br />
}<br />
void myfunc(float f)<br />
{<br />
           post(&#8220;sizeof(f)=%dn&#8221;,sizeof(f));<br />
}</p>
<p>
gives as result:</p>
<p>sizeof(float)=4 sizeof(double)=8<br />
sizeof(f)=4</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72553</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72553</link>
					<pubDate>Tue, 14 Mar 2006 18:27:24 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8221;m not quite sure what your code is telling us and I am not  <br />
convinced it is telling us what you think it&#8217;s telling us (or what I  <br />
think you think it thinks it&#8217;s telling us). Looking at the  <br />
disassembled code may be instructive and not a little surprising (see  <br />
below).</p>
<p>In any case, Max passes de-atomized floats as 64-bit IEEE-754 double- <br />
precision values to your functions. That&#8217;s the Max API, like it or  <br />
love it.</p>
<p>On Windows you *must* declare floating-point parameters as doubles in  <br />
function prototypes &#038; definitions, otherwise your code is tanked.</p>
<p>On Mac OS you *may* declare floating-point parameters as doubles.  <br />
(Incidentally, in the early days of Mac OS PPC Max development it was  <br />
also mandatory to declare those parameters as doubles.)</p>
<p>For cross-platform compatibility, the simplest, most straight-forward  <br />
solution is to always use double in your callbacks.</p>
<p>
On 14-Mar-2006, at 16:02, Chris wrote:</p>
<p>> I don&#8217;t understand&#8230;<br />
> calling this code in my objects<br />
> void myfunc(float f);<br />
> void test()<br />
> {<br />
>           post(&#8220;sizeof(float)=%d sizeof(double)=%dn&#8221;,sizeof <br />
> (float),sizeof(double));<br />
>                   myfunc(1.0f);</p>
<p>The call to myfunc(), on CW (w/PPC Carbon Target), generates a lwz  <br />
instruction to pass 1.0f. Which means your carefully specified single- <br />
precision is loaded into a 64-bit register, complete with conversion  <br />
to double-precision. Go figure.</p>
<p>> }<br />
> void myfunc(float f)<br />
> {<br />
>           post(&#8220;sizeof(f)=%dn&#8221;,sizeof(f));</p>
<p>While we&#8217;re here and being anal-retentive, you would be universally  <br />
safer to use a %ld or %lu specifier in your format string, since  <br />
sizeof() returns an unsigned long, which is not necessarily the same  <br />
size as an int. Granted, nowadays int is pretty much always 32-bit,  <br />
but that&#8217;s not what the ANSI C spec says.</p>
<p>> }<br />
><br />
><br />
> gives as result:<br />
><br />
> sizeof(float)=4 sizeof(double)=8<br />
> sizeof(f)=4</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;    <a href="http://www.bek.no/~pcastine/Litter/" rel="nofollow">http://www.bek.no/~pcastine/Litter/</a>    &#8212;&#8212;&#8212;&#8212;-<br />
Peter Castine    |        +&#8211;> Litter Power &#038; Litter Bundle for Jitter<br />
                  |&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
<a href="mailto:p@castine.de">p@castine.de</a>     | iCE:  Sequencing, Recording, and Interface Building<br />
<a href="mailto:pcastine@gmx.net">pcastine@gmx.net</a> |       for Max/MSP<br />
<a href="mailto:pcastine@bek.no">pcastine@bek.no</a>  | <a href="http://www.dspaudio.com/" rel="nofollow">http://www.dspaudio.com/</a>             Extremely cool<br />
<a href="mailto:4-15@kagi.com">4-15@kagi.com</a>    |&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<br />
                  | home|chez nous|wir|i nostri  <a href="http://www.castine.de/" rel="nofollow">http://www.castine.de/</a></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72554</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72554</link>
					<pubDate>Tue, 14 Mar 2006 18:49:04 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p>
> I&#8221;m not quite sure what your code is telling us and I am not convinced <br />
> it is telling us what you think it&#8217;s telling us (or what I think you <br />
> think it thinks it&#8217;s telling us). Looking at the disassembled code may <br />
> be instructive and not a little surprising (see below).<br />
the code was just to show that I didn&#8217;t understand where 32b float was <br />
transformed as 64b double.</p>
<p>> In any case, Max passes de-atomized floats as 64-bit IEEE-754 <br />
> double-precision values to your functions. That&#8217;s the Max API, like it <br />
> or love it.<br />
OK&#8230;</p>
<p>> On Windows you *must* declare floating-point parameters as doubles in </p>
<p>> On Mac OS you *may* declare floating-point parameters as doubles. </p>
<p>> For cross-platform compatibility, the simplest, most straight-forward <br />
> solution is to always use double in your callbacks.</p>
<p>I just changed all my max object callbacks using float to double. That&#8217;s <br />
a good advide.<br />
The SDK doc should be changed to remove all float from examples.</p>
<p>Best regards,<br />
Chris</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72555</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72555</link>
					<pubDate>Thu, 16 Mar 2006 17:44:38 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p>Hi,</p>
<p>I just remarked than outlet(x,double x)<br />
doesn&#8217;t exists on windows (nor on mac), we have to use outlet(x,float x)</p>
<p>this is not very logical. We are obliged to use double when the real <br />
number comes from an inlet, but for outlet, we have to use float&#8230;</p>
<p>Regards<br />
Chris</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72556</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72556</link>
					<pubDate>Thu, 16 Mar 2006 19:55:08 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Mar 16, 2006, at 9:44 AM, Chris wrote:</p>
<p>> I just remarked than outlet(x,double x)<br />
> doesn&#8217;t exists on windows (nor on mac), we have to use outlet <br />
> (x,float x)<br />
><br />
> this is not very logical. We are obliged to use double when the  <br />
> real number comes from an inlet, but for outlet, we have to use  <br />
> float&#8230;</p>
<p>Basically these are two different things. One is has to do with a  <br />
function pointer (not known at compile time as far as Max is  <br />
concerned) which is dynamically bound and the stack is built up  <br />
manually by Max at runtime based on some assumptions (in this case  <br />
that a floating point number is a double). The other is a clearly  <br />
prototyped API function which the compiler can handle as defined.  <br />
There&#8217;s nothing precluding the introduction of an outlet_double() in  <br />
the future, nor is this logically inconsistent. The heritage for  <br />
passing doubles on the stack for our dynamically bound function  <br />
pointers comes from the PPC architecture passing both floats and  <br />
doubles on the stack as double precision values. We decided to keep  <br />
this convention on Intel.</p>
<p>Note that in Max floats are currently always passed between objects  <br />
at 32bit resolution. This might be increased in a future version (for  <br />
which our use of doubles on the stack will prove useful). However,  <br />
for now it is a limitation.</p>
<p>Hope this sheds a bit of light on what&#8217;s going on. If you really want  <br />
to avoid this float/double confusion, simply define all your  <br />
functions with A_GIMME and manage the atoms which are passed between  <br />
objects in your object. The other method signatures and outlet calls  <br />
are really there only for convenience.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72557</guid>
					<title><![CDATA[Re: Big trouble with a max object I made: addftx not working properly on Windows, working perfectly on O]]></title>
					<link>http://cycling74.com/forums/topic/big-trouble-with-a-max-object-i-made-addftx-not-working-properly-on-windows-working-perfectly-on-o/#post-72557</link>
					<pubDate>Thu, 16 Mar 2006 21:03:20 +0000</pubDate>
					<dc:creator>kawkhins</dc:creator>

					<description>
						<![CDATA[
						<p>> Basically these are two different things. One is has to do with a <br />
> function pointer (not known at compile time as far as Max is concerned) <br />
> which is dynamically bound and the stack is built up manually by Max at <br />
> runtime based on some assumptions (in this case that a floating point <br />
> number is a double). The other is a clearly prototyped API function <br />
> which the compiler can handle as defined. There&#8217;s nothing precluding the <br />
> introduction of an outlet_double() in the future, nor is this logically <br />
> inconsistent. The heritage for passing doubles on the stack for our <br />
> dynamically bound function pointers comes from the PPC architecture <br />
> passing both floats and doubles on the stack as double precision values. <br />
> We decided to keep this convention on Intel.<br />
> <br />
> Note that in Max floats are currently always passed between objects at <br />
> 32bit resolution. This might be increased in a future version (for which <br />
> our use of doubles on the stack will prove useful). However, for now it <br />
> is a limitation.</p>
<p>Thanks for your precisions</p>
<p>> Hope this sheds a bit of light on what&#8217;s going on. If you really want to <br />
> avoid this float/double confusion, simply define all your functions with <br />
> A_GIMME and manage the atoms which are passed between objects in your <br />
> object. The other method signatures and outlet calls are really there <br />
> only for convenience.<br />
Not especially, A_FLOAT is more convenient&#8230; I&#8217;ll use double for inlets.</p>
<p>That was just to point the difference and try to understand.</p>
<p>Best regards,<br />
CHris</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

