Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > Question about Triangle Owner: CoolCockatiel New post
Page 1 of 1 Sort:  
Question about Triangle Posted: 2013-07-12 01:15 Reply | Quote
CoolCockatiel

Avatar

Member for: 3507 days
Location: Cockatielia
Status: Offline

#49259
I'm just curious about why the Triangle channel can be only 15 (F) or 0. Reply as descriptive as you want.

Posted: 2013-07-12 01:32 Reply | Quote
jrlepage
Moderator

Avatar

Member for: 4983 days
Location: Canada
Status: Offline

#49263
Because that's how the 2A03 was designed.

/thread

_______________________
Follow me on [url=https://twitter.com/jrlepage2a03]Twitter.
I record (some) NSFs on hardware. Feel free to [url=http://www.famitracker.com/forum/posts.php?id=3633]request a hardware render.
Posted: 2013-07-12 13:11 Reply | Quote
FamiPunk221



Member for: 3530 days
Status: Offline

#49276
[quote=jrlepage]Because that's how the 2A03 was designed.[/quote]

I would say that too but: The Triangle has no Volume envlope (only F and 0).

Posted: 2013-07-12 14:21 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#49279
One reason is that it's not easy to create triangle waves with controllable volume, compared to pulse or noise waves where it's inherently simple.

For triangle waves, it would be necessary do a multiplication or have a large lookup table to control the volume, which there clearly wasn't room for since the APU shared die with the CPU.

_______________________
Programmer and developer
Posted: 2013-07-12 19:54 Reply | Quote
furrykef

Avatar

Member for: 5189 days
Status: Offline

#49283
The NES triangle wave channel is actually a modified square channel. As you should know, the square channels have only 16 levels of volume. What the triangle channel does to get the triangle waveform is rapidly modulate this volume level so that the waveform slopes up and down. Since the channel's volume function is tied up in doing this, it isn't available for making the sound louder or quieter.


Posted: 2013-07-12 20:22  (Last Edited: 2013-07-12 20:24) Reply | Quote
Im_a_Track_Man

Avatar

Member for: 4137 days
Location: Plantation, Florida
Status: Offline

#49284
Fun Fact: on early revisions of the 2A03, (and rarely on some later ones), pin 30 is a test pin and one of the features is (EDIT: CRUDE) triangle "volume control" (PCM style).

[url=http://chipmusic.org/forums/topic/7011/oh-2a0x-what-other-secrets-do-you-hide/]link 1

[url=http://forums.nesdev.com/viewtopic.php?f=6&t=8868&start=15]link 2

_______________________
[BURNING LOVE]
[url=http://www.youtube.com/user/ImATrackMan]YouTube
[url=https://twitter.com/ImATrackMan]Twitter (Stay off my lawn, kids)
Posted: 2013-07-12 21:13 Reply | Quote
FamiPunk221



Member for: 3530 days
Status: Offline

#49286
[quote=] In laymans terms, it allows for 4-bit PCM on the triangle channel.[/quote]
Aww man! Why they do that to us!
But PCM on Triangle using 16 volume steps.
Nah we should 'rape' the DPCM with 7-Bit Samples.

Posted: 2013-07-13 00:18  (Last Edited: 2013-07-13 00:20) Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#49291
That's all revisions, so far as I understand, IaTM. What's your source for it being specific revisions? (I thought there was only one very early revision to the mask, to fix periodic noise.) Also it's a phase control for triangle, not volume, and outputting PCM on it would only be an academic exercise, not useful for much in particular. You can output 4-bit PCM on the squares already, without having to mod your NES.

Anyhow, it comes down to a number of issues. To digitally accomplish volume control, you need to multiply the signal by the volume, and the fine ability to control that output is dependent on the bits in your DAC. Multiplying digitally is not a trivial operation; often an analog operation like PWM is used instead, but not in the 2A03, it's all digital.

The square waves are just a 1 bit signal to start with, so its volume control is very simple, it either sends 0 or the volume to the DAC. It's a 5-bit DAC that just adds the two square channels. (Two 4-bit squares add together to make a 5-bit signal.)

The triangle, however, is a 4-bit signal to start with. If you wanted to control its volume digitally, you'd need a true multiplier, a wider DAC, or possible you'd need to put it on its own DAC fed through a PWM volume modulator, etc. this gets a bit complicated.

Posted: 2013-07-13 00:48 Reply | Quote
Xyz_39808

Avatar

Member for: 4180 days
Location: South Texas
Status: Offline

#49292
Do both APU1 and APU2 use the same DAC? Also, where does Zxx fit into all of this?

Posted: 2013-07-13 01:59 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#49294
The two squares together share a 5-bit DAC.

The triangle, noise, and DPCM unit share an output, I'm not sure how they are specifically combined, though. There's a funky formula for how they interact.

Posted: 2013-07-14 00:51 Reply | Quote
CoolCockatiel

Avatar

Member for: 3507 days
Location: Cockatielia
Status: Offline

#49343
Okay, thanks.

Posted: 2013-07-14 02:29  (Last Edited: 2013-07-14 02:30) Reply | Quote
za909

Avatar

Member for: 3962 days
Location: Hungary
Status: Offline

#49346
[quote=rainwarrior]The two squares together share a 5-bit DAC.

The triangle, noise, and DPCM unit share an output, I'm not sure how they are specifically combined, though. There's a funky formula for how they interact.[/quote]

Actually this reminded me of some interesting thing I heard long ago... is it possible to get expansion audio on a stock NES by taking the samples from the expansion chip and writing to $4011 in RAW PCM fashion? MMC5 should work this way... actually, FDS as well. VRC6, I'm not sure, I don't know the bit-depth of the final output signal...

/hijack

_______________________
Rectangular sh*t ©
Posted: 2013-07-14 04:33 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#49348
No, not really. The CPU would be tied up constantly writing $4011 and you wouldn't be able to do much else.

Posted: 2013-07-14 07:28 Reply | Quote
furrykef

Avatar

Member for: 5189 days
Status: Offline

#49362
If you design a custom expansion chip of your own, one that's designed to make it easy to pull samples from the chip and poke them into $4011, you can do it this way at somewhere around 8 kHz using about 20% of the CPU (IIRC). The way this is done is using the instruction "INC $4011". The idea is you design the mapper so that a read from $4011 will fetch the sample off the chip and immediately write back to $4011, all in six cycles. (Due to the way the NES works, the read will go to the cartridge, but the write will go to the APU.) Though since it is an INC instruction, you may want the chip to produce a decremented sample, so that the INC will re-increment it to the correct value.


Page 1 of 1 Sort: