<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[ChipMusic.org - NES Audio Programming]]></title>
		<link>https://chipmusic.org/forums/topic/3181/nes-audio-programming/</link>
		<description><![CDATA[The most recent posts in NES Audio Programming.]]></description>
		<lastBuildDate>Mon, 21 Feb 2011 14:50:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/57313/#p57313</link>
			<description><![CDATA[<b><i>Shiru says:</i></b><p>BIN in FamiTracker&#039;s export does not include the music player, so you should both incbin the BIN and also include the player&#039;s source, and before calling the player you should tell it where the BIN located - don&#039;t know how, check the player&#039;s source.</p><p>Actually you can use NSF in your NES program, the problem is that you can&#039;t choose where the code will be located, and you&#039;ll not be able to play sound effects. It is acceptable for a simple intro or a music disc. I guess there could be problems with expansion chips, because banking could be used, for &#039;linear&#039; memory model it is very simple:<br /></p><div class="codebox"><pre><code>  lda #0                ;init music, call it once, A is song number
  jsr $ac00
...
  jsr $ac03            ;play music, call it every frame
...
  .bank 1
  .org $a2e2-$80
  .incbin &quot;music.nsf&quot;</code></pre></div>]]></description>
			<pubDate>Mon, 21 Feb 2011 14:50:53 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/57313/#p57313</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/57297/#p57297</link>
			<description><![CDATA[<b><i>ant1 says:</i></b><p>if it is much like c64, you include the&nbsp; bin file with your assembler&nbsp; &nbsp;(there should definitely 100% a way to include bin files) and then jsr to it a lot of times (it probably wants to be called each time the screen refreshs)</p>]]></description>
			<pubDate>Mon, 21 Feb 2011 13:32:39 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/57297/#p57297</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/57291/#p57291</link>
			<description><![CDATA[<b><i>neilbaldwin says:</i></b><p>If the question is aimed at me Nick, I know very little about Famitracker.</p>]]></description>
			<pubDate>Mon, 21 Feb 2011 13:01:25 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/57291/#p57291</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/57271/#p57271</link>
			<description><![CDATA[<b><i>nickmaynard says:</i></b><p>quick question.</p><p>i know you can export .bin files from famitracker, but how do you use that in your assembly code? is there a web page somewhere with a tutorial or code examples?</p>]]></description>
			<pubDate>Mon, 21 Feb 2011 06:36:27 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/57271/#p57271</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52922/#p52922</link>
			<description><![CDATA[<b><i>wedanced says:</i></b><p>lol</p>]]></description>
			<pubDate>Mon, 31 Jan 2011 21:06:25 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52922/#p52922</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52907/#p52907</link>
			<description><![CDATA[<b><i>neilbaldwin says:</i></b><p>I&#039;m like Mister Miyagi and Nick is Daniel-san...&nbsp; <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>&quot;DMC off! DMC on! DMC off! DMC on!&quot;</p>]]></description>
			<pubDate>Mon, 31 Jan 2011 19:54:20 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52907/#p52907</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52902/#p52902</link>
			<description><![CDATA[<b><i>jefftheworld says:</i></b><div class="quotebox"><cite>tRasH cAn maN wrote:</cite><blockquote><p>Neil and Nick sitting in a tree...<br /><img src="https://chipmusic.org/forums/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p></blockquote></div><p>...N - E - S - and - D - M -G!</p>]]></description>
			<pubDate>Mon, 31 Jan 2011 19:41:26 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52902/#p52902</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52879/#p52879</link>
			<description><![CDATA[<b><i>tRasH cAn maN says:</i></b><p>Neil and Nick sitting in a tree...<br /><img src="https://chipmusic.org/forums/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p>]]></description>
			<pubDate>Mon, 31 Jan 2011 15:53:07 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52879/#p52879</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52843/#p52843</link>
			<description><![CDATA[<b><i>wedanced says:</i></b><p>wow. thank you 2 for this public conversation. i have no idea what just happend but maybe when i learn more coding i will figure this out and actually post something relevant.</p>]]></description>
			<pubDate>Sun, 30 Jan 2011 20:49:55 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52843/#p52843</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52830/#p52830</link>
			<description><![CDATA[<b><i>neilbaldwin says:</i></b><div class="quotebox"><cite>nickmaynard wrote:</cite><blockquote><p>yes, that makes perfect sense. i&#039;ll try it out and post my results.</p><p>and seriously, thank you so much for helping me out.</p></blockquote></div><p>No worries Nick <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<pubDate>Sun, 30 Jan 2011 17:14:46 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52830/#p52830</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52822/#p52822</link>
			<description><![CDATA[<b><i>nickmaynard says:</i></b><div class="quotebox"><cite>neilbaldwin wrote:</cite><blockquote><p>$4015 is the voice enable register and uses bits 0 to 4 to enable Pulse 1, Pulse 2, Triangle, Noise and DCM respectively.</p><div class="codebox"><pre><code>Binary    Hex Voice
%00000001 $01 Pulse 1
%00000010 $02 Pulse 2
%00000100 $04 Triangle
%00001000 $08 Noise
%00010000 $10 DCM</code></pre></div><p>To figure out the value to write to $4015 just add up the values. For example, to enable the two Pulse voices, you write $03 to $4015 ($01 + $02). The APU is generally initialised with a value of $0F which enables the first four voices ($01 + $02 +$04 +$08 = $0F).</p><p>DCM differs slightly in that it requires you to turn the voice off and back on again to actually play the sample. In Don&#039;s code, he&#039;s not using any of the other voices so he doesn&#039;t need to turn them on, hence the $00 write (and probably $10 somewhere further down the code to start the sample playing).</p><p>So for you, instead of writing #$00 to $4015, write #$0F. This leaves the first four voices on but clears the enable bit for DCM, as is required. Then to start the sample write #$1F to $4015.</p><p>Make sense?</p></blockquote></div><p>yes, that makes perfect sense. i&#039;ll try it out and post my results.</p><p>and seriously, thank you so much for helping me out.</p>]]></description>
			<pubDate>Sun, 30 Jan 2011 14:36:43 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52822/#p52822</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52812/#p52812</link>
			<description><![CDATA[<b><i>neilbaldwin says:</i></b><p>$4015 is the voice enable register and uses bits 0 to 4 to enable Pulse 1, Pulse 2, Triangle, Noise and DCM respectively.</p><div class="codebox"><pre><code>Binary    Hex Voice
%00000001 $01 Pulse 1
%00000010 $02 Pulse 2
%00000100 $04 Triangle
%00001000 $08 Noise
%00010000 $10 DCM</code></pre></div><p>To figure out the value to write to $4015 just add up the values. For example, to enable the two Pulse voices, you write $03 to $4015 ($01 + $02). The APU is generally initialised with a value of $0F which enables the first four voices ($01 + $02 +$04 +$08 = $0F).</p><p>DCM differs slightly in that it requires you to turn the voice off and back on again to actually play the sample. In Don&#039;s code, he&#039;s not using any of the other voices so he doesn&#039;t need to turn them on, hence the $00 write (and probably $10 somewhere further down the code to start the sample playing).</p><p>So for you, instead of writing #$00 to $4015, write #$0F. This leaves the first four voices on but clears the enable bit for DCM, as is required. Then to start the sample write #$1F to $4015.</p><p>Make sense?</p>]]></description>
			<pubDate>Sun, 30 Jan 2011 09:05:23 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52812/#p52812</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/52809/#p52809</link>
			<description><![CDATA[<b><i>nickmaynard says:</i></b><p>hey neil, if you&#039;ve got a second i have a quick question.</p><p>i want to include some dpcm samples in one of my programs. so, i checked out the source code of no carrier&#039;s program &quot;lickshot&quot; - <a href="http://www.no-carrier.com/index.php?/lickshot/" target="_blank">http://www.no-carrier.com/index.php?/lickshot/</a></p><p>it seems pretty easy to understand and i was able to get it working in my program just fine. but here&#039;s my problem. no carrier&#039;s code starts off by writing #$00 to $4015. this ends up muting whatever other audio i have going on in my program at that point. </p><p>i was working on a simple program where the buttons of the first player controller would play chords and single notes on the pulse and triangle channels, while the buttons of the second player controller would play drum sounds on the noise and dpcm channels. so, if the first player wants to hold a note out for an extended period of time, it gets silenced whenever the second player triggers one of the samples.</p><p>i was wondering what you&#039;d suggest in this instance. i&#039;m probably missing something extremely obvious. thanks for the help in advance!</p>]]></description>
			<pubDate>Sun, 30 Jan 2011 07:31:12 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/52809/#p52809</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/51540/#p51540</link>
			<description><![CDATA[<b><i>nickmaynard says:</i></b><div class="quotebox"><cite>neilbaldwin wrote:</cite><blockquote><p>Looks like you&#039;ve got a grasp of it <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Reading and writing to the .sav file is pretty straightforward. One of the big advantages of using them is that it massively expands the available RAM. You can treat it like all the other RAM in the NES - just remember that any variables you put in there will be restored to the last saved value, unlike &#039;normal&#039; RAM which is volatile.</p></blockquote></div><p>woo! next step - adding this feature to my music programs. <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<pubDate>Mon, 17 Jan 2011 00:43:51 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/51540/#p51540</guid>
		</item>
		<item>
			<title><![CDATA[Re: NES Audio Programming]]></title>
			<link>https://chipmusic.org/forums/post/51536/#p51536</link>
			<description><![CDATA[<b><i>neilbaldwin says:</i></b><p>Looks like you&#039;ve got a grasp of it <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Reading and writing to the .sav file is pretty straightforward. One of the big advantages of using them is that it massively expands the available RAM. You can treat it like all the other RAM in the NES - just remember that any variables you put in there will be restored to the last saved value, unlike &#039;normal&#039; RAM which is volatile.</p>]]></description>
			<pubDate>Mon, 17 Jan 2011 00:23:06 +0000</pubDate>
			<guid>https://chipmusic.org/forums/post/51536/#p51536</guid>
		</item>
	</channel>
</rss>
