Banner
The Old-School Level Design Contest ends in
9 DAYS, 4 HOURS, 45 MINUTES AND 12 SECONDS
Views: 892,430,961
Time:
12 users online: 7 up, BOB66, Devazure, DJLocks, dogemaster, Isikoro, Jead, JonnyManjiro, NerDose, pat94plus, Sammmoo, Zareption - Guests: 39 - Bots: 121 Users: 50,066 (2,328 active)
Latest: frippami
Tip: Avoid "item babysitting". Do not force the player to drag P-Switches or springboards all around the level. This is not fun, nor does it make for interesting "puzzles".
Not logged in.
Addmusic bugs (discussion - what are they and how do we work around and/or fix them?)
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Addmusic bugs (discussion - what are they and how do we work around and/or fix them?)
Pages: « 1 2 » Link
I'm sure I'm not the only one who is becoming increasingly aware of the flaws with all of our current Addmusic programs. They all crash the sound in certain situations, mess it up, can't be used with third-party program X, etc., etc. It sucks. The questions is, though, what do we do about it? We can wait for the makers of AddmusicM to fix the bugs it has or we can create an entirely new Addmusic, but in either case, we have to just deal with the bugs in the meantime.

So, I would like to make a list of as many things as we can find, what does and does not mess things up, so we can keep them in mind. I would also like to stimulate some discussion for this.

This is my list thus far. If I made any errors, please tell me. Note that in this context, "work correctly" is assumed to mean "work correctly on bsnes/a real SNES", and "you can/cannot" is assumed to mean "this will/will not work correctly", unless otherwise specified. I will add to this list any information offered, and I will correct anything that I am mistaken about if a correction is offered.

1) You cannot set the echo delay value ($XX in $F1 $XX $YY $ZZ) higher than $04 unless using AddmusicM, in which case the maximum value is allowed to vary depending on how much space the samples in the song using it require.
2) You cannot use both custom sound effects (-se option in Romi's Addmusic) and Carol's MORE.bin, even on less accurate emulators such as ZSNES.
3) You cannot use custom sound effects if you plan to use echo at all.
4) Sample Tool does function correctly, including Carol's MORE.bin/$E5 samples.
5) Echo can be used, but when going from a song with echo to one without, the latter must begin with $F0 or it will constantly play grating noises caused by residual sound data in the echo buffer.
6) However, you cannot use echo with Carol's MORE.bin.
7) AddmusicM/.brr/$F3 samples work.
8) Sound effects (normal ones, not custom) sometimes glitch in AddmusicM, unless all percussion instruments @21+ are placed on non-sound effect channels (#0, #1, #2, #3, or #5).
AddmusicM fixes most all of those or has alternatives (except sound effects, sorry :P ). Also, I recently found a workaround for the sound effect glitch with it: Using percussion instruments (@21+) on channels #4, #6, or #7 is what makes sound effects go haywire. Not sure yet if this is related to the misc music glitches.
Okay. I added that to the list.
Good find, Kaijyuu. This may be annoying for certain songs (since often percussion channels are the channels where interrupts by sound effects aren't that intense), but at least it's already a possible workaround for the problem.

--------------------
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Are you positive you can't use any custom sound effects in bsnes? I thought they were usable so long as you don't ever use anything with echo, because the echo buffer will be identical to free ARAM until you do. And thank god you listed number 5, that is probably the most rampant and least understood sound bug of all. I'm not sure if just #F0 will work. You might have to not only turn the echo off but also turn the echo left and echo right volumes both to 0.
Originally posted by Kil
Are you positive you can't use any custom sound effects in bsnes? I thought they were usable so long as you don't ever use anything with echo, because the echo buffer will be identical to free ARAM until you do.

Hm...now that you mention it, I guess I'm not entirely sure. I'd test it now, but I don't have my headphones with me. If they are usable, I'd go with that instead of the echo and all the problems it causes. (Most of the music I compose for my hack will probably require around 6 channels, and I can use any leftover channels as echo if necessary.) I'd probably want to replace a couple of the default samples (ones that I'd never or rarely use, such as sample 7), though.

Originally posted by Kil
I'm not sure if just $F0 will work. You might have to not only turn the echo off but also turn the echo left and echo right volumes both to 0.

As in $EF $00 $00 $00? Yeah, again, not sure on that, and I'd have to test it. Hmm...

Edit: All right, it seems that custom sound effects work fine even in bsnes as long as the music playing has no echo. Huh. Now if only they worked with Carol's MORE.bin...

Edit 2: In fact, doesn't that apply to echo as well? I mean, isn't it impossible to use echo in combination with Carol's MORE.bin?
Okay, this just in: Apparently, you can use echo with Carol's MORE.bin, but only in certain cases. Slash Man found this out, and neither of us seems to know exactly when it does or doesn't work. Could anyone else maybe shed some light on this?

Also, is AddmusicM supposed to have custom sound effect support? I haven't really heard anything about it, but there are rumors...and that mysterious file "SESupport.bin".
You know, come to think of it, why does Carol's MORE.bin need to overwrite the echo buffer in the first place? According to this diagram:



There are almost 0x8000 bytes' worth of space for sample data, and if you replace the original sample bank with the optimized version, that leaves over 0x4000 bytes for extra samples. Unless Carol's MORE.bin is putting code in that space (and according to that diagram, there should also be some free space from ~$1400 to $26FF), why wouldn't it be possible to simply let it insert samples at ARAM $BC00 or something?

Also, my previous post still stands.
There's nothing stopping you from moving the samples down to BC00. If you move stuff away from $6000 all version of addmusic will work fine with echo.
Originally posted by Slash Man (from another thread)
I don't know if this is noted anywhere. Some people probably already know.

Ok so I was testing out my DKC ports that use echo and $E5 and I found out something interesting. I was testing them on BSNES, the level music plays perfectly fine without complications and once you hit the goal tape, the game breaks. This is where I was messing around ingame though. I grabbed a P-Switch and hit the goal tape, the goal music died but the SFX continued, it then led me back to the overworld map and the music was playing yet again. Is it the echo difference in the goal music that kills it or is it something I'm not getting?


Maybe someone can try to work around that? I'm not entirely sure.

--------------------
I think a post layout goes here somewhere...
Okay, I have some bad news. Apparently, MORE.bin itself breaks on accurate emulators, regardless of whether any of its functions are used or not. I'm not sure if this is definitely true or not, but if it is...well, then, we really, and I mean REALLY, need to fix it. Not being able to use ADSR would severely reduce the quality of custom music, in some cases to the point where it wouldn't even be worth using. No echo is bad enough, but no ADSR? Why don't you just give me a paper cut and pour lemon juice in it?

And while I'm here, does anyone have any idea what AddmusicM's sound effect thing is and how to use it? The poor documentation we have says something about channels #9-#12 being used for SFX, but I don't see any way to insert them (as nice as being able to use custom sound effects in AMM would be...). In fact, I wish we had more documentation for AddmusicM in general.

I wish we could get a good SPC-700 project of some kind going, I really do...SPC-700 assembly isn't any more difficult than regular ASM in my opinion, or at least, it doesn't seem so. The problem is actually doing stuff with it.
I don't know what's wrong with MORE.bin, but as far as I know the only issue in AddmusicM (aside from no sound effects) is that data transfer between the SPC and the SNES CPU doesn't always work correctly. If we could just fix that then we'd have the ideal music tool, I think, since it is actually really flexible. I can't imagine adding custom sound effects to be too hard (you'd probably just have to expand a table somewhere) and you can define your own commands, which has amazing potential.
I should get a new layout.

Probably won't, though.
Originally posted by Kipernal
as far as I know the only issue in AddmusicM (aside from no sound effects) is that data transfer between the SPC and the SNES CPU doesn't always work correctly.

Is that what causes the bug with channels #4, #6, and #7 when they are used for percussion? Weren't there a couple of other specific bugs, probably stemming from what you said? I suppose the custom misc. music and having to fade one song out before changing to another would also fall under that category?

Originally posted by Kipernal
If we could just fix that then we'd have the ideal music tool, I think, since it is actually really flexible. I can't imagine adding custom sound effects to be too hard (you'd probably just have to expand a table somewhere)

Flexible, yes, but until it can insert custom sound effects, it's not flexible enough for me. And...not too hard? You'd have to edit the source code to allocate a place for them so that they wouldn't conflict with music, echo, or sample data.

Originally posted by Kipernal
and you can define your own commands, which has amazing potential.

You mean $F6 and $F7? That's not what I'd really consider defining your own commands, and I don't see how else you could do it without editing the source code (AddmusicM and/or the actual SPC-700 assembly). I will admit that it was an excellent idea having those in there, though.
Originally posted by imamelia
Is that what causes the bug with channels #4, #6, and #7 when they are used for percussion? Weren't there a couple of other specific bugs, probably stemming from what you said? I suppose the custom misc. music and having to fade one song out before changing to another would also fall under that category?


The latter issue is more what I'm talking about. I'm not sure exactly what happens, but quickly switching songs seems to be something of a problem for it...I think in trying to do the data transfer so quickly some things get messed up.

Though in regards to the former, it seems like that bug is just caused by AddmusicM switching instruments when a sound effect is playing. It successfully stops the music temporarily, but it doesn't stop any instrument switching. If someone could dig into the source code it should be as simple as saving the instrument into some spare ARAM address and then recovering it once the sound effect has finished.

Originally posted by imamelia
Flexible, yes, but until it can insert custom sound effects, it's not flexible enough for me. And...not too hard? You'd have to edit the source code to allocate a place for them so that they wouldn't conflict with music, echo, or sample data.


I could've sworn I heard someone saying that custom sound effects would be relatively trivial compared to other things. In Kil's SPC hacking guide there's an ARAM map that shows the sound effects table and where the actual sound effects are stored (though I don't know if they're in different locations after AddmusicM's done with the ROM). If you were willing to sacrifice some sound effects you could probably remove them to add room and not have to mess around with echo and sample data locations.

Originally posted by imamelia
You mean $F6 and $F7? That's not what I'd really consider defining your own commands, and I don't see how else you could do it without editing the source code (AddmusicM and/or the actual SPC-700 assembly). I will admit that it was an excellent idea having those in there, though.


Though $F6 and $F7 may as well be considered as defining your own commands with how much you can do with them, I am talking about editing the source code. In theory all you need to do is modify source.asm, compile it with spcas, and repatch INIT.asm to your ROM.
I should get a new layout.

Probably won't, though.
Originally posted by imamelia
And while I'm here, does anyone have any idea what AddmusicM's sound effect thing is and how to use it? The poor documentation we have says something about channels #9-#12 being used for SFX, but I don't see any way to insert them (as nice as being able to use custom sound effects in AMM would be...). In fact, I wish we had more documentation for AddmusicM in general.


I've played around a bit with that. It seems writing certain values to $1DF9 ($2C to $2F) and $1DFC ($60 to $63) enables some kind of effects on the music. My unexperienced ears didn't really hear a difference, though. At least I'd go as far as to say the term "channels" is totally misused here, as no channels seem to be added. They don't even seem to be related to custom sound effects. I think the translation was just done badly and what it meant in commands.txt was something like "AddmusicM provides a few special affects which can be activated by writing custom values to the sound effect banks".

Or wait... I just read the "unique to mml" in brackets. Maybe what it meant was something like this: If you write the specified values to the sound effect banks, you can use channels #9 to #12 inside your MML files? Man, this is so confusing.

EDIT:
Hey, good news! Seems like I solved the mystery (or at least somewhat). First I took a custom music and placed

Code
#9
o4d


in it. Then I made that music play in a level. Next I looked for the spin jump sound in all.log and replaced it like this:

Code
org $00D649		; Spin jump
	lda #$60
	sta $1DFC


The result: Each time I spin jumped in that level it played the sound effect defined above in bank $1DFC.

The only problems so far:
1. Custom sound effects only work with the music they were defined in.
2. You can only have up to four custom sound effects per level (channels #9 to #12 each represents one).
3. Getting the same sound effects into all levels would be kind of annoying since you had to copy them over to each music file.
4. It always used the sample that ways played last in that bank. This is probably because I didn't define a sample for channel #9 since I didn't know how to.

Also there are a few commands that don't work with #9 to #12, like @XX or vXXX.

I guess we're a big step closer to solving this mystery. If someone knows how to define samples for those four channels I guess it could at least be useful to have a few custom sound effects for bosses or something like that.

EDIT:
Also this is probably the only way to get proper custom sound effects in BSNES so far.

--------------------
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
Hm...interesting. What if you put a really long "sound effect" in one of those channels, as long as the actual song? Does it always start from the beginning of the channel? If it doesn't, that could definitely make for some interesting effects (what is it that everyone always says about Banjo-Tooie, or whatever game it was that changes instruments when you're in water and stuff?). If it does, though, I don't see that as being very useful. Only four custom sound effects = sorry, not good enough. I stand by what I said about editing the source code of AddmusicM and the source to enable true custom SFX insertion (like Romi's -se option).
So far it seems to be only for custom sound effects, but feel free to experiment more with it.

--------------------
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
I found a way to convert the Japanese garbage that Notepad displays (ƒŠƒZƒbƒgŽž‚ɏd—v‚) into actual Japanese. So I ran that through a translator and got some really interesting stuff, like the modified ARAM map and documentation of some of the functions!

I translated the readme, the commands list, source.txt and source.asm. Note that in source.txt and source.asm, anywhere you see a translation followed by (alternative translation?) it just means that Google gave two possible translations and I'm showing them both. Also, I haven't yet done INIT.asm, but that will be what I do next.

Even though a lot of it is a bit redundant since we already have translations of part of the readme and commands.txt, there are some things in both of those files that are worth looking into. And that ARAM map I mentioned earlier can be found in source.asm.
I should get a new layout.

Probably won't, though.
I love how it translates "sample" as "waveform".

Also the easiest way to open up Shift_JIS textfiles on any computer is Firefox.

--------------------
Feel free to visit my website/blog - it's updated rarely, but it looks pretty cool!
I was wondering, can you even use sample tool requiring song (as in .bnks) with addmusicM.

--------------------
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
Pages: « 1 2 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - Addmusic bugs (discussion - what are they and how do we work around and/or fix them?)

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks