Language…
5 users online: crm0622,  NinCollin, schema_tuna, unaffiliated, Zatara - Guests: 94 - Bots: 194
Users: 64,667 (2,403 active)
Latest user: DarthHylian

AddMusicKFF - A fork of AddMusicK

ToolMusicSuper Mario World

  • Pages:
  • 1
  • 2
Hello, everybody! This is KungFuFurby, SNES musician, and I've been working on what I technically call a fork of AddMusicK, called AddMusicKFF. I've been low-key about this (I've been more active on this utensil on the SNESLab Discord servers than the SMWCentral Discord servers, actually), and this is certainly a WIP, but I'm going to debut it on the forums for the Winter 2021 C3.

To be continued in the Resource & Tool Releases Forum



What is AddMusicKFF?


AddMusicKFF is a fork of AddMusicK by Kipernal. I'm not bumping the version number unlike the others due to me having seen two past cases of doing so, and me admittedly realizing that I don't want to join the conflict myself. Plus, I'm intending on maintaining backward compatibility with the older Addmusics.
This actually originated when I created a slowdown fix for AddMusicK for Super Mario All-Stars + Super Mario World that got officially implemented in the standalone version on Super Mario World, debuting on 1.0.7. I also implemented fades to any volume for compatibility for Super Mario All-Stars and the original ID is backward compatible with Super Mario World (that hasn't been ported over yet partially because on the 65816 end, I introduce a conflict past 128 songs, and partially because that code can be improved somewhat by utilizing unused memory locations).

What have you already done?


Merged in
  • Fixed a softlock bug caused by readahead trying to go past 256 bytes. From a technical standpoint, I forced the Y register to zero, and instead incremented the pointer itself.
  • Lots of fixes related to arpeggio:
    • Failure to use indexed storages, particularly with the type ID, was causing various malfunctions on all channels except the first (#0).
    • Don't key on notes immediately by using the KON register: the sound driver can do that for you, meaning I utilize the sound driver's internal key on queue, so to speak. Plus, it causes a double key on by mistake. (Thanks to musicalman for catching this bug!)
    • CPUIO1 (referring to SNES-side memory location $2141 and SPC700-side memory location $F5) sound effects (referring to command IDs $01 and $04) were causing the arpeggio to stop playing completely due to the memory locations being zeroed out.
  • Updated the internal changelog HTML file to reflect version 1.0.8.
  • Performed a cleanup of SFX data to remove unused generated bytes. Most were related to generating redundant zero bytes, but in two cases, the data was not properly edited, and thus contained duplicate data from somewhere else. Plus, for the jump SFX, I removed a redundant volume byte, since both left and right values were the same.
  • Implemented exact tick length support and dotted notes for the default note length (l) directive. (Special thanks for Masterlink for suggesting the dotted note portion and Exodust for adding it to the Github repository's list) I was also asked to do ties, but I decided against doing so due to a conflict with the actual sound driver's tie command (referring to $C6).
    • Implemented dotted notes with exact tick lengths (grouped with the l directive exact tick additions).


Not merged in (available in a pull request)
  • Have readahead look inside subroutines and loop sections. This ensure that long chains of subroutines don't cause a long series of bytes being read before finally finding a note or tie command that is well past what was expected to be read, and may or may not key off the note as intended. It hasn't been merged in yet due to me not knowing what songs on the site have attempted to take advantage of that particular bug.
  • Having an arpeggio play while a rest commmand is supposed to be active felt a bit unnatural to me, so I added in some code so that there can be a gap. Interestingly, this was technically noted in the commentary. The arpeggio will also start right back up when you play the next note. I'm not certain if anyone has attempted to utilize this particular bug yet...
  • Pitch slide to note commands (referring to the $DD command) failed to account for per-channel transposition. (Thanks to musicalman for catching this bug!) Again, I have no idea if anyone was utilizing this bug.
  • New accurate versions of the jump SFX (CPUIO1 SFX ID $01) and what I have dubbed the new grinder click 2 SFX (CPUIO1 SFX ID $02). I'm wondering if I should go through with an outright replacement of the jump SFX... hence why it's currently not merged in.
    Update 1/10/21: Added old jump SFX as Jump (alt), at  Kevin and Anas's suggestion.
  • A bunch of new VCMDs, albeit a bit more mundane for now...
    • $F4 $0A - SMW Velocity Table
    • $F4 $0B - Pitch Modulation Toggle
    • $F4 $0C - Yoshi Drums On
    • $F4 $0D - Yoshi Drums Off
    • $F4 $0E - Echo On
    • $F4 $0F - Echo Off
    • $F4 $10 - Pitch Modulation On
    • $F4 $11 - Pitch Modulation Off
    • $F4 $12 - Legato On
    • $F4 $13 - Legato Off
    • $F4 $14 - Light Staccato On
    • $F4 $15 - Light Staccato Off

    For those of you wondering why I added these, except for Pitch Modulation (which had no toggle, so I added it on myself), all of these were previously only available in toggle form (except for Velocity table, which wasn't actually a toggle per se as setting a fixed value, so I added its inverse). That meant that you could switch them back and forth between on and off every time the VCMD triggers, but not actually force them to a value.

    • $F4 $16 - SNES Sync Toggle (No Reset)
    • $F4 $17 - SNES Sync On (With Counter Reset)
    • $F4 $18 - SNES Sync Off (With Counter Reset)
    • $F4 $19 - SNES Sync Pause
    • $F4 $1A - SNES Sync Resume
    • $F4 $1B - SNES Sync Reset
    • $F4 $1C - SNES Sync Increment

    Sync is also only available in toggle form, and its default behavior is to reset the counter every time it is initialized. Thus, I came up with these commands to give some more control.


Other
  • Compiled a list of all memory locations prior to the actual SPC700 program (mostly referring to $0000-$0500) used in both the original sound driver and Addmusics, past and present. Special thanks goes to Masterlink for providing some archival Addmusic versions (particularly the beta AddMusicK versions) and an example of the special wave feature used in AddMusicM.


What are you planning to do?


  • Add actual phrase support. I recorded my proposal on how to implement it here.
  • Bring back the special wave from AddMusicM! I'm still working out how to do this, because this is going to require a sample slot to be allocated in the directory, and thus requires a C++-side modification.
  • SFX priority, done as a VCMD exclusively for SFX. The original game had a few pieces of SFX that I documented that could not be interrupted until they finished playing.
  • Get pitch envelope delays working for SFX. I found out they were completely non-functional in both the original and AddMusicK, which makes one of the bytes in the pitch envelope VCMDs in the SFX (referring to VCMD IDs $DD and $EB) essentially do nothing.
  • Consolidate the two jump SFX instances into one pointer-wise. Due to being in two different collections, this requires that I modify the C++ code.
  • Add music/song groups. Just have to work this one out to ensure that they all load correctly and make sure that the same song in multiple groups can be handled properly. (Thanks  imamelia for the request!)
  • Plenty more... just got to figure out which ones to go for.


What quirks/possible bugs do you know about?


  • The readahead code, when accounting for subroutines and loop sections, has exposed a potential conflict between the instrument set command, the rest command, and the type 3 remote control event due to a failure to fire the KOFF register. Namely, $DA ?? $C7 with remote control event type 3 active causes remote control event type 3 to fire, followed one tempo tick afterwards by the instrument setup routine. Unusual... I have determined that without the type 3 remote control event factoring in that this is done by design, since normally the KOFF register fires first when the rest goes off, thus allowing for a better transition to the next instrument. (Thanks Masterlink for providing me with an example)


What bugs do you know about and are planning to fix?


  • CPUIO0's (referring to SNES-side memory location $2140 and SPC700-side memory location $F4) and CPUIO3's (referring to SNES-side memory location $2143 and SPC700-side memory location $F7) sound effects are failing to properly play their pitch envelopes when an arpeggio is playing in the same channel.
  • CPUIO1's (referring to SNES-side memory location $2141 and SPC700-side memory location $F5) sound effects (referring to command IDs $01 and $04) wrecking havoc in general, even more so than CPUIO0's (referring to SNES-side memory location $2140 and SPC700-side memory location $F4) sound effects and CPUIO3's (referring to SNES-side memory location $2143 and SPC700-side memory location $F7) sound effects. The instrument ID is not even properly restored unlike the other cases!
  • SPC dumps of noise SFX generated by AddMusicK don't actually function because they fail to set the noise frequency for some unusual reason.
  • The ADSR/GAIN commands (referring to VCMDs $ED and $FA $01) have an unexpected side effect due to the ordering of the writes of DSP registers. This mainly involves having the previous gain value being a fixed volume set value, but there are other side effects.


Do you have compiled binaries?


You can find the latest compiled binary for Windows here. (Thanks  Atari2.0!)



View the project here on Github



Note that I recommend updating Asar to version 1.71.

The makefile was adapted from HertzDevil's fork of AddMusicK, since one didn't exist before. I'll also admit I am utilizing the AM405Remover from that fork as well, but only on my own local copy: I've left the original as-is in the repository.

This looks very exciting to hear! I can't wait to see more of the stuff in the near future. Keep up!

P.S.: I don't want to use the stupid Surprised Pikachu image after all. It's too mainstream!
The Hacking of PuyoPuyo. Come join the fun, friends. 『いけいけ団長、頑張れ頑張れ団長!』
Help us raise funds for the Armed Forces of Ukraine. #ДопомагаємоРазом / #HelpTogether
“Even if you personally are so dissatisfied with life that you want the world to end, surely the cruel reality is that it will continue on, unchanging. All the better for someone perfectly content, like me.”
Aya Shameimaru, Touhou Suzunaan ~ Forbidden Scrollery
Progress on tools is always exciting, and AMK definitely looks like one that could use some updating. (Sill wonder where Kipernal went; hope he's doing okay out there.)

This must be a pretty huge undertaking, so kudos for doing it!


 
i'm admittedly not too familiar with the nitty gritty of addmusic, but i really appreciate that someone is working on furthering this tool while keeping backwards compatibility in mind. i wish you the best w/ this endeavor!
I can help with compilation of the binary, if needed.
Wait, you're bringing PWM back? That saves a channel in about half of the ports I do. I love PWM ;_;
AddMusicK has grown so tiring to use. I'm glad somebody is making an effort to make it better and/or make a new tool for music insertion!
Just so you know, I'm very active on the site anymore like I was before; I'm mainly on Discord now.
Originally posted by Falconpunch
AddMusicK has grown so tiring to use. I'm glad somebody is making an effort to make it better and/or make a new tool for music insertion!


Not completely new: I'm just updating the originals.

Originally posted by Atari2.0
I can help with compilation of the binary, if needed.


Thanks! The only catch is that this is probably going to be constantly updated as I receive bug reports and apply code updates. Thus, I am uncertain of the "on demand" nature at the moment.
Originally posted by KungFuFurby
Originally posted by Falconpunch
AddMusicK has grown so tiring to use. I'm glad somebody is making an effort to make it better and/or make a new tool for music insertion!


Not completely new: I'm just updating the originals.

Originally posted by Atari2.0
I can help with compilation of the binary, if needed.


Thanks! The only catch is that this is probably going to be constantly updated as I receive bug reports and apply code updates. Thus, I am uncertain of the "on demand" nature at the moment.

Well that's unimportant, I can setup an automatic build system if needed. The GUI is super easy to compile actually, the binary aswell, I can compile the binary for both linux and windows, if need be just dm me on discord at Atari2.0#1706
YEEEEEEEEEEEEEEEEES SFX PRIORITY
NewPointless
Originally posted by Atari2.0
Originally posted by KungFuFurby

Originally posted by Atari2.0
I can help with compilation of the binary, if needed.


Thanks! The only catch is that this is probably going to be constantly updated as I receive bug reports and apply code updates. Thus, I am uncertain of the "on demand" nature at the moment.

Well that's unimportant, I can setup an automatic build system if needed. The GUI is super easy to compile actually, the binary aswell, I can compile the binary for both linux and windows, if need be just dm me on discord at Atari2.0#1706


Alright. Having an automatic build system would not be a bad idea, considering that I haven't set one up before. Just remember that I never updated the Visual Studio files... I'll go ahead and DM you on Discord.
Huh. Can we request possible additional features?

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
I'll allow requests, but I can't guarantee their implementation, if only because I've got quite the list on my end not revealed here and I have to make sure to iron out technical difficulties with the sound driver (and the conversion utensil).
I am really glad to see somebody finally care about what porter's really need. Can't wait to see it being officially released!
I saw your fork when you just made it and seems like you've already done tons of work between fixes and new features, which is pretty cool. I know of some more bugs that would be nice to have fixed (mostly regarding sound effects), so if you're interested I can PM you. Keep up the good work!

Edit: about the jump SFX, I don't see why not replacing it, but maybe also keep the old one in there if someone wishes to use that one instead, similarly to what this (unnecessary) update did.
Originally posted by KevinM
Edit: about the jump SFX, I don't see why not replacing it, but maybe also keep the old one in there if someone wishes to use that one instead, similarly to what this (unnecessary) update did.


Agree. I think the fixed one should be default though. (Also, because of how incredibly minuscule my update was, I removed it.)
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

Originally posted by Anas
Originally posted by KevinM
I saw your fork when you just made it and seems like you've already done tons of work between fixes and new features, which is pretty cool. I know of some more bugs that would be nice to have fixed (mostly regarding sound effects), so if you're interested I can PM you. Keep up the good work!

Edit: about the jump SFX, I don't see why not replacing it, but maybe also keep the old one in there if someone wishes to use that one instead, similarly to what this (unnecessary) update did.


Agree. I think the fixed one should be default though. (Also, because of how incredibly minuscule my update was, I removed it.)


Yup, I obsoleted the update in question due to my data optimizations.

Alright, I'll re-introduce the old version of the jump SFX. They'll be given new IDs, though. Also, I'm zeroing out the delay parameter (it's an 8 in the original data, and the only one that even did that) in anticipation of implementing the SFX pitch envelope delay effect, because it never worked in both the vanilla version (referring to the original SMW sound driver prior to all of the modifications) and, to my knowledge, all of the Addmusics before.

I can't help but think that the old jump SFX could, in theory, be used for Luigi if one were to make a two player hack with Mario and Luigi where the two are running around at the same time.
Originally posted by KFF
I can't help but think that the old jump SFX could, in theory, be used for Luigi if one were to make a two player hack with Mario and Luigi where the two are running around at the same time.


Now that is a very good point actually. It could even go well with this patch.
My Mode 0 guide.

My Discord server. It has a lot of archived ASM stuff, so check that out!

How much trouble would it be to make it support song grouping? You could use that to give each level theme its own miscellaneous tracks, for instance, or have seamless transitions from a boss cutscene to the boss battle.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
  • Pages:
  • 1
  • 2

ToolMusicSuper Mario World