<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Play Music Twice Does Not Seem to Work</title>
		<link>http://kogics.wikidot.com/forum/t-518031/play-music-twice-does-not-seem-to-work</link>
		<description>Posts in the discussion thread &quot;Play Music Twice Does Not Seem to Work&quot;</description>
				<copyright></copyright>
		<lastBuildDate>Thu, 12 Mar 2026 23:01:07 +0000</lastBuildDate>
		
					<item>
				<guid>http://kogics.wikidot.com/forum/t-518031#post-1500999</guid>
				<title>Re: Play Music Twice Does Not Seem to Work</title>
				<link>http://kogics.wikidot.com/forum/t-518031/play-music-twice-does-not-seem-to-work#post-1500999</link>
				<description></description>
				<pubDate>Sat, 07 Jul 2012 04:39:56 +0000</pubDate>
				<wikidot:authorName>lalitp</wikidot:authorName>				<wikidot:authorUserId>66813</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hello Maydha,</p> <p>It's good to see you playing with the Music related features of Kojo!</p> <blockquote> <p>The following code does not play the score twice as expected.</p> </blockquote> <p>It actually does play it twice, but the second play stops the first play. To see this in action, try the following code</p> <div class="code"> <pre><code>val score2= MusicScore( Melody(&quot;Piano&quot;, &quot;A5h E5q E5q A5w G5h D5q D5q G5w A5w+E5w_G5w+D5w&quot;), Melody(&quot;Piano&quot;, &quot;X[Volume]=15000 Rw Rw Rw Rw Rw Rw A5w+D5w&quot;) ) playMusic(score2) Thread.sleep(3000) // 3000 milli-seconds = 3seconds. I need to add a pause(seconds) command to Kojo playMusic(score2)</code></pre></div> <p>The recommended way to play a score multiple times is:</p> <p>playMusic(score2, 2) // where the 2 can be replaced with any positive number</p> <p>All the best&#8230;</p> <p>Cheers,<br /> - Lalit</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://kogics.wikidot.com/forum/t-518031#post-1500825</guid>
				<title>Play Music Twice Does Not Seem to Work</title>
				<link>http://kogics.wikidot.com/forum/t-518031/play-music-twice-does-not-seem-to-work#post-1500825</link>
				<description></description>
				<pubDate>Sat, 07 Jul 2012 01:14:13 +0000</pubDate>
				<wikidot:authorName>Maydha</wikidot:authorName>								<content:encoded>
					<![CDATA[
						 <p>The following code does not play the score twice as expected. If I invoke playMusic twice instead of using the repeat(2) it still does not play music the second time. Am I doing something wrong or is this not supported by Kojo?</p> <p>//music<br /> val score2= MusicScore(<br /> Melody(&quot;Piano&quot;, &quot;A5h E5q E5q A5w G5h D5q D5q G5w A5w+E5w_G5w+D5w&quot;),<br /> Melody(&quot;Piano&quot;, &quot;X[Volume]=15000 Rw Rw Rw Rw Rw Rw A5w+D5w&quot;)<br /> )<br /> repeat(2) {<br /> playMusic(score2)<br /> }</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>