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.
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).
Merged in
Not merged in (available in a pull request)
Other
You can find the latest compiled binary for Windows here. (Thanks Atari2.0!)
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.
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.