Views: 993,083,993
11 users online:  bebn legg, CourtlyHades296, FYRE150, Heraga, Jacko, Lightning,  Major Flare, MarkVD100, MorrieTheMagpie, RetroYuuki, UTF - Guests: 78 - Bots: 130 Users: 54,459 (2,077 active)
Latest: sanskieth
Tip: If you want to remove patches from your ROM, it is best to either use the restore function, or port everything to a clean ROM.
Not logged in.
AddMusicKFF - A fork of AddMusicK (Last updated 5/17/22)
Forum Index - SMW Hacking - Resource & Tool Releases - AddMusicKFF - A fork of AddMusicK (Last updated 5/17/22)
Pages: « 1 » Link
Hello, everybody! This is KungFuFurby, SNES musician, and I've been working on what I technically call a fork of AddMusicK, called AddMusicKFF. This thread is a continuation of the Winter C3 2021 thread.

I have also made a Summer C3 2021 update thread that contains a summary of the progress made here, as well as some info on an AddmusicK 1.0.9 release candidate that was revealed there.

A second update thread was made for Winter C3 2022.

Currently I am going through the entire SMWCentral music library, partially to identify use cases for four of the bugfixes that I feel would require some remoderation (with me currently debating whether to cut any of them) as indicated in the Summer C3 thread, and partially to catch any remaining AM405 and AMM conversion bugs that were circumnavigated by editing the MML .txt files rather than the program... or, alternatively, were reported, but never repaired. Until then, the finalization of AddmusicK 1.0.9, which I was planning for shortly after Summer C3 2021, is delayed until these conversion bugs are dealt with, as I want to keep the older ports alive as intact as possible.

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.
    Updated 3/4/21: Optimized the code to utilize the ADDW opcode (thanks to a pre-zeroed Y register) for arpeggio and VCMD table, causing the overall cost of adding this fix in to go down to near, if not outright zero bytes compared to stock AddMusicK.
  • 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.
    • NEW 4/12/21: Did some minor branching location updates, which in turn removed a redudant RET opcode or two in the process due to the key on method no longer using a JMP opcode as part of a bugfix.
    • NEW 4/12/21: Fixed a bug where arpeggio was causing SFX pitch envelopes to stop in their tracks. Note processing was at fault, so the code was skipped since it wasn't going to get keyed on anyways.
  • 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.
    NEW 2/19/21: Corrected an incorrect VCMD ID in 1DF9 SFX ID $21 (Valley of Bowser appears). The VCMD ID was still defined as $FF, whereas in AddMusicK it had been redefined to $FE. This correction restores the SFX's authenticity to the vanilla game.
    NEW 2/19/21: I expanded my redundant byte removal operation to a bunch more SFX IDs. Specifically, they cover 1DF9 IDs $04-$05, $07, $0C, $0F-$10, $1D, $1F, $21, $29 and 1DFC IDs $03-$04 and $1C-$1D.
    NEW 4/22/21: With the addition of the rest VCMD in SFX, I was able to save even more bytes via getting rid of zero volume commands and redundant duration and volume values as a result of making this optimization.
  • 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).
    • Updated 10/3/21: Fixed a regression caused by factoring in triplets when calculating the default note length that then causes desynchronizations. (Thanks Pink Gold Peach for notifying me about this!)
  • NEW 1/20/21: Hex validation no longer freezes on the $DD command with an octave specified before the target note.
  • NEW 1/20/21: AMUndo.asm got an update to the sample tool data detector for compatibility with asar 1.71. (Thanks  Atari2.0 for providing the fix!)
  • NEW 1/24/21: Global songs have been tagged, optimized, shrunk, and in the case of the Bonus End song, a wrong note has been removed. (Thanks  Kevin for providing this update!)
  • MERGED 1/25/21: 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 $04).
    Updated 1/10/21: Added old jump SFX as Jump (alt), at  Kevin and Anas's suggestion.
    Updated 3/5/21: New CPUIO1 Grinder SFX replicas are now the default IDs when inserting into a Super Mario World ROM, and added an option to change them from 1DF9 to 1DFC, like the jump SFX.
    Updated 4/5/21: The replica jump SFX was off by a tick, and the tick in question was a delay in the pitch envelope. This has been implemented after adding in the pitch envelope delay in SFX, thus increasing the accuracy of the SFX.
  • NEW 2/24/21: Corrected an edge case bug accidentally introduced by my slowdown fix in the actual AddMusicK. Specifically, the SFX echo channels are supposed to be zeroed out every time the song changes. The way it's done is through a Y register storage... which, under normal circumstances, would be zero, but the way it's zeroed out is through the tick code. The slowdown fix can accidentally cause this to be non-zero, most commonly through the first channel, if a tick fires after a long time since the timer was last read.
  • NEW 2/24/21 (MERGED 2/25/21): Added SFX priority via the $E0 SFX VCMD, valid only at the very beginning of the entire SFX data. All vanilla SMW SFX (and CPUIO1 SFX ported over) have been assigned priority values to replicate vanilla SMW's SFX priority system in a less hard-coded and more customizable fashion.
    Updated 4/12/21: Replaced CPUIO1 SFX's hardcoded priority system with the standard SFX priority check due to not taking into account CPUIO3 SFX. Thus, they're also on the list of priority values assigned.
    Updated 5/22/21: Ended up commenting out the priorities of most of the stuff, and set 1DFA's priorities to zero. This is because of user expectations, meaning that AMK 1.0.8's priority system is the default. However, I have added vanilla values in case they are to be replicated... although for the jump and grinder/girder SFX, they're already a bit unnatural. For 1DFA, two user defines have been created, one for each SFX, to assign priority to each due to their hardcoded nature, with zero being the default.
  • NEW 2/25/21: SFX now properly carries over between global songs, like what vanilla SMW did. The cause for the malfunction in the first place was a zeroed out pitch base, meaning that the channel is never allocated to the music and an instrument command would cause the SFX to fire off again. This also guaranteed that the SFX would run again when restarted. To ensure that the SFX continued to properly play, the pitch base is not zeroed out if it is occupied by SFX.
    Updated 3/18/21: The method has been changed due to initially excluding CPUIO1 SFX.
  • NEW 3/17/21: SFX is no longer affected by pitch envelope VCMDs that are defined by music.
    Updated 3/18/21: The fix turned out to be incomplete for several reasons:
    1. The pitch envelope was still able to trigger if the pitch envelope VCMD was fast enough.
    2. The pitch envelope was being cleared out on SFX initialization, messing up all subsequent notes that depended on the pitch envelope still being active.
    3. CPUIO1 was not factored in, which does the same kind of clearing, except across all channels.
    All three of those have been resolved.
  • NEW 3/18/21: All CPUIO1 SFX now properly restore the instruments after they are done playing. The initial cause of malfunction was an uninitialized instrument table, which in turn was caused by a bad jump location.
  • NEW 3/25/21: Some minor code optimizations to light staccato toggle ($F4 $02) and removed a storage that was not needed in tempo hike disable VCMD.
  • NEW 3/25/21: Made a code optimization in the VCMD code collection by changing a call to auto-reload the channel ID * 2 to the X register, rendering the other operations inside redundant.
  • NEW 3/25/21: DDEEFix has been turned from a macro into a subroutine, saving bytes in the long run by doing so. (Thanks Akaginite for providing the optimization!)
  • NEW 3/27/21: A whole host of code optimizations! Thanks to Akaginite for providing a good portion of these (which I adapted accordingly)!
    Updated 3/28/21: Accidentally left a couple of details out when porting the optimizations over, which were pretty major, because they corrupted both pitch and percussion! This regression has been fixed.
    Updated 3/31/21: More optimizations added to the set, including some from Akaginite that I didn't add on the previous go round!
  • NEW 4/4/21 (MERGED 4/5/21): Made pitch slide delays in SFX functional. The main reason for doing so was to implement a 1-tick delay for the jump SFX, but I'm sure there are other uses out there...
  • NEW 3/31/21 (MERGED 4/5/21): Have CPUIO1 SFX terminate SFX sequences. This extra step is needed because of the hardcoded nature of the SFX. In addition, I did some consolidation prior to this merge due to de facto duplication of code.
    Updated 4/12/21: Added an opcode to the consolidation operation.
  • NEW 4/8/21: Fixed a bug where the default note length prior to any l directive calls was being defined as 8 ticks instead of 24 ticks. This was because the initialization value was not updated to not use an MML divisor anymore. (Thanks codfish1002 for reporting the bug and providing me with an example!)
  • NEW 4/11/21: Fixed a false positive in detecting AddmusicM via detecting a complete RATS tag at the memory location instead of just one byte (otherwise the filesize of the sound driver can accidentally trigger this check). (Thanks to Akaginite for identifying this problem and Runic_Rain for catching this and testing the fix!)
  • NEW 4/22/21: Made the rest VCMD functional in SFX, which in turn allowed me to perform further optimizations on SFX. The tie VCMD, as implemented by LMPuny, is not yet included: that requires additional modifications, and I feel that I need to do more than what was already done.
  • NEW 4/23/21: Corrected a typo in the documentation on the note length of a 16th triplet. (Thanks MooingLemur for initially catching this for HertzDevil's fork of AddmusicK!)
  • NEW 3/31/21 (MERGED 4/24/21): The noise clock is now preserved during echo VCMDs and in between songs. This is because the SFX may be using the noise clock, and plays in between songs by default. This also allows noise to play in SFX SPC dumps again.
  • NEW 3/17/21 (MERGED 4/25/21): SFX is no longer affected by fine tune. I actually discovered that this was a vanilla SMW bug at that!
  • NEW 4/25/21: There is now a special .asm file dedicated to all user-definable asar parameters, shared between the SNES and SPC700 side.
  • NEW 4/26/21: Fixed a bug when the P-Switch/Starman song was conflicting with external patches that modified the global song ID used on a per-situation basis while the level was ending (for example, changing the goal song ID on a per-level basis). (Thanks  Kevin for providing the bugfix!)
  • NEW 5/4/21: Got rid of a bug causing SA-1 base ROMs to fail to insert due to a warning that a mapper was already selected. (Thanks Vhack for catching this!)
  • NEW 5/13/21: Consolidated a HandleYoshiDrum call.
  • NEW 5/14/21: Corrected a bug where samples were being filtered out when compiling SPCs, but not when they were being compiled for ROMs. This was done by making them not filtered by default. (Thanks brickblock369 for notifying me about this! Twice at that! And then we also have additional thanks to  Blind Devil, Torchkas and Tamaki, the last of who told me that the omitted samples end up in the final ROM, and also provided me with an example case.)
    Updated 5/27/21: Fixed a regression where using .BNK files would cause an exception due to the new check not supporting these files. (Thanks Anas for telling me about this and providing me with an example!)
  • NEW 5/14/21: Corrected a bug related to the above item where important flags were being overwritten by sample group entries in the ROM compilation stage due to an earlier song entry using a sample group instead of a user-defined sample. I corrected this by having the sample group's important marker have priority.
  • NEW 5/16/21: An undocumented feature that existed since AMK 1.0.2 (which is also the last known release that Kipernal was directly involved in to my knowledge) now has its folder, Visualizations, included by default. (Thanks to Exodust for posting about this feature not being properly documented, and Anas for notifying me about this!)
    Updated 5/30/21: Added in some documentation of the -visualize command line argument.
  • NEW 5/18/21: Changed the way $0160 was handled in the Yoshi Drums VCMDs. It is set when any one channel has Yoshi Drums on: if all of them are off, the flag is cleared. This is because the code still reflected AddMusicM's behavior, where it indicated a flag for exactly one channel, and was never adjusted when AddMusicK de-facto abandoned the flag but kept the code. As a side effect of doing this, it also allows me to consolidate more HandleYoshiDrum calls in the VCMD code.
  • NEW 5/19/21: Corrected a bug where SPC-generated files were suffering from a one byte stack underflow. I later looked up the code and ended up removing the -g command line option because it was a de-facto no-op because the detection method, by checking time stamps, had been disabled, and actually had always been disabled since 1.0.1, which is the oldest extant version available.
  • NEW 5/22/21: Made jump and grinder SFX relocation to 1DF9 or 1DFC optional. I made two new defines that would relocate either one to 1DF9 (which was the previous default), and made the new default the case when both of these are false. This also counts as a vanilla case.
    Updated 6/15/21: The Jump and girder SFX now have their $1DFA cases actually coded in on the SNES-side for reverting hijacks, rather than doing nothing. This is because the situation here would be similar to the P-Switch as SFX case when the user wants to revert a setting after applying it on top of a ROM.
  • NEW 4/1/21 (MERGED 5/23/21): Noise frequencies between music and SFX no longer conflict with each other. This is the biggest modification I have ever made: between the music, I record one frequency, and between the SFX, I record up to eight different frequencies. Highest priority wins, and if that doesn't work, then highest channel wins.
    Updated 4/12/21: Don't zero out priority if CPUIO1 SFX is using the channel when the noise frequency is being restored for the music.
    Updated 4/29/21: Corrected a possible channel overflow bug when setting the volume for a noise SFX channel when priorities are equal on the highest channel.
    Updated 5/22/21: Made the conflict resolution between SFX instances optional, partially because there is no case in vanilla SMW where this happens, and a significant amount of code was created for this particular case.
    Updated 5/27/21: Fixed a regression where disabling noise frequency conflict resolution between SFX instances also disabled playing noise out of the SFX entirely, instead playing the raw BRR sample underneath. (Thanks Anas for telling me about this!)
    Updated 7/5/21: Fixed a regression caused by the noise SFX frequency conflict resolution code (specifically caused by the music noise frequency being restored) where the FLG DSP register was being overwritten by ModifyNoise, causing the mute to fail.
    Updated 11/18/21: Performed an optimization by consolidating some duplicate code regarding backing up the volume, setting the VxVOL values and changing the channel to check into subroutines. One of these cases also qualifies outside the scope of handling noise frequency between SFX instances.
  • NEW 5/23/21: Consolidated a few SFX checks that terminate a subroutine into their own subroutine... that also terminate the subroutine it came from under the same condition.
  • NEW 5/28/21: Fixed a big bug caused by specifying a .BNK file from one song, then specifying a .BRR file in another song during ROM compilation. Turns out these samples from .BNK files should not have their "filenames" compared to when identifying matching samples by path. (Thanks Anas for catching this bug and providing me with an example case!)
  • NEW 5/28/21: Adjusted the indirect memory locations used by the $F7 VCMD. Turns out the code was never modified from AddmusicM (which used direct page $20, which has since been changed to be used as a SFX pointer), and I thought it should at least reflect the memory location usage of AddmusicK. It's still disabled, though, for the time being, mainly because of memory location instability caused by constant rebuilds.
  • NEW 5/29/21: Consolidated SFX instrument setup code between 1DF9/1DFC and 1DFA. Plus, added a small optimization to 1DFA code.
  • NEW 5/30/21: Updated the documentation of -sfxdump/-dumpsfx to reflect its actual execution.
  • NEW 5/29/21 (MERGED 6/4/21): Added custom SFX channel allocation by user defines for 1DF9, 1DFA and 1DFC. That's quite a few opcodes to modify for 1DFA!
  • NEW 6/4/21: Corrected a bug where the jump SFX was grabbing the pitch base fractional multiplier due to grabbing the music instrument ID's parameter, which in turn was at least partially caused by terminating a SFX sequence that didn't need to be terminated. (Thanks Anas for reporting this bug!)
  • NEW 3/19/21 (MERGED 6/4/21): A series of improvements to the P-Switch SFX. This was a user-settable flag in the AMK sound driver on the SPC700-side, so the actual scope is a bit limited, but if it's there, then it's worth making sure it's working properly. The improvements, specifically, are...
    • Implemented a speed-up effect, somewhat matching the tempo of the original. Due to the limitations of the SFX format, I ended up directly modifying note lengths on the fly per loop instead of a gradual speed-up, since there's only one fixed "tempo" that all SFX use (and I had to make the code to keep everything in sync due to the interruptible nature of SFX in general). Good thing the note lengths are nice and divisible with each other to simplify this process!
    • Updated the way the SFX was handled to account for SFX priority on other channels via code recycling
    • Updated 3/20/21:
    • Added a way to stop the entire P-Switch SFX at once. One of the channels would otherwise be uninterruptible with AMK's current configuration.
    • Added a way to play the switch SFX with the P-Switch music upon startup. This is due to a channel conflict with AMK's channel allocation of $1DF9 SFX: this is resolved here by giving it a different channel.
    • Updated 5/28/21: Added the SNES-side hijacks. WARNING: These overwrite some previous hijacks within the AMK code! (Thanks Runic_Rain for helping with identifying the routine where the P-Switch music is terminated!)
      Updated 5/29/21: Corrected a bug where the wrong memory locations were used, thus sending the IDs to the wrong CPUIO registers. (Thanks Anas for reporting this bug!)
      Updated 5/30/21: Corrected a bug where the P-Switch music was still triggering due to the music cues still running in the internal AMK code. (Thanks Anas for reporting this bug!)
      Updated 6/4/21: Corrected a bug caused by flipping the switch on and off causing the hijacks to be incompletely reverted, wrecking havoc on the game. (Thanks Anas for reporting this bug!)
    • Updated 6/4/21: Corrected a bug where a 1DFA SFX would cause the P-Switch SFX to fail to speed up as intended. (Thanks Anas for reporting this bug!)
    • Updated 6/14/21: Corrected a bug where an incorrect ADSR parameter (compared to the original) was causing volume balancing problems on two of the channels. This was corrected through custom code, rather than inserting a new SFX instrument, since it was just a single ADSR byte to modify. (Thanks Anas for reporting this bug!)
    • Updated 6/15/21: P-Switch SFX's channels (including the trigger SFX) are now user-definable through UserDefines.asm.
  • NEW 4/14/21 (MERGED 6/4/21): Upgraded the ADSR envelope accuracy in the documentation. The code in question is from HertzDevil's fork of AddMusicK. Original commit reference this was adapted from
  • NEW 6/4/21: Replaced AM405Remover with an adaptation of a copy from HertzDevil's fork of AddmusicK due to the original containing Windows-specific code, causing compilation faults. I had previously been cheating by using this anyways, but I finally made it official because I still ran into the undefined symbol error even after ending up on a new computer at the beginning of 2021. Original series of commits this was adapted from
  • NEW 6/4/21: Replaced AM4Batch and AMMBatch with an adaptation of a copy from HertzDevil's fork of AddmusicK due to the original containing Windows-specific code. Original series of commits this was adapted from
  • NEW 6/5/21: The instrument backup table is now always written to whether or not SFX is occupying the channel or not. This prevents restoration failures most commonly caused by modifying the ADSR afterwards. This also allows for noise instruments to retain their original SRCN ID that they used when the noise was initially activated. (Thanks Anas for reporting this bug!)
    Updated 1/2/22: Removed a duplicate OR opcode in the noise setup that was created as a result of doing this... specifically, the opcode in question was not properly removed beforehand, and it was no longer needed.
  • NEW 6/7/21: Updated the documentation to reflect UserDefines.asm's presence.
  • NEW 6/11/21: Corrected a bug in the command line parameter -sfxdump/-dumpsfx where if the lowest numbered local number song did not exist, the SPCs would have no samples in them. Now I have modified this so that the lowest numbered valid local song is the one that is picked as the sample pack.
  • NEW 6/11/21: Fixed a critical bug where having a global song using echo and a local song setting up a buffer with an EDL size of 0 through the $FA $04 VCMD would cause a sound driver crash by not having a special case for this instance. (Thanks Fullcannon and codfish1002 for reporting this bug!)
  • NEW 6/14/21: Modified the assembly to make tracking of raw memory locations easier, mainly within setp/clrp sections, but it also affects L_1075 calls. I also got rid of a few more redundancies related to setp/clrp since it was cheaper without them.
  • NEW 6/17/21: Went on another optimization spree (along with a few consolidations), this time relating to a series of DSP register writes. As part of this, pitch and volume calculations are halted at the point where they only modify scratch RAM instead of merely bypassing DSP register writes to cut down on wasted CPU time.
  • NEW 6/18/21: The optimization spree continues! Performed another consolidation, this time inside a clear loop, as well as auto-fetching the first VCMD parameter byte.
  • NEW 6/18/21: !runningRemoteCode has been transformed into an opcode gate, freeing $0380. This is because all it does is jump over a RET if remote code is not running, hence the transformation into outright overwriting a single byte, and restoring it when not running.
  • NEW 6/19/21: Fixed a bug where the #pad command was only supporting two hex digits with #am4 songs. Turns out getHex hard-coded this situation where it wasn't needed. (Thanks SimFan96 for reporting this bug on the AddmusicK 1.0.8 page!).
  • NEW 6/19/21: Corrected a missing hex character specifier in the documentation for #pad.
  • NEW 6/21/21: Fixed a bug where having noise SFX playing in the same channel as music noise would cause frequency restoration to fail because no channels were having their volumes zeroed out. (Thanks Anas for reporting this bug!)
  • NEW 1/31/21 (MERGED 6/22/21): Added "No SFX" support through a !noSFX asar define. Currently its main purpose is for those that merely want to use AMK for creating music and not use it in hacks... or it's for those that don't want to use the SFX at all, but still want some control over the music.
    Updated 4/27/21: Fixed a bug during song initialization when notes from the prior song were not being keyed off.
    Updated 5/29/21: The SFX data itself was still being included. Now this is no longer the case... but the C++ side needs to be updated to avoid user confusion by detecting this exact define as being true.
    Updated 6/9/21: The C++-side was updated to account for the no SFX flag being enabled. In addition, -sfxdump/-dumpsfx will output a warning and no new SFX SPCs will be output due to redundancy.
    NEW 6/21/21: The pause SFX ASM has been embedded into the main.asm file as a result of !noSFX utilizing it without the utilization of the SFX sequence format (which also allows me to optimize the code in question, actually), which also turns the ASM in question in the SFX .txt files into a single JMP opcode each. For this reason, I've made a copy of those pause SFX .txt files containing the original pause SFX ASM versions.
    Updated 1/2/22: Accidentally missed a small section of code in instrument setup that would be filtered out when "no SFX" is on: this is because the memory location that is involved is only ever used for backup and comparison operations with the noise frequency of the SFX.
    Updated 2/8/22: Fixed a bug where turning it on would cause music to not play at all because of the pause command being continuously triggered. (Thanks nyanpasu64 for catching this!)
  • NEW 6/22/21: Corrected a typo where !MaxEchoDelay was not being zeroed out prior to loading new data.
  • NEW 6/25/21: Corrected a typo with a memory reference in ASM/SNES/patch.asm. (Thanks Ragey for catching this one!).
  • NEW 6/25/21: Compiled a list of all memory locations prior to the actual SPC700 program (mostly referring to $0000-$04FF) used in both the original sound driver and Addmusics, past and present, into a single HTML file. Special thanks goes to Masterlink and SimFan96 for providing some archival Addmusic versions (particularly the beta AddMusicK versions) and an example of the special pulse wave feature used in AddMusicM.
    Updated 7/15/21: Corrected a typo and updated the ARAM map documentation to better reflect the changes between Carol's MORE.bin and Addmusic405 (due to the ADSR VCMD coming from Romi's Addmusic404, and having some extra limitations).
    Updated 10/17/21: Fixed a few typos, mostly regarding CPUIO register memory location references on the SPC700 side.
    Updated 11/7/21: Made a correction and added a few more notes on AMK Beta, including a previously omitted invalid memory location reference related to arpeggio.
    Updated 12/29/21: Corrected a typo with the source of $D0-$DF: They are brand new, and not from a pre-existing AddmusicK version.
    Updated 12/31/21: Corrected an error on the utilization of $E0-$E1 in carol's MORE.bin, as it turns out to have been identical to what I recorded in AddmusicM.
    Updated 2/1/22: ARAM map now contains UserDefines.asm requirements: if the requirement is not met, the location is unused.
  • NEW 5/28/21 (MERGED 6/25/21): Restored the Tremolo Off and Pitch Envelope Off VCMDs. There's a catch: both of their original slots were overwritten. For Tremolo Off, the conversion was reprogrammed so that this can reflect the new VCMD slot. Pitch Envelope Off though is far trickier, and hasn't been done because every single Addmusic I can think of overwrote this VCMD slot from the earliest known point that the SPC700 ASM was modified, and all of the addmusic version identifiers currently post-date the earliest modification to the SPC700 ASM. Their new VCMD IDs are...
    • $FD - Tremolo Off
    • $FE - Pitch Envelope Off
  • NEW 6/20/21 (MERGED 6/29/21): The highest echo buffer size used for a global song is now used for all local songs afterwards. This ensures that data is not lost due to memory overflows.
  • NEW 7/5/21: The $FF SFX VCMD no longer rewinds in order to fetch note data. Instead, it now does exactly what it is supposed to do: execute itself endlessly every time the note length elapses using the parameters that were last used (note length, pitch and volume for example). By removing fetching any note data from prior, we remove ambiguity done by trying to scan backwards for a valid note.
  • NEW 7/11/21: Fixed a conversion bug related to Addmusic405 and AddmusicM songs where the percussion notes were not being properly followed by normal notes on #6 and #7 due to AddmusicK changing this case.
  • NEW 7/12/21: Corrected a conversion bug from Addmusic405 and AddmusicM where & was not having its preceding tie restored properly, causing the slides to occur as the note starts, rather than when it was delayed. Note that I did not apply the behavior to the AddmusicK songs due to me not knowing if they relied on the behavior: these are only for Addmusic405 and AddmusicM songs for now.
  • NEW 7/13/21: Fixed a fatal bug for Addmusic405 songs when the lowest channel ID defined is non-zero and a valid hex command is defined outside the scope of the song.
    Updated 7/22/21: Expanded the scope of the fix to all songs due to catching a case that relied on AddmusicK. (Thanks  bebn legg for providing me with an example case from a rejection log entry!)
  • NEW 8/6/21: Fixed a bug where triggering $1DFA SFX and $1DF9 or $1DFC SFX at the same time on the same channel would cause some cross-interference with each other and various glitches. (Thanks Anas for reporting this bug!)
  • NEW 8/14/21: Removed a redundant clrc opcode prior to an addw opcode. (Thanks Aikku for informing me about the addw/subw opcodes not factoring in the carry!)
  • NEW 9/13/21: Made a minor optimization to a clear loop, because the $20 byte block was only being cleared out once. Turns out I can save a byte by sending this over to the $10 byte clear loop as two side-by-side blocks.
  • NEW 10/17/21: Fixed a conversion bug from AddmusicM where the transposition values were not being overwritten by the hard-coded instrument transposition table. (Thanks Anas for reporting this bug!)
  • NEW 11/5/21: Fixed a bug where turning Yoshi Drums off failed to unmute the corresponding channel. (Thanks  LadiesMan217 for reporting the bug!) This update also frees $0386 due to turning the switch into an opcode gate as part of an optimization.
  • NEW 11/4/21 (MERGED 11/7/21): Fixed a typo on the channel ID being checked when it comes to retrieving past AMK beta anticipation gain and remote gain values.
  • NEW 11/4/21 (MERGED 11/7/21): Fixed a bug where the AMK beta remote & anticipation gain conversion values were not being retrieved properly because they were not properly organized by channel ID: instead, they were inserted in order of when they were spotted.
  • NEW 11/8/21: More optimizations and consolidations to save some more bytes as a result of the addition that was made to accomodate the remote gain/anticipation gain. Stay tuned, there will be more of these...
  • NEW 11/10/21: A new optimization has been implemented in the form of templating pitch, volume and panning fades.
  • NEW 11/10/21: Fixed a graphical glitch that was occurring during submap transitions. (Thanks Barrels O' Fun for both catching this bug and contributing a fix for it!)
  • NEW 11/18/21: Replaced a redundant word operation due to one of the registers not getting used afterwards in the pitch code. (Thanks Aikku for notifying and collaborating with me on this optimization!)
  • NEW 11/18/21: Made a minor optimization in the 1DFA code. A few days ago there were some code that was consolidated into a subroutine: this further enhances it by removing a tail call and RET opcode and instead having everything else branch to a different RET opcode.
  • NEW 11/26/21: Another minor optimization, this time with regards to changing some opcodes into smaller equivalents with regards to AND and OR opcodes being changed to SET1 and CLR1 opcodes.
  • NEW 11/26/21 (MERGED 12/11/21): Revamped setting up the echo buffer and corrected a regression with regards to failing to set up the ESA on zero cases in the process of repairing a crash caused by using global songs with echo and local songs with a buffer setup of an EDL value of zero. The echo buffer now waits for the previous echo buffer to run at least one cycle so that it can be "captured" by zeroing out the EDL prior to waiting, and the setup in zero cases only happen once via a branch gate until a new local song is loaded.
    Updated 12/11/21: !NCKValue is no longer modified during the ModifyEchoDelay subroutine (instead the FLG DSP register is directly modified). This, in turn, means it is completely preserved until the new echo buffer is ready. Note that in order to replicate an original AddmusicK bug, I had to add an opcode that cleared a bit of !NCKValue elsewhere (this will be handled in a different set because it changes a potentially bug-abusable behavior)
  • NEW 12/28/21: Fixed a bug where the Yoshi Drums were not being disabled when Mario, who was previously riding a Yoshi, was being teleported to a room that did not allow Yoshi (this also happens if you are quick enough to skip a No Yoshi Intro cutscene while riding Yoshi). They are still audible for a brief moment, though, if you directly teleport in without Yoshi: it's more natural for a No Yoshi cutscene. WARNING: This adds a new hijack at $02A763 AND overwrites an area that previously used some NOPs! (Thanks  LadiesMan217 for reporting the bug!)
  • NEW 12/29/21: A few more bytes shaved off via code optimizations. Slow, but gradual...
  • NEW 12/31/21: Another minor optimization, this time replacing cmp a, #$01 opcodes with dec a opcodes whenever the accumulator is overwritten afterwards.
  • NEW 12/31/21: Minor correction on the terminology of the ADSR VCMD in the documentation, as well as adding a binary literal specifier, %, from asar, for clarification.
  • NEW 1/1/22: A couple more minor branching opcode-related optimization.
  • NEW 1/2/22: Added a user definition to toggle checking for matching noise frequencies, in case you only want one channel at a time for noise and don't want the stacking effect at all when frequencies match.
  • NEW 1/4/22: Fixed a big bug regarding parsing uppercase letters in notes: specifically, they no longer access undefined array references when translating to a pitch (which is adapted for lowercase letters only). (Thanks Exodust for catching this bug!)
  • NEW 1/5/22 (MERGED 1/6/22): Added a historical hex command reference for the past Addmusics.
    Updated 3/9/22: Corrected a typo on Addmusic404's ADSR VCMD regarding its relocation.
  • NEW 1/11/22: A few optimizations here and there, including adding pre-fetching to the $FA VCMD set. The optimizations are larger with the new VCMDs included (though with an extra adjustment to the pre-fetching, because one of them is dependent on using the command ID).
  • NEW 1/14/22: A few more optimizations here and there, including a section of code being moved to remove a CALL and RET opcode.
  • NEW 1/15/22: Corrected a regression in the remote code setup caused by an optimization on 11/8/22... because the stack order was incorrect when restoring pointers.
  • NEW 1/15/22: The relative reference for CommandDispatchTable in the source code has been made easier to understand. This is because it is relative to double the command ID... without factoring in the highest bit due to an 8-bit limitation of the registers.
  • NEW 1/17/22 (MERGED 1/25/22): There are now warnings issued for using features that did not exist in prior Addmusics when using their respective emulated parsers. In addition, using the $FA command while using #amm outputs an error (the restoration of the special pulse wave will make this redundant), because it is reserved for the special pulse wave, and therefore is irreconcilable with using it as a set of sub-commands with a parameter.
  • NEW 1/27/22: A modification was made to the C++ side due to some incoming changes that would make generating bytes at the beginning of a song more unstable. This specifically affects the velocity table and echo buffer initialization VCMDs, and the hot patch VCMDs would disrupt the order that these are generated, even if they are not entirely present.
  • NEW 1/28/22: Fixed a bug on detection of the lowest note possible.
  • NEW 1/31/22: Corrected the transposition information with regards to the raw hex values of some instruments. (Thanks Pinci for catching this!)
  • NEW 1/31/22: Clarified the remote code documentation, particularly with adding some fine print to remote code event type 4 due to note data still not being supported.
  • NEW 1/14/22 (MERGED 2/1/22): 1DFA SFX now use standard sequence data by default. The original code is still present for both historical reasons (in addition to my patches) and in case something goes wrong when using the SFX sequences and wants to revert.
  • NEW 2/1/22: Another set of optimizations to further bring down the size, little by little.
  • NEW 2/4/22: Added an optimization regarding calling either RestoreMusicSample or UpdateInstr: we can branch to a pre-loaded Y register location instead.
  • NEW 2/5/22: Corrected a compilation error that would occur on some compilers caused by a missing #include in Globals.cpp. (Thanks nyanpasu64 for providing the fix!)
  • NEW 2/5/22: Fixed a formatting error in the -? command's help message. (Thanks nyanpasu64 for providing the fix!)
  • NEW 2/11/22: Did a commentary overhaul in the SPC700 ASM, mostly with regards to code sections and variables that were marked as unknown. This is because of the passage of time as well as my own efforts to get them all identified.
  • NEW 2/11/22: Fixed a bug where the program crashes when either there are zero global songs while generating a SPC or there are more than 255 songs total. (Thanks nyanpasu64 for providing the fix!)
  • NEW 2/11/22: Removed a couple of clears for bit 7 of direct page $13 because they are never checked within the scope of the code being executed, saving two bytes (and two off of the historical 1DFA code).
  • NEW 2/12/22: Minor update to the commentary to update on $13.7's original usage.
  • NEW 2/13/22: Fixed a typo in an error message when a local song was assigned a lower ID than the highest global song ID. (Thanks nyanpasu64 for providing the fix!)
  • NEW 2/23/22: Removed a redundant clear operation on the fractional pitch base on the instrument setup VCMD for SFX sequences. This is because this is now handled inside the SFX instrument routine.
  • NEW 4/15/22: Optimized the handling of writing to the VxVOL DSP registers while handling SFX when reading volume values. This isn't as efficient if we have to check noise frequencies between SFX instances because of how the registers are set up, but I did change a DSPWrite call beyond that because no update was required on the register address pointer.
  • NEW 5/9/22: Updated the subpage titles to be more informative of where the user is. (Thanks nyanpasu64 for providing this!)
  • NEW 5/12/22: A series of optimizations, some of them only applying when certain UserDefines are toggled.
  • NEW 5/15/22: A second set of optimizations, continuing off of the previous set.
  • NEW 1/19/22 (MERGED 5/16/22): The hot patch VCMD has now been implemented. This comes in two different forms:
    • $FA $7F xx - Hot-Patch by Preset ID
      $80-$FF are reserved as user-defined IDs, while $00-$7F are reserved as preset IDs for replicating playback from past Addmusics when the code implementation is different (as well as fixing bugs that do result in playback inconsistency in older songs that took advantage of a bug). This is a global VCMD: that is, it applies to the entire song, not just one channel.
      The following IDs are reserved, some of them for future use:
      • $00 - AddmusicK 1.0.8 and earlier
      • $01 - AddmusicK 1.0.9
      • $02 - AddmusicK Beta (Nothing's here yet, but remote gain or anticipation gain are already noted. However, this may be more of a new VCMD situation that can handle that better.)
      • $03 - Romi's Addmusic404 (The one difference here may end up being a more direct VCMD conversion... but I have it here just in case.)
      • $04 - Addmusic405 (the readahead is affected quite a bit because of the fixed filesize, meaning it can't properly adapt to the $ED VCMD: this hasn't been implemented yet in the hot patch, but it affects $ED $80, $ED $82 and $ED $83.)
      • $05 - AddmusicM
      • $06 - carol's MORE.bin
    • $FA $FE %xyyyyyyy - Hot-Patch by Bit
      • %x means there are another seven bits to fetch. Yes, this can be a multi-byte VCMD, which means there needs to be a C++-side modification for hex validation purposes.
      • %yyyyyyy are all patch bits. These generally correspond to a patch that would result in music playback inconsistency. They incorporate the following patches that can be toggled on and off...
        • 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.
          Updated 1/21/21: Account for loop section end markers encountered for the first time in a readahead iteration on their last loop
          Updated 11/10/21: Did an optimization with replacing duplicate JMPs with BRA opcodes to a singular JMP opcode whenever possible, saving a byte per opcode replacement.
          Updated 12/29/21: Did an optimization by using MOVW opcodes prior to jumping back to a label that clears out Y for additional indirect reads.
          Updated 12/31/21: Another minor optimization, this time replacing cmp a, #$01 opcodes with dec a opcodes whenever the accumulator is overwritten afterwards.
          Updated 4/10/22: Made an optimization as part of a correction caused by incorrect endianness when converting some of the opcodes to MOVW opcodes.
          Updated 4/15/22: Recycled the optimization for utilization with the array pointers that were previously being used separately since it consolidates the operations better.
        • 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.
        • Pitch slide to note commands (referring to the $DD command) failed to account for per-channel transposition. (Thanks to musicalman for catching this bug!) This bug has been confirmed to have been exploited, citing this port. Thanks  Anorakun for informing me of this! This is why it's in a hot patch: so that these don't break in the first place.
        • NEW 1/13/21: Write GAIN before ADSR when updating instrument data. 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. (Thanks Masterlink for providing me with an example case!)
          Updated 1/2/22: Removed a redundant AND opcode, because the OR A, #$07 opcode is being applied to something that was ORed by #$04 before, thus always setting it to the correct value via the bits simply getting set regardless of case.
        • NEW 7/4/21: Fixed a bug with the $F3 command not zeroing out the pitch base fractional multiplier, which in turn caused problems for songs ported over from AddmusicM not accounting for pitch base fractional multipliers being in play. (Thanks Masterlink for reporting this bug!)
        • NEW 12/11/21:The echo write flag is de-facto no longer modified when setting up the buffer. This means that the $F1 VCMD most commonly will instead enable the echo writes. The reason why this is happening is because by default $FF00-$FF03 will be overwritten, even if echo is never used.

    Updated 1/28/22: Replaced the VCMD code for processing by bits to ensure all bits are handled (they're cleared by default) and to streamline the writing process to make things less hard-coded for editing purposes. In addition, the C++ side has been implemented, meaning it is now in bleeding-edge. Previously it wasn't because of the variable size of the $FA $FE VCMD.
    Updated 2/14/22: Corrected a bug where if there were no leftover bytes to fetch for bits, the X register would not be properly refreshed. This specifically affected the preset ID VCMD, which would then not refresh the track pointer correctly.
    Updated 2/21/22: Added handling for the position of generating the $FA $04 VCMD. So far, generation of this VCMD happens in a different place than the default location if the hot patch VCMD is put at the beginning of the song prior to any notes and there is no $F1 VCMD. This is because the echo writes need to be disabled when using using $FA $7F $01 or the corresponding bit. There are a couple of cases that haven't been handled here: namely, a different starting channel (technically this is handled for now) and if it is placed after an intro.
    Updated 5/9/22: I decided not to handle a different starting channel, and also decided not to do anything special past a loop point in the song, so I marked them down accordingly.
    Updated 5/16/22: Corrected a typo on a template that I gave in commented out ASM regarding a wrong reference.
  • NEW 5/10/22 (MERGED 5/17/22): There is now an option to restart the P-Switch and Starman global songs when recollecting a star or pressing another P-Switch. It also contains a bugfix where the P-switch will retrigger the star theme when the timer is just about to run out, then the P-Switch music will play after the star timer expires. (Thanks Anas for requesting this, and the JUMP team, SimFan96 and  Kevin for providing the code (which Anas then adapted to make it switchable and I then made some minor adjustments to)!)
    Updated 5/11/22: Added in the bugfix when not retriggering P-Switch and Starman global songs on collecting.

Not merged in (available in a pull request)
  • A bunch of new VCMDs, albeit a bit more mundane for now...
    • $F4 $0A - SMW Velocity Table
    • $F4 $0B - Pitch Modulation Toggle
      Updated 3/23/21 for code optimizations
    • $F4 $0C - Yoshi Drums On
      Updated 1/14/21: Added hex validation code to have this VCMD trigger Yoshi Drums check
      Updated 3/24/21: Removed a redundant opcode
    • $F4 $0D - Yoshi Drums Off
      Updated 3/24/21: Removed a redundant opcode
      Updated 5/13/21: Fixed a regression caused by using TSET/TCLR opcodes due to not adjusting the values used with the TCLR opcodes.
    • $F4 $0E - Echo On
    • $F4 $0F - Echo Off
      Updated 3/23/21 for code optimizations
    • $F4 $10 - Pitch Modulation On
    • $F4 $11 - Pitch Modulation Off
      Updated 3/23/21 for code optimizations
    • $F4 $12 - Legato On
    • $F4 $13 - Legato Off
      Updated 1/31/22: Corrected a typo in the documentation.
    • $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)
      Updated 5/13/21: Fixed a regression caused by using TSET/TCLR opcodes due to not adjusting the values used with the TCLR opcodes. In addition, fixed a wrong branching location.
    • $F4 $19 - SNES Sync Resume
    • $F4 $1A - SNES Sync Pause
      Updated 5/13/21: Fixed a regression caused by using TSET/TCLR opcodes due to not adjusting the values used with the TCLR opcodes. In addition, fixed a wrong branching location.
    • $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.

    NEW 1/29/21:
    • $F4 $1D - Force Key On
    • $F4 $1E - Force Key Off

    These are riskier to use (due to the former risking clicks if misused, since there is no readahead checking done on either of these), but I came up with these commands for the purpose of an override during a legato command, though there could be other cases involved.

    • $FA $08-$0F - Voice DSP Register Write

    I came up with this as a more convenient alternative to $F6's DSP register write command on an individual voice basis, as this set will do that automatically. I also have each voice DSP register take up a VCMD slot, unlike the other one.
    Updated 3/27/21: Turns out that the accumulator was automatically set to zero upon using the VCMD dispatch table, requiring that I send X to A first. Without that, the VCMD ID is not properly factored in, resulting in wrong DSP register writes that don't vary by VCMD ID.

    NEW 3/25/21:
    • $FA $12 - SNES Sync Clock Divider

    I was inspired by a conversation with OnlySpaghettiCode on the Discord server that caused me to conjure this one up. It allows one to replicate AddMusicM's behavior by using $C0 as the parameter. Zero (AKA 256 in this case)'s the default, which causes the SNES Sync Counter to act like a de-facto 16-bit word like before.

    NEW 5/6/22: More new VCMDs...
    • $F4 $20 - Single Loop Recall
    • $FA $13 xx - Multi-Loop Recall
    • $F4 $21 - Loop Break
    • $F4 $22 - Superloop Break
    • $F4 $23 - Superloop Break + Terminate Loop

    (Thanks Masterlink for requesting the loop break VCMD!)
  • NEW 1/31/21: Brand new remote code events! Currently, I have just one...
    • -2: Identical to -1 (meaning that it runs whenever a note is keyed on), but it doesn't trigger on notes that are solely triggered by arpeggio.
      Updated 5/17/21: In addition to actually initializing it properly with each song, I decided not to take up a byte in the $0000-$03FF section. Instead, I embedded it into the code as a branching distance gate: it's set to zero if open, and a non-zero value if closed.
      Updated 5/31/21: Corrected a regression after converting it to a branching-based gate when it was supposed to be closed rather than open.
      Updated 6/2/21: Corrected a second regression with a wrong note reference being used.
  • NEW 2/1/21: Expand the pitch range for notes. These pitches can actually only be achieved by transposition, and in the higher pitch cases, you run into a hardware limitation on an absolute maximum. In lower pitch cases, you also run into a hardware limitation that causes a loss of precision.
  • NEW 2/1/21: Restored the special pulse wave from AddMusicM! Note that I've only done the SPC700 side: this is going to require a sample slot to be allocated in the directory, and thus also requires a C++-side modification to automatically generate what sample ID utilizes the sample slot. These new VCMDs are created/reallocated as a result of this modification:
    • $F4 $07 - Reset Special Pulse Wave
    • $FA $07 - Set Special Pulse Wave Oscillation Speed
    • $FA $10 - Special Pulse Wave Format Clear + Set SRCN ID

    The last one is mandatory to avoid data overwriting chaos, either on BRR data or something else. $FA $07 was reallocated from its original slot of simply $FA from AddMusicM due to now being a sub-command slot with a one byte parameter.
    Updated 2/10/21: The BRR file provided was missing its opening block from AddMusicM. This problem has been corrected by adding it back on.
    Updated 5/31/21: Implemented the C++-side code, which in turn means the SRCN ID can now be auto-detected.
    Updated 11/9/21: C++-side conversion code from older AddmusicM songs has been implemented for the $FA VCMD. In addition, documentation has been added on with regards to how to handle the $F3 VCMDs because the sample ID is no longer $09 due to a conflict.
    Updated 5/15/22: Corrected an oversight where SRCN IDs above $3F would not fetch the correct pointer.
  • NEW 6/20/21: Add the ability to have SFX echo channels mirror the music echo channels. This is done through 1DFA command ID $0A. It can be disabled by forcing echo for all SFX channels either on or off via 1DFA command IDs $05 or $06. This replicates a vanilla SMW behavior where this was the default behavior. (Thanks Anas for requesting this feature!)
    Updated 7/9/21: Fixed a slowdown bug affecting the jump/girder SFX on $1DFA caused by not processing their ticks after executing the command. (Thanks Anas for reporting this bug!)
  • NEW 6/20/21: Add the ability to carry the enabled music echo channels between global and local songs without clearing it out first. Note that this does not work between local songs: this is because new data is being loaded every time, therefore I have this cleared out for safety reasons. Otherwise, it replicates a vanilla SMW behavior where this was the default case. (Thanks Anas for requesting this feature!)
    Updated 7/9/21: Fixed a slowdown bug affecting the jump/girder SFX on $1DFA caused by not processing their ticks after executing the command. (Thanks Anas for reporting this bug!)
  • NEW 9/13/21: Added the ability to filter out the arpeggio VCMDs. This is bleeding-edge exclusive for now due to safety reasons, namely because there's no pass-through code yet to avoid a crash.
    Updated 9/14/21: Made a minor correction due to a failure to account for the stack.
  • NEW 11/7/21: Revamped the conversions for anticipation and remote gain from AMK Beta. There are now two reserved remote code events designed to work alongside each other and with the ability to automatically restore the instrument on key on (thus bypassing the requirement of a third remote code event). There are two additional remote code events that stop key on and non-key on remote code events: they are open for the user to use. These are bleeding edge exclusive due to the GAIN/ADSR bug, which is in another pull request above.
    Updated 5/16/22: Added a type 6 check in readahead due to forgetting to account for a case where type 3 could skip the intended check.
  • NEW 3/17/22: Parser version 4 is now in progress! A good chunk of parser version 3 will also be brought over here, though anything that relies on new hex commands or header modifications won't make the cut to keep down filesize on the SPC700 side.
  • NEW 4/6/22: Codec's AMK Beta is now getting parser version 3 implemented from the last publicly released beta, as found here. The implementation is based off of the C++-side source code that was provided to me by the original author (I made some minor modifications and corrections). I got multiple versions of the source code, so I based them off of the files that came the closest to the last public beta release on 5/7/17.
    Updated 4/10/22: Corrected a bug for detecting a zeroing out of tempo when dividing tempo. This was a bug from the original source code as of the last public beta release.
    Updated 4/13/22: Corrected a few bad references that I failed to update, as well as getting some hex VCMDs backwards. This was partially caused by me deciding against copying some of the source code verbatim (as well as catching some templating) (Thanks SimFan96 for notifying me about this!).

What are you planning to do?

  • Add actual phrase support. I recorded my proposal on how to implement it here.
  • 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?

I suspect that these were done by design in the original program, meaning I don't have as many plans to change the code to correct these quirks. However, they are documented since they're "gotcha" cases. In addition, in some of these cases, I can't repair these quirks without updating the parser version, because they would break previous songs.
  • 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!)
  • The parser does macro substitutions immediately after the $ character, meaning trying to utilize raw hex-like numbers as a macro substitution will conflict with this particular instance. (Thanks brickblock369 for providing me with an example!)
  • If your macro substitution definition begins with an r or a ^, then if the last note is the same character as the first character of a macro substitution, then the substitution will fail because AddmusicK combines rests and ties, thus accidentally filtering out the first character. Note that this also goes across spaces and lines! Note that this is a quirk for AddmusicK's parser only: it is noted as a potential conversion bug from AddmusicM, which also supported substitutions, but did the substitutions before parsing any of the notes, whereas AddmusicK parses them on the fly. (Thanks Anas for providing me with an example and Masterlink for notifying me about this!)

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

See the Github issues list.

Do you have compiled binaries?

You can find the latest compiled binary for Windows here. (Thanks  Atari2.0 for setting this up and hosting the binary!)
As of 2/7/21, two files are available:
  • - Contains the latest version containing all merged changes.
  • - Contains the majority, if not all unmerged changes, for those that want a more bleeding edge experience with the program (and if you want to catch some bugs in the process caused by my changes). The branch that contains all of these changes that I have merged into this package is called bleeding-edge.
The SPCs and stats folder were not properly included prior to 3/20/21 due to being empty on distribution, and thus being excluded from the git repository. This has been resolved via a stub file being created in those folders, thus allowing them to be included by default again as an "empty" directory. (Thanks codfish1002 for notifying me of this!)

All builds as of 3/25/21 contain asar 1.81 instead of 1.71.

There are two new builds that are currently being concurrently updated with the master branch after having been created at the start of Summer C3 2021:
  • is the latest release candidate build for AddmusicK 1.0.9. A special AddmusicK1.0.9 branch, branched off of the master branch, was created especially for this occasion. Any bugfixes needed to be applied during the Summer 2021 C3 period will go in here, and the versioning has been updated accordingly here (except it is marked as a release candidate: a final version without this fine print will end up on SMWCentral once I submit it). Please note that I am still updating this even though C3 is over: this is because I am hunting down use cases for four of the fixes for consideration to include in the AMK1.0.9 release, and I am also catching any conversion bugs for AMM and AM405 that were previously circumnavigated that are not related to VCMD IDs getting cut.
  • is like the above build, but it includes all four of the changes that might require some remoderation (and thus is stored in the AddmusicK1.0.9bleeding-edge branch) as indicated in the Summer 2021 C3 thread. It otherwise does not contain other bleeding-edge branch changes (except for the revamp of the AMK beta anticipation gain/remote gain conversions, which is currently affected by one of the four issues, but is otherwise included due to being a conversion improvement): these are only changes that I feel can make the cut for 1.0.9 under the condition that the bugs are detected accordingly in the music archives.

View the project here on Github

Note that I recommend updating Asar to version 1.81. The version currently included in the Github repository is 1.81, whereas the version included in a stock AddMusicK build is internally identified as v1.33, which is older than the oldest surviving version hosted on this website!

The makefile was adapted from HertzDevil's fork of AddMusicK, since one didn't exist before.
Pages: « 1 » Link
Forum Index - SMW Hacking - Resource & Tool Releases - AddMusicKFF - A fork of AddMusicK (Last updated 5/17/22)

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

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


Follow Us On

  • YouTube
  • Twitch
  • Twitter


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