APU: volume and... envelope? ^^;;;

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

User avatar
Banshaku
Posts: 2393
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: APU: volume and... envelope? ^^;;;

Post by Banshaku » Sat Mar 23, 2019 7:22 pm

Technically, if you buffer all the values before they are sent to the registers, you could do all kind of effects on it (this is how the famitracker/famitone combo work, famitone is added after famitracker song is done).

User avatar
rainwarrior
Posts: 7841
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: APU: volume and... envelope? ^^;;;

Post by rainwarrior » Sat Mar 23, 2019 7:46 pm

Some Sunsoft games used short triangle bursts like za909 posted. The croaking frogs in Gimmick!, or some sound effects in Fester's Quest, etc. I think Metroid also used it for the "bubble" sound in the Tourian area music.

It's not very common, though. Famitracker never supported it (though I dunno about the 0CC forks).
Pokun wrote:Yeah I think it might be a good idea to add commands to a sound engine that allows the composer to change some registers arbitrarily in order to allow some advanced stuff not normally allowed by the sound data format.
I think PPMCK/MML allowed this kind of thing.

Pokun
Posts: 1512
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: APU: volume and... envelope? ^^;;;

Post by Pokun » Sun Mar 24, 2019 1:35 pm

Yeah I think PPMCK even allows the composer to program their own assembly routines in order to do stuff not allowed by the MML.

And yeah buffering the APU registers is very useful anyhow to minimize writes to them to once per frame. Nerdy Nights teaches that too.

tepples
Posts: 22054
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: APU: volume and... envelope? ^^;;;

Post by tepples » Sun Mar 24, 2019 2:23 pm

I guess it's a question of whether to buffer all four channels before writing any or to calculate each channel to a buffer, write out the buffer, and proceed to the next channel. I don't know how other drivers work, but Pently does the latter, placing the buffer in three bytes of zero page.

User avatar
Banshaku
Posts: 2393
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: APU: volume and... envelope? ^^;;;

Post by Banshaku » Sun Mar 24, 2019 5:21 pm

Famitracker doesn't buffer them in the original driver: it was only done in the famitracker/famitone sfx combo to allow famitone to overwrite a channel when sfx are required, thus mixing them.

User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 508
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: APU: volume and... envelope? ^^;;;

Post by Jarhmander » Tue Mar 26, 2019 5:45 am

rainwarrior wrote:Some Sunsoft games used short triangle bursts like za909 posted. The croaking frogs in Gimmick!, or some sound effects in Fester's Quest, etc. I think Metroid also used it for the "bubble" sound in the Tourian area music.

It's not very common, though. Famitracker never supported it (though I dunno about the 0CC forks).
Pokun wrote:Yeah I think it might be a good idea to add commands to a sound engine that allows the composer to change some registers arbitrarily in order to allow some advanced stuff not normally allowed by the sound data format.
I think PPMCK/MML allowed this kind of thing.
Yes It allows that. It's the y command. You can poke a value anywhere, you can even crash the sound engine if you want.

10 years ago (holy crap, really?), I did an example of a croaking sound in MML. What's funny is that I had to make the y command in the noise channel, because this channel is processed after the triangle channel and it allows me to override what was written into $4008.

Neil Baldwin made something interesting with buffered writes to the APU (again, 10 years ago!): putting into a ring buffer, and using that ring buffer as an echo buffer. It makes very realistic one-channel echos. http://dutycyclegenerator.com/#EchoDemo
((λ (x) (x x)) (λ (x) (x x)))

Post Reply