<?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: lowest common divider</title>
		<atom:link href="http://cycling74.com/forums/topic/lowest-common-divider/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/lowest-common-divider/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 14:52:11 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-31727</guid>
					<title><![CDATA[lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-31727</link>
					<pubDate>Wed, 02 May 2007 23:46:28 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>Hi all, </p>
<p>Sorry,  this is probably very basic for most of you but &#8211;  is there an object to find the lowest common divider of a single number other than 1.</p>
<p>Went thru max reference and couldn&#8217;t find anything &#8211; checked out Mathworld too but&#8230;  that just confused me further.</p>
<p>thanks<br />
vic</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103418</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103418</link>
					<pubDate>Thu, 03 May 2007 00:15:35 +0000</pubDate>
					<dc:creator>mzed</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: pechnatunk wrote on Wed, 02 May 2007 16:46<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> Hi all, <br />
> <br />
> Sorry,  this is probably very basic for most of you but &#8211;  is there an object to find the lowest common divider of a single number other than 1.<br />
> <br />
> Went thru max reference and couldn&#8217;t find anything &#8211; checked out Mathworld too but&#8230;  that just confused me further.<br />
> <br />
> thanks<br />
> vic<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Huh?  Could you use a different term.  Common usually implies more than one number.  Are you looking for factors, or&#8230;?</p>
<p>mz</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103419</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103419</link>
					<pubDate>Thu, 03 May 2007 02:05:29 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>sorry,  </p>
<p>yes, now that i think about it I want the lowest factor &#8211; </p>
<p>8 = 2  9 = 3  10 = 5 7 = 1 etc.</p>
<p>i&#8217;m using this as a basis for sample slicing &#8211; where i&#8217;ll have a list of selected dividers in a coll similar to time signiture. these get multiplied by the length &#8211; but i want to constrain the the resolution of the length to a factor of the divider &#8211; using the lowest factor and the modulus of it &#8211; where each mod zero is an allowed length value. start position of the sample will use a similar technique.</p>
<p>I&#8217;ve built it to random/drunk these parameters but i&#8217;d like to quantise it to a signiture using this technique.</p>
<p>hope that makes it clearer.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103420</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103420</link>
					<pubDate>Thu, 03 May 2007 06:30:01 +0000</pubDate>
					<dc:creator>Rob Ramirez</dc:creator>

					<description>
						<![CDATA[
						<p>here is something. seems to cause stack overflow with some high numbers so i limited it to integers less than 1024.</p>
<p>max v2;<br />
#N vpatcher 304 108 898 548;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 200 250 27 196617 i;<br />
#P window setfont &#8220;Sans Serif&#8221; 20.;<br />
#P number 316 334 66 20 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P newex 200 190 31 196617 t b 1;<br />
#P newex 316 273 27 196617 i;<br />
#P comment 35 121 63 196617 bang to test;<br />
#P button 100 102 32 0;<br />
#P comment 317 369 71 196617 lowest factor;<br />
#P message 359 165 14 196617 1;<br />
#P newex 267 196 40 196617 t b b 0;<br />
#P newex 267 165 32 196617 sel 0;<br />
#P newex 307 249 29 196617 gate;<br />
#P window setfont &#8220;Sans Serif&#8221; 20.;<br />
#P number 231 334 66 20 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P newex 231 250 27 196617 1;<br />
#P number 353 219 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P message 381 161 14 196617 2;<br />
#P button 334 165 15 0;<br />
#N counter;<br />
#X flags 0 0;<br />
#P newobj 353 196 66 196617 counter;<br />
#P number 267 138 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 267 113 27 196617 %;<br />
#P newex 226 165 32 196617 sel 1;<br />
#P newex 259 72 73 196617 t b b b i;<br />
#P number 226 138 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P number 259 50 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P number 134 58 35 9 3 1024 3 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 226 112 27 196617 /;<br />
#P comment 223 369 79 196617 greatest factor;<br />
#P comment 40 59 97 196617 load number to test;<br />
#P fasten 7 0 24 0 231 186 205 186;<br />
#P connect 24 0 26 0;<br />
#P fasten 3 0 26 1 139 217 222 217;<br />
#P fasten 3 0 2 0 139 92 231 92;<br />
#P fasten 6 2 2 0 306 102 231 102;<br />
#P connect 2 0 5 0;<br />
#P connect 5 0 7 0;<br />
#P fasten 18 0 14 0 272 232 236 232;<br />
#P fasten 19 0 14 0 364 190 236 190;<br />
#P fasten 26 0 15 0 205 300 236 300;<br />
#P connect 14 0 15 0;<br />
#P fasten 6 3 2 1 327 99 248 99;<br />
#P connect 7 1 14 1;<br />
#P fasten 16 0 4 0 312 304 176 304 176 40 264 40;<br />
#P connect 4 0 6 0;<br />
#P fasten 3 0 8 0 139 107 272 107;<br />
#P fasten 6 1 8 0 285 96 272 96;<br />
#P connect 8 0 9 0;<br />
#P connect 9 0 17 0;<br />
#P connect 24 0 18 0;<br />
#P connect 17 0 18 0;<br />
#P fasten 6 3 8 1 327 105 289 105;<br />
#P fasten 18 2 16 0 302 231 312 231;<br />
#P fasten 19 0 16 0 364 193 312 193;<br />
#P fasten 18 0 23 0 272 270 321 270;<br />
#P connect 23 0 25 0;<br />
#P fasten 13 0 16 1 358 240 331 240;<br />
#P fasten 24 1 23 1 226 242 338 242;<br />
#P connect 16 0 23 1;<br />
#P fasten 21 0 11 0 105 158 339 158;<br />
#P fasten 6 0 11 0 264 132 339 132;<br />
#P fasten 11 0 10 0 339 187 358 187;<br />
#P connect 10 0 13 0;<br />
#P fasten 21 0 19 0 105 158 364 158;<br />
#P fasten 21 0 12 0 105 154 386 154;<br />
#P connect 12 0 10 2;<br />
#P pop;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103421</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103421</link>
					<pubDate>Thu, 03 May 2007 09:38:01 +0000</pubDate>
					<dc:creator>Bas van der Graaff</dc:creator>

					<description>
						<![CDATA[
						<p>&#8220;8 = 2 9 = 3 10 = 5 7 = 1 etc.&#8221;</p>
<p>10 => 2 you must mean?</p>
<p>Anyway, fun question. Here&#8217;s a patch for just the lowest factor other than 1:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 67 125 47 196617 t b i;<br />
#P newex 67 151 27 196617 i;<br />
#P newex 67 244 50 196617 print end;<br />
#P newex 67 223 27 196617 i;<br />
#P newex 67 196 32 196617 sel 0;<br />
#P newex 67 174 27 196617 %;<br />
#P newex 67 74 107 196617 t b 2 i 1;<br />
#N counter 2 100;<br />
#X flags 0 0;<br />
#P newobj 67 101 74 196617 counter 2 100;<br />
#P number 67 45 35 9 3 1024 3 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P connect 2 2 7 1;<br />
#P connect 2 2 1 4;<br />
#P connect 2 1 1 2;<br />
#P fasten 8 1 5 1 109 217 89 217;<br />
#P fasten 8 1 3 1 109 170 89 170;<br />
#P connect 5 0 6 0;<br />
#P connect 4 0 5 0;<br />
#P connect 3 0 4 0;<br />
#P connect 7 0 3 0;<br />
#P connect 8 0 7 0;<br />
#P connect 1 0 8 0;<br />
#P connect 2 0 1 0;<br />
#P connect 4 1 1 0;<br />
#P connect 0 0 2 0;<br />
#P window clipboard copycount 9;</p>
<p>It too seems to produce stack overflows when putting in larger primes. Comes from using counter too heavily, i presume. The patch below shows that it&#8217;s helpful to even have one % in the loop; the right one overflows sooner than the left one. What would be a good workaround?</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P number 500 140 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window linecount 1;<br />
#P newex 149 115 72 196617 loadmess 500;<br />
#P number 268 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 268 63 30 196617 t b b;<br />
#P button 268 45 15 0;<br />
#P newex 340 208 55 196617 print done;<br />
#P newex 340 161 170 196617 if $i1 == $i2 then $i1 else out2 $i1;<br />
#P message 288 85 33 196617 set 1;<br />
#N counter 0 0 2000;<br />
#X flags 0 0;<br />
#P newobj 268 110 89 196617 counter 0 0 2000;<br />
#B color 5;<br />
#P number 41 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P number 149 142 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 41 63 30 196617 t b b;<br />
#P button 41 45 15 0;<br />
#P newex 113 208 55 196617 print done;<br />
#P newex 113 186 32 196617 sel 0;<br />
#P newex 113 161 46 196617 % 1000;<br />
#P message 61 85 33 196617 set 1;<br />
#N counter 0 0 2000;<br />
#X flags 0 0;<br />
#P newobj 41 110 89 196617 counter 0 0 2000;<br />
#B color 5;<br />
#P connect 16 0 7 0;<br />
#P fasten 16 0 17 0 154 136 505 136;<br />
#P connect 17 0 11 1;<br />
#P connect 5 0 6 0;<br />
#P connect 3 1 0 0;<br />
#P fasten 1 0 0 0 66 105 46 105;<br />
#P connect 6 0 0 0;<br />
#P connect 0 0 8 0;<br />
#P connect 6 1 1 0;<br />
#P connect 0 0 2 0;<br />
#P connect 2 0 3 0;<br />
#P connect 3 0 4 0;<br />
#P connect 7 0 2 1;<br />
#P connect 13 0 14 0;<br />
#P connect 11 1 9 0;<br />
#P connect 14 0 9 0;<br />
#P fasten 10 0 9 0 293 105 273 105;<br />
#P connect 9 0 15 0;<br />
#P connect 14 1 10 0;<br />
#P connect 9 0 11 0;<br />
#P connect 11 0 12 0;<br />
#P window clipboard copycount 18;</p>
<p>A patch to get the lowest common denominator off a list of unknown length sounds good too, maybe some other time&#8230;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103422</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103422</link>
					<pubDate>Thu, 03 May 2007 22:09:47 +0000</pubDate>
					<dc:creator>Roman Thilenius</dc:creator>

					<description>
						<![CDATA[
						<p>
not that i would know it offhand now &#8230; but there <br />
is some very funny trick how to check this with<br />
simple algebra, isnt it? <br />
maybe someone knows what i mean ..</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103423</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103423</link>
					<pubDate>Thu, 03 May 2007 22:26:38 +0000</pubDate>
					<dc:creator>ludwig_sears</dc:creator>

					<description>
						<![CDATA[
						<p>That&#8217;s what the deferlow object is for! Always always insert deferlow in your loop back&#8211; in this case, the right outlet of &#8220;select 0&#8243; would connect to a deferlow, and that connects back to the counter. I&#8217;m by no means a programming expert, I just stumbled upon this. Deferlow, I guess, is like a &#8216;Yield&#8217; sign for Max, letting the system do required maintenance while your patch is running. (Wow, I actually had a fresh bit of useful info for the Max list!)</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103424</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103424</link>
					<pubDate>Thu, 03 May 2007 22:27:37 +0000</pubDate>
					<dc:creator>Peter Castine</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: pechnatunk wrote on Thu, 03 May 2007 04:05<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> yes, now that i think about it I want the lowest factor &#8211; <br />
> <br />
> 8 = 2  9 = 3  10 = 5 7 = 1 etc.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>You want to single out the lowest prime factor.</p>
<p>There is a prime number generator in Tap.Tools that might help.</p>
<p>Also, the Sieve of Erastosthenes is the traditional efficient method for finding primes. Googling on the term should give you some ideas. (Sorry, I haven&#8217;t looked at patches submitted in detail, but the stack overflows leave me thinking they&#8217;re not Erastosthenes).</p>
<p>Hope this helps,<br />
P.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103425</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103425</link>
					<pubDate>Fri, 04 May 2007 18:24:42 +0000</pubDate>
					<dc:creator>Stefan Tiedje</dc:creator>

					<description>
						<![CDATA[
						<p>David Wright schrieb:<br />
> That&#8217;s what the deferlow object is for! Always always insert deferlow<br />
> in your loop back&#8211; in this case, the right outlet of &#8220;select 0&#8243;<br />
> would connect to a deferlow, and that connects back to the counter.<br />
> I&#8217;m by no means a programming expert, I just stumbled upon this.<br />
> Deferlow, I guess, is like a &#8216;Yield&#8217; sign for Max, letting the system<br />
> do required maintenance while your patch is running. (Wow, I actually<br />
> had a fresh bit of useful info for the Max list!) </p>
<p>Yes, and no, in the patch which would overflow the stack on big numbers, <br />
it might be fine if you can guarantee that the number stays low. <br />
deferlow is slowing down things by using the scheduler queue instead of <br />
the stack.<br />
In the patch I posted recently for finding the occurance of more than <br />
the half of its elements being in a certain range, there is recursion <br />
(which means feedback) but no deferlow. And its not needed, because the <br />
condition to break the recursion has a max of 256 steps (in theory, and <br />
only because of the limitation of zl). That&#8217;s not dangerous. Also as the <br />
calculation doesn&#8217;t put out anything before the result is found, the <br />
stack size needed is not too high.</p>
<p>One thing to look at if a stack overflow only happens with big numbers <br />
is, optimization. You might not need the feedback for all cases etc, <br />
Sometimes you can just &#8220;turn around&#8221; the calculation instead of starting <br />
with low numbers going up, you could go down from high numbers&#8230;</p>
<p>Peters quote is correct I guess:<br />
Peter Castine schrieb:<br />
 > (Sorry, I haven&#8217;t looked at patches submitted in detail, but the<br />
 > stack overflows leave me thinking they&#8217;re not Erastosthenes).</p>
<p>If you do not need the calculation fast, a deferlow might be fine <br />
though&#8230; (In this case Erastosthenes is better&#8230; ;-)</p>
<p>Stefan</p>
<p>&#8211; <br />
Stefan Tiedje&#8212;&#8212;&#8212;&#8212;x&#8212;&#8212;-<br />
&#8211;_____&#8212;&#8212;&#8212;&#8211;|&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8211;(_|_ &#8212;-|&#8212;&#8211;|&#8212;&#8211;()&#8212;&#8212;-<br />
&#8211; _|_)&#8212;-|&#8212;&#8211;()&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8212;&#8212;&#8212;-()&#8212;&#8212;&#8211;www.ccmix.com</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103426</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103426</link>
					<pubDate>Sat, 05 May 2007 04:57:43 +0000</pubDate>
					<dc:creator>ludwig_sears</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for that info, Stefan&#8230; I made 3 mistakes, writing the word &#8220;always,&#8221; writing the word &#8220;always&#8221; again, and pretending I really knew what I was talking about&#8230;</p>
<p>Stefan wrote:<br />
> Sometimes you can just &#8220;turn around&#8221; the calculation instead of <br />
> starting with low numbers going up, you could go down from high<br />
> numbers&#8230;</p>
<p>Yes, I noticed recently that works.</p>
<p>&#8220;You can&#8217;t go back. The answer is No. And wishing for it only makes it bleed.&#8221;  &#8212; Tom Waits</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103427</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103427</link>
					<pubDate>Sat, 05 May 2007 08:38:41 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: Bas van der Graaff wrote on Thu, 03 May 2007 19:38<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>> 10 => 2 you must mean?</p>
<p>Sort of, </p>
<p>Peter you&#8217;re right I need to find the prime factors and then be able to switch between them eg. if divided into 24 it may be useful to use either 2 or 3 etc.  thats why I said 10 = 5 &#8211;  i was thinking of a sample in 5/4. </p>
<p>
Anyway thanks for all the help &#8211; for various reasons I was only able to open the patch from robtherich but I had a look at Erastosthenes and it makes sense but will take a while &#8211; I have very limited math syntax knowledge, and recursion in Max is something I&#8217;m yet to grasp.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103428</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103428</link>
					<pubDate>Tue, 08 May 2007 03:46:38 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>OK &#8211; I&#8217;m gonna try this without recursion.</p>
<p>But first &#8230;</p>
<p>I need to construct a list of n values which is consecutive numbers from 1 -> n.</p>
<p>after that i should be able to solve this &#8211; but will probably be quite clunky.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103429</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103429</link>
					<pubDate>Sun, 13 May 2007 11:11:55 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>sorry, should have specified that previous post was a question</p>
<p>does anyone know how to construct a list of consecutive numbers.</p>
<p>to the value n.</p>
<p>it would be very easy in Scheme &#8211; but Max&#8230; ?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103430</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103430</link>
					<pubDate>Sun, 13 May 2007 11:45:34 +0000</pubDate>
					<dc:creator>José Manuel Berenguer</dc:creator>

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

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103431</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103431</link>
					<pubDate>Sun, 13 May 2007 18:10:02 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>On 13 mai 07, at 13:45, jose manuel berenguer wrote:</p>
<p>> for shure, you will find a better and shorter way to do it, but  <br />
> here is a possibility</p>
<p>zl group?</p>
<p>ej</p>
<p>
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P user textedit 416 203 612 240 32896 3 9 1;<br />
#P window linecount 1;<br />
#P newex 416 176 62 196617 prepend set;<br />
#P newex 386 76 76 196617 t i i;<br />
#P number 386 59 35 9 0 0 64 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 386 97 40 196617 uzi;<br />
#P newex 416 132 46 196617 zl group;<br />
#P connect 2 0 3 0;<br />
#P connect 3 0 1 0;<br />
#P connect 3 1 0 1;<br />
#P connect 0 0 4 0;<br />
#P connect 1 2 0 0;<br />
#P connect 4 0 5 0;<br />
#P window clipboard copycount 6;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103432</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103432</link>
					<pubDate>Sun, 13 May 2007 18:44:55 +0000</pubDate>
					<dc:creator>José Manuel Berenguer</dc:creator>

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

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103433</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103433</link>
					<pubDate>Sun, 13 May 2007 19:14:14 +0000</pubDate>
					<dc:creator>mcartwright</dc:creator>

					<description>
						<![CDATA[
						<p>i don&#8217;t really use javascript in max that much, so i&#8217;m not familiar<br />
with it&#8217;s drawbacks&#8230; but couldn&#8217;t this whole lowest common factor<br />
thing be solved very simply with a js patch like the one below?</p>
<p>function msg_int (x) {<br />
	var i=0;<br />
	var quotient;<br />
	var divisor = 0;<br />
	for (i =2; i < = Math.floor(x/2); i++) {<br />
		quotient = x/i;<br />
		if (quotient == Math.floor(quotient)) {<br />
			divisor = i;<br />
			break;<br />
		}<br />
	}<br />
	if (divisor > 0) {<br />
		outlet(0,divisor);<br />
	} else {<br />
		outlet(0,1);<br />
	}<br />
}</p>
<p>On 5/13/07, Emmanuel Jourdan <c74 -mailinglists@e--j.com> wrote:<br />
> On 13 mai 07, at 13:45, jose manuel berenguer wrote:<br />
><br />
> > for shure, you will find a better and shorter way to do it, but<br />
> > here is a possibility<br />
><br />
> zl group?<br />
><br />
> ej<br />
><br />
><br />
> #P window setfont &#8220;Sans Serif&#8221; 9.;<br />
> #P user textedit 416 203 612 240 32896 3 9 1;<br />
> #P window linecount 1;<br />
> #P newex 416 176 62 196617 prepend set;<br />
> #P newex 386 76 76 196617 t i i;<br />
> #P number 386 59 35 9 0 0 64 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
> #P newex 386 97 40 196617 uzi;<br />
> #P newex 416 132 46 196617 zl group;<br />
> #P connect 2 0 3 0;<br />
> #P connect 3 0 1 0;<br />
> #P connect 3 1 0 1;<br />
> #P connect 0 0 4 0;<br />
> #P connect 1 2 0 0;<br />
> #P connect 4 0 5 0;<br />
> #P window clipboard copycount 6;<br />
></c74></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103434</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103434</link>
					<pubDate>Sun, 13 May 2007 23:02:17 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>Quote: <a href="mailto:mcartwright@gmail.com">mcartwright@gmail.com</a> wrote on Mon, 14 May 2007 05:14<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
> i don&#8217;t really use javascript in max that much, so i&#8217;m not familiar<br />
> with it&#8217;s drawbacks&#8230; but couldn&#8217;t this whole lowest common factor<br />
> thing be solved very simply with a js patch like the one below?<br />
> <br />
> function msg_int (x) {<br />
> 	var i=0;<br />
> 	var quotient;<br />
> 	var divisor = 0;<br />
> 	for (i =2; i < = Math.floor(x/2); i++) {<br />
> 		quotient = x/i;<br />
> 		if (quotient == Math.floor(quotient)) {<br />
> 			divisor = i;<br />
> 			break;<br />
> 		}<br />
> 	}<br />
> 	if (divisor > 0) {<br />
> 		outlet(0,divisor);<br />
> 	} else {<br />
> 		outlet(0,1);<br />
> 	}<br />
> }</p>
<p>
Cool thanks, </p>
<p>seems like I should take a look at java script.<br />
however &#8211; the reason I asked about constructing a list of consecutive numbers is because I realised I not only wanted to find the lowest factor but all prime factors &#8211; this would allow a changable resolution in quantisation.<br />
But it looks like making a java object to do this is the neatest technique &#8211; especially since I didn&#8217;t want my divider limited to 256 &#8211; which is what happens with the above two solutions &#8211; due to the limitations of Max message and text boxes,  but of course thanks anyway.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103435</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103435</link>
					<pubDate>Tue, 10 Mar 2009 05:03:07 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>OK I&#8217;m re-opening this can of worms. </p>
<p>I left this problem ages ago and have recently gone back to it. </p>
<p>I&#8217;d like to get a list of say, the lowest 3-5 prime factors of a number. <br />
I&#8217;ve tried using the explaination of the Sieve of Eratosthenes algorithm on wikipedia</p>
<p> &#8211; <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes">http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes</a></p>
<p>But I&#8217;m approaching 2 brick walls &#8211; I&#8217;d like to use it with numbers above 256 (entry limit on message and text boxes)</p>
<p>also &#8211; I&#8217;m having trouble recursively truncating the list and applying the maths.</p>
<p>Thanks heaps to Jose and Emmanuel for the list generating patches. </p>
<p>And thanks mcartwright &#8211; but I can&#8217;t adapt your java script for the life of me.</p>
<p>So yeah &#8211; It would be great to be able to get the lowest 3 &#8211; 5 prime factors of an integer instead of only the lowest.</p>
<p>thanks.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103436</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103436</link>
					<pubDate>Tue, 10 Mar 2009 10:42:17 +0000</pubDate>
					<dc:creator>Bas van der Graaff</dc:creator>

					<description>
						<![CDATA[
						<p>This js will give you all the prime factors.<br />
Just getting the first few can be done using [zl thin] and [zl slice].</p>
<p>function msg_int(v)<br />
{<br />
    while (v%2==0) <br />
    {<br />
        outlet(0,2);<br />
        v/=2;<br />
    }<br />
    var i=3;<br />
    while (i*i1) outlet(0,v);<br />
}</p>
<p>And a patch, save the js as primes.js</p>
<p>
<div><span id="toggle103436-0" class="patchtoggle" onmousedown="toggleMaxPatch('post103436-0', 'er103436-0');">&#8211; Pasted Max <span id="maxversion103436-0"></span> Patch, click to <span id="er103436-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A466.3ocyU1rbBBCDG%2BL7TjImsND9Rs25yQGmNAHEiCDXHgoVc7cujEvpsTKh%0AVKWXmraB6%2B7KYytyz.GjsgIwnGQOiLL1YZX.tzNLZFafSoaBSnRXZ3TlTRiY%0A3I0wTrMJvuCh3f7Is9EkoYkpDlBVEowaNUEthKheofEppypsyroVSP1y.imk%0A9KwepEZYyZp%2BMp2yY0K.iODhGAoNKX8CD21L%2BZlPInovrwOUvoIGGQx2BQH5%0ADcPpbQqRs091aZp%2BLomHQvdqRBeiHaSPxDdHC41MTrOGT7An3QzF2E.TleVn%0AL4m.i8XDLppM7fohCbIo9dyPoBYzQEEJ.wQaSBSXzhtYiy4XiKfCOv3M%2B2YS%0A.UDq4CWnzl1D2IsrtMzhLDZUlFvJFvckZdXO%2BnmUNKOZ3.fktfvh%2BQF7i0Qw%0AEYk4CtPxBdXw0%2BJJj7Gc0Qqkn7BdUapoqkWd2He3EWxLfLMClewcibt82Ufz%0AfS3hu1tF1EZ%2BmhJYVYQXqHaaDf9biDwjJtfp3YhimTUuJD4vjVwihXP7V8kx%0AixypJUZDAZYmGb8VSj9noSE9etlrNAAcqIm6pjb5Ak7uqJxuOmaj6%2B413hRf%0AjrGURZQeN3rtBIUMXu4GGs0zbA%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post103436-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode103436-0">----------begin_max5_patcher----------
466.3ocyU1rbBBCDG+L7TjImsND9Rs25yQGmNAHEiCDXHgoVc7cujEvpsTKh
VKWXmraB6+7KYytyz.GjsgIwnGQOiLL1YZX.tzNLZFafSoaBSnRXZ3TlTRiY
3I0wTrMJvuCh3f7Is9EkoYkpDlBVEowaNUEthKheofEppypsyroVSP1y.imk
9KwepEZYyZp+Mp2yY0K.iODhGAoNKX8CD21L+ZlPInovrwOUvoIGGQx2BQH5
DcPpbQqRs091aZp+LomHQvdqRBeiHaSPxDdHC41MTrOGT7An3QzF2E.TleVn
L4m.i8XDLppM7fohCbIo9dyPoBYzQEEJ.wQaSBSXzhtYiy4XiKfCOv3M+2YS
.UDq4CWnzl1D2IsrtMzhLDZUlFvJFvckZdXO+nmUNKOZ3.fktfvh+QF7i0Qw
EYk4CtPxBdXw0+JJj7Gc0Qqkn7BdUapoqkWd2He3EWxLfLMClewcibt82Ufz
fS3hu1tF1EZ+mhJYVYQXqHaaDf9biDwjJtfp3YhimTUuJD4vjVwihXP7V8kx
ixypJUZDAZYmGb8VSj9noSE9etlrNAAcqIm6pjb5Ak7uqJxuOmaj6+413hRf
jrGURZQeN3rtBIUMXu4GGs0zbA
-----------end_max5_patcher-----------</code></pre></div>
</div>
</p><p>Edit: tabs are not stored?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/lowest-common-divider/#post-103437</guid>
					<title><![CDATA[Re: lowest common divider]]></title>
					<link>http://cycling74.com/forums/topic/lowest-common-divider/#post-103437</link>
					<pubDate>Tue, 10 Mar 2009 22:57:07 +0000</pubDate>
					<dc:creator>pechnatunk</dc:creator>

					<description>
						<![CDATA[
						<p>Beautiful!!<br />
It works a charm. <br />
Thanks.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

