Castlevania Dungeon Forums

The Castlevania Dungeon Forums => General Castlevania Discussion => Topic started by: TheouAegis on August 16, 2022, 10:14:03 PM

Title: So I kinda cracked CV3's music programming
Post by: TheouAegis on August 16, 2022, 10:14:03 PM
I'm partly just giving up because I've been working on it for so many days now, but I'm also genuinely satisfied with what I came up with.

First thing's first: I mapped out - I'm pretty sure - every variable used in Akumajou Densetsu's audio engine. You can find it on the Data Crystal wiki over at RomHacking. I don't know yet what changes to the audio engine were made for Castlevania 3, but I didn't really care about that right now.

As it turns out, the audio engine was more extensive than I had anticipated. I'm not sure how it compares to other games on the Famicom or NES, but I certainly wasn't anticipating al segno, coda, ritenuto, or a couple other musical terms I've long since forgotten since I was last in school. I mean, they weren't called that explicitly, but my brief refresher on musical terminology lead me to those terms.

Notes could be encapsulated inside a volume envelope or pitch envelope. Envelopes could be loaded once and disabled when not wanted. There was even some sort of note sustaining going on - as in one note would stop and a previous note would play in its stead. Yeah, it was pretty complex! Because of all this, some notes could be defined by 1 byte, while others required 5, 7, or even 9 bytes to define!

There was no Triangle Wave channel. The standard Square Wave channels were hardly audible at times, even with other audio channels disabled. Disabling the wave channels allowed me to really enjoy the DPCM drum kit, but I didn't really look too deep into the drum stuff or the sound effects.

Anyway, I know that none of this is interesting to 99% of the people out there, but it was just a hobby I took up in recent weeks. I don't plan on actually modifying CV3/AkuDen music myself, but maybe someone else out there could use this.

https://gmvania.blogspot.com/2022/08/cv3-audio-system-notes.html
(click to show/hide)
Title: Re: So I kinda cracked CV3's music programming
Post by: TheouAegis on August 19, 2022, 11:09:41 PM
Update: I added Castlevania 3 (U) audio mappings to the RAM Tables on Data Crystal (https://datacrystal.romhacking.net/wiki/Castlevania_III:RAM_map). Sorry, no programming tips for Castlevania 3, although I don't think very much changed between CV3j and CV3u. The Triangle channel required some new code to be added in and a couple new variables were also added, which meant I had to spend all morning trying to figure out how Konami coded the Triangle channel. Two of the new variables were devoted entirely to cutting a triangle note off 1 frame earlier than normal. And I thought I had problems with micro-optimization! Still, I suspect my notes from the previous post still hold even for the Triangle channel.

Yet another unproductive day; but I spent some time ;) with my wife, cracked CV3u's audio, and mapped out a bunch of variables I had overlooked before. All in all, it was a far cry from my least productive day.  :)
Title: Re: So I kinda cracked CV3's music programming
Post by: mercurius on August 23, 2022, 12:24:45 PM
I should say that this is some wonderful and interesting stuff. I wish you could continue with this.
Title: Re: So I kinda cracked CV3's music programming
Post by: X on August 23, 2022, 05:38:55 PM
Most likely TheouAegis will continue on. I've not seen him quite on these things, just take a bit of a break every now and then.