<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for kReese.net</title>
	<atom:link href="http://kreese.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://kreese.net</link>
	<description>Image Processing, Optimization, Algorithms, and Programming</description>
	<lastBuildDate>Tue, 03 Apr 2012 16:33:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Python: Recursion by Kristopher Reese</title>
		<link>http://kreese.net/blog/2011/06/18/python-recursion/comment-page-1/#comment-857</link>
		<dc:creator>Kristopher Reese</dc:creator>
		<pubDate>Tue, 03 Apr 2012 16:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=791#comment-857</guid>
		<description>The recursive function you&#039;re asking about is (i assume) supposed to be a recursive power function, although why you&#039;re passing 3 arguments is unknown to me.  Generally, a power function only requires the base and the power

2^12 = 4096

so your function should be written as:

def pow(x, n):
    if n==1
        return x
    else
        return x * pow(x, n-1)


So what&#039;s happening in yours?  Well, it&#039;s running through the power as it should but it&#039;s going to 0 instead of stopping at 1.  Once n reaches 0 which would be equivalent to y^0, it&#039;s returning x instead of 1 (as any number raised to the zeroth power is), so the function call pow(2,2,12) is multiplying x into the power.  It&#039;s an odd function, and I don&#039;t see much practical use in the function.  As a note, using the input pow(1,2,12) will result in the proper 2^12.

Sorry for the delay in response.  My class was working on writing the power function and I didn&#039;t want to publish this until they had completed.</description>
		<content:encoded><![CDATA[<p>The recursive function you&#8217;re asking about is (i assume) supposed to be a recursive power function, although why you&#8217;re passing 3 arguments is unknown to me.  Generally, a power function only requires the base and the power</p>
<p>2^12 = 4096</p>
<p>so your function should be written as:</p>
<p>def pow(x, n):<br />
    if n==1<br />
        return x<br />
    else<br />
        return x * pow(x, n-1)</p>
<p>So what&#8217;s happening in yours?  Well, it&#8217;s running through the power as it should but it&#8217;s going to 0 instead of stopping at 1.  Once n reaches 0 which would be equivalent to y^0, it&#8217;s returning x instead of 1 (as any number raised to the zeroth power is), so the function call pow(2,2,12) is multiplying x into the power.  It&#8217;s an odd function, and I don&#8217;t see much practical use in the function.  As a note, using the input pow(1,2,12) will result in the proper 2^12.</p>
<p>Sorry for the delay in response.  My class was working on writing the power function and I didn&#8217;t want to publish this until they had completed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Python: Recursion by Tich</title>
		<link>http://kreese.net/blog/2011/06/18/python-recursion/comment-page-1/#comment-856</link>
		<dc:creator>Tich</dc:creator>
		<pubDate>Wed, 07 Mar 2012 15:21:46 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=791#comment-856</guid>
		<description>That gcd function is some neat piece of code, when I compare it with mine i feel small, check it out: 
def gcd2(x,y):
    gcd=[]
    count=1
    for i in range(2,100000):
        if  x%i==0 and y%i==0:
            gcd.append(i)
    try:
        print(&quot;The gcd is: &quot;,max(gcd))
    except ValueError:
         print(&quot;No common divisor&quot;)
Recursion&#039;s got some power. There&#039;s this one recursive function that I just don&#039;t understand , goes this way:
def pow( x, y, n ):
	if n == 0:
		return x
	else:
		return y * pow( x, y, n-1 )
and pow(2,2,12) outputs 8192. If you can explain it I&#039;d appreciate it .</description>
		<content:encoded><![CDATA[<p>That gcd function is some neat piece of code, when I compare it with mine i feel small, check it out:<br />
def gcd2(x,y):<br />
    gcd=[]<br />
    count=1<br />
    for i in range(2,100000):<br />
        if  x%i==0 and y%i==0:<br />
            gcd.append(i)<br />
    try:<br />
        print(&#8220;The gcd is: &#8220;,max(gcd))<br />
    except ValueError:<br />
         print(&#8220;No common divisor&#8221;)<br />
Recursion&#8217;s got some power. There&#8217;s this one recursive function that I just don&#8217;t understand , goes this way:<br />
def pow( x, y, n ):<br />
	if n == 0:<br />
		return x<br />
	else:<br />
		return y * pow( x, y, n-1 )<br />
and pow(2,2,12) outputs 8192. If you can explain it I&#8217;d appreciate it .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating Musical Rhythms by Kristopher Reese</title>
		<link>http://kreese.net/blog/2010/03/27/generating-musical-rhythms/comment-page-1/#comment-855</link>
		<dc:creator>Kristopher Reese</dc:creator>
		<pubDate>Fri, 24 Feb 2012 17:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=454#comment-855</guid>
		<description>This post was strictly related to rhythms, and I didn&#039;t go into melodic applications because it was outside of the scope of the discussion for the post.  However, It could be extended using genetic algorithms to give rhythmic variations by measuring similarity through use of Hamming Distances.  This would be a very blackbox method but would give a metaheuristic approach for solving that problem.

Melodies are trickier as there&#039;s a lot that can go into a melody.  First you have to have an understanding of the underlying chord progression, which I have done a little research on using Markov Decision Processes and Bayesian Networks.  That research of course lacked any temporal aspects and one would have to create a decision process to take time into consideration.  With that though, one could approach the melody as a bitonic sort of random musical pitches with a probability of mutation (again it would be a sort of metaheuristic approach).  One might be able to find a way to tie Markov Decision Processes to the melody as well, which would make the melody less random.

None of this would of course guarantee that your music would come out pretty, but you would get a quasi-random tonal composition.</description>
		<content:encoded><![CDATA[<p>This post was strictly related to rhythms, and I didn&#8217;t go into melodic applications because it was outside of the scope of the discussion for the post.  However, It could be extended using genetic algorithms to give rhythmic variations by measuring similarity through use of Hamming Distances.  This would be a very blackbox method but would give a metaheuristic approach for solving that problem.</p>
<p>Melodies are trickier as there&#8217;s a lot that can go into a melody.  First you have to have an understanding of the underlying chord progression, which I have done a little research on using Markov Decision Processes and Bayesian Networks.  That research of course lacked any temporal aspects and one would have to create a decision process to take time into consideration.  With that though, one could approach the melody as a bitonic sort of random musical pitches with a probability of mutation (again it would be a sort of metaheuristic approach).  One might be able to find a way to tie Markov Decision Processes to the melody as well, which would make the melody less random.</p>
<p>None of this would of course guarantee that your music would come out pretty, but you would get a quasi-random tonal composition.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating Musical Rhythms by DATSOUND</title>
		<link>http://kreese.net/blog/2010/03/27/generating-musical-rhythms/comment-page-1/#comment-854</link>
		<dc:creator>DATSOUND</dc:creator>
		<pubDate>Thu, 23 Feb 2012 12:11:26 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=454#comment-854</guid>
		<description>THANKS, It was interesting, but didnt give me much info relating the formulas to rythm generation. 

I do alot of tonal music maths research, I would have been interested to hear how you mathematically relate different bars of melody, tonal rules for melody, ways for making them into seperate melodic components similar to how the mind actually thinks. 

the code was complicated, there was no example of variations upon rythmic themes, and rules for keeping variations related.

cheers!</description>
		<content:encoded><![CDATA[<p>THANKS, It was interesting, but didnt give me much info relating the formulas to rythm generation. </p>
<p>I do alot of tonal music maths research, I would have been interested to hear how you mathematically relate different bars of melody, tonal rules for melody, ways for making them into seperate melodic components similar to how the mind actually thinks. </p>
<p>the code was complicated, there was no example of variations upon rythmic themes, and rules for keeping variations related.</p>
<p>cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Concepts of Number Theory: Bases by Kristopher Reese</title>
		<link>http://kreese.net/blog/2011/08/18/concepts-of-number-theory-bases/comment-page-1/#comment-773</link>
		<dc:creator>Kristopher Reese</dc:creator>
		<pubDate>Sun, 21 Aug 2011 22:37:37 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=937#comment-773</guid>
		<description>Yes, the second part is closer to right.  You want to think modular arithmetic though.  You should read through the post on modular arithmetic.  We are JUST concerned about those remainders -- not fractions (though we do need to track the number we are dividing next).  

If it is easier for you to think fractions, then EVERY fractional remainder needs to be thought of in terms of the divisor (4 in your case) though it ends up being whatever that base is.</description>
		<content:encoded><![CDATA[<p>Yes, the second part is closer to right.  You want to think modular arithmetic though.  You should read through the post on modular arithmetic.  We are JUST concerned about those remainders &#8212; not fractions (though we do need to track the number we are dividing next).  </p>
<p>If it is easier for you to think fractions, then EVERY fractional remainder needs to be thought of in terms of the divisor (4 in your case) though it ends up being whatever that base is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Concepts of Number Theory: Bases by Aaron Marples</title>
		<link>http://kreese.net/blog/2011/08/18/concepts-of-number-theory-bases/comment-page-1/#comment-772</link>
		<dc:creator>Aaron Marples</dc:creator>
		<pubDate>Sun, 21 Aug 2011 16:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=937#comment-772</guid>
		<description>4/957=0.00417972831
4/239=0.01673640167
????
oh wait. 
957/4 = 239   1/4
239/4 = 59     3/4
59/4   = 14     3/4
14/4   = 3       1/2  =  3   2/4
3/4    =  0       3/4
32331</description>
		<content:encoded><![CDATA[<p>4/957=0.00417972831<br />
4/239=0.01673640167<br />
????<br />
oh wait.<br />
957/4 = 239   1/4<br />
239/4 = 59     3/4<br />
59/4   = 14     3/4<br />
14/4   = 3       1/2  =  3   2/4<br />
3/4    =  0       3/4<br />
32331</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to Python by amarples0002</title>
		<link>http://kreese.net/blog/2011/06/02/introduction-to-python/comment-page-1/#comment-759</link>
		<dc:creator>amarples0002</dc:creator>
		<pubDate>Fri, 12 Aug 2011 00:49:52 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=634#comment-759</guid>
		<description>Now, why would I want to install a snake on my computer? :P

Thanks, I have Python installed on both my linux box and win7</description>
		<content:encoded><![CDATA[<p>Now, why would I want to install a snake on my computer? <img src='http://kreese.net/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Thanks, I have Python installed on both my linux box and win7</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating Musical Rhythms by Euclidean rhythms</title>
		<link>http://kreese.net/blog/2010/03/27/generating-musical-rhythms/comment-page-1/#comment-385</link>
		<dc:creator>Euclidean rhythms</dc:creator>
		<pubDate>Thu, 27 Jan 2011 22:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://kreese.net/?p=454#comment-385</guid>
		<description>[...] The algorithm is very well explained in the article I mentioned, so I won’t repeat it here. There’s another article on the weblog of Robin Price which includes a Max/MSP example, a Pure Data example by Dave Poulter and one in Java by Kristopher Reese. [...]</description>
		<content:encoded><![CDATA[<p>[...] The algorithm is very well explained in the article I mentioned, so I won’t repeat it here. There’s another article on the weblog of Robin Price which includes a Max/MSP example, a Pure Data example by Dave Poulter and one in Java by Kristopher Reese. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

