After a few months of working on it, I've finally finished a big update to AddmusicK!
The changes are significant, so I am uploading it here first as a beta so that people can test it to verify everything is working as intended.
New features in AMK 1.1 Beta include:
-AMK now uses ASAR 1.5 instead of ASAR 1.33b, having been minorly altered to facilitate this transition.
-the AMK engine has been drastically optimized, making it be reduced significantly in size (roughly 0x400 when excluding the arpeggio commands but including all the new features). With over 50 SMAS sounds included (based on Vitor's sfx dump. Includes all SMAS sounds except for an unused variant of an unused SMW sound and the wind, which is hardcoded), it's less than 200 bytes larger than AMK 1.05 was without those sounds!
-thanks to the optimization, the entire engine is categorized neatly and near-fully-documented.
-Sound effects can now be called on ANY channel from 0-7 via 1DF9 and 1DFC. Use #0 through #7 to dictate within a sound effect file that it should be on a specific channel, or indicate #0-#7 from the sound list if you don't want to force a specific channel from within the sound text file.
-You can now directly configure the default channel SFX play on from 1DF9 and 1DFC in SPC/Settings.asm
-Sound effects can now use multiple channels. Designate multiple channels from within a text file to have that sound id play them on those channels simultaneously! See 11, 12 and 1D in 1DF9 to get an idea of the format. Use #endchannel to designate the end of the info for one channel, then proceed with #x (where x is the second channel of info).
-Sound effects can reserve their channels to prevent other sound effects from overruling them by using #reserved. 11, 12 and 1D in 1DF9 utilize this in favor of how SMW originally checked these specific ids. The pause and unpause sfx will overrule other reserved sound effects if called from 1DFA (which is how they are normally called), preventing any related issues from interrupting them.
-#endchannellooped will make a sound effect loop the last note, while #channellooped will loop the entire sound effect on that channel. If no data-end option is written into the file, it defaults to whatever it is designated in the sound list. If nothing is indicated there, it assumes it ends with a $00 (equivalent to #endchannel)
-Sound effects now have a more easily-read format. Use l$xx to designate a length in hex for the default length of a sound or designate a note length. Dotted values are also valid, so you can use l8. if you wish. While the formatting is similar to that of the music files, there are some key differences. For example, volume is set per speaker (i.e. v56,56 is the same as v56, which would be the same volume in both speakers, but a sound effect volume that is twice as loud in the right speaker would be v30,60) Look at the sound effects provided for a gist of how it is set up, as I tried to make it as intuitive as possible.
-Included among the SMAS sounds is the turning sound effect, which is normally unrolled and thus ungainly to port. The doomship sound effect requires the distortion guitar sound to work properly. If you are dire on space and won't use it without the instrument being present, just omit the ! in the sample group text next to "default/11 SMW @17.brr" since it is currently the only sfx using it.
By including these sounds by default, I hope that this will bring a bigger incentive for spriters to utilize them as they could safely assume that these sounds are accessible by others.
-Includes a fixed SMW jump sound, which should be virtually identical in function to what the original SMW used but without the hassle of unrolled code
-A custom pause/unpause sound has been included that is based on the SMW pause/unpause sound. However, instead of stopping the music when paused, it now merely lowers the volume of the notes. This should result in less music breaking from long notes being interrupted. An alternate pause sound that works more like SMW's but stops all music channels the instant it is paused has been included separately within the download if this does not tickle your fancy.
-Several sound effects now call themselves to channel 6 or 7 instead of their regular channel to try to lower the amount of conflicts present due to 1DFA sounds being called to channel 6 or 7 due to AMK.
-Additional sounds not your cup of tea and just want a smaller program? Included is an alternative sound list which maintains the channels used in AMK 1.05. Only the skidding sfx from SMAS is included in this alternative file in slot 1D for 1DFC as the original sound that was present in 1D is removed, thus this serves as a safety net if for some reason someone used that sound id (not likely).
-Drastically reduced slowdown within music by reducing the polling for updating the pitch to only when the pitch on a channel is actually altered in value. Test songs that originally slowed down by nearly 50% now only slow down by around 5% and most songs now have negligible-to-very-little slowdown.
You can reduce slowdown even further at the cost of pitch accuracy by using tags #efficient or #semiefficient within your song files to alter how it processes information.
-Sound effects now have clearcut ways to read pitchbend info. PitchBend designates a starting note and a finishing note and PitchBend2 continues from a previous note to the designated pitch.
Examples of the syntax include PitchBend(o4a,32,16,o4b), PitchBend2(32,16,o3c), PitchBend $WW,$XX,$YY,$ZZ, PitchBend2 $XX,$YY,$ZZ
Omit the delay byte (The first length designated, or second byte after the pitchbend command) to save space by writing, for example, PitchBend(o4a,16,o4b), PitchBend $WW,$YY,$ZZ, PitchBend2 $YY,$ZZ or PitchBend2(16,o3c). The program assumes a delay of $00 then and reacts accordingly.
-Sound effects with pitchbends are now compressed if they have no delay. SMW, SMAS and YI all avoid using delays in their pitchbends, so this reduces the size occupied significantly.
-All sound effects included have been converted into this more readable formatting, making it easy for users to understand the mechanics and get an idea of how to make their own custom sounds.
-Sound effects can be looped with an intro by using "/". While an example is not included, think of something along the lines of the Mega Man X charging sound effect for an idea of the potential.
-Custom percussion is now present as a feature. Designate up to 10 different percussion instruments using a familiar setup similar to custom instruments.
An example would be "default/06 SMW @22.brr" $8C $E0 $70 $07 $00 o2a. The only difference from custom instruments is that you designate a default pitch with an octave. See the boss text for more info, and as a proof of concept, it lowers the percussion by one octave.
-A new syntax is included for percussion notes #$D0-#$D9. "%". Like a-g and r, you can use % in conjunction with lengths i.e. "l8 %16 %32 %%%%". To designate which percussion note this actually is, use either %<x> (where x is a value from 0 to 9 i.e. %<6>16 or l16 %<6>) or %x,l (where l is the length i.e. %6,16). Both formats were desired, so I included each of them!
-A musician's mode has been set up. Use argument "-m" in the command line to make it not insert code related to sound effects or any sound effects at all without constantly manipulating your lists! Ideal for people that use AMK as a de facto SNES tracker.
-SPC700 output was originally conflicting with input, causing it to sometimes drop commands sent by the 5A22. It no longer sends constant output for now to the 5A22 mid-song to avoid this issue.
-SFX dumping has been fixed, allowing SFX that use noise to render properly to SPCs. Use "-dumpsfx" to dump the SFX to SPCs/1DF9 and SPCs/1DFC.
-Arpeggio functions are now excluded by default. Enable them from Settings.asm by setting !IncludeArpeggio to !true instead of !false if you really need it, although it will increase the size of the program noticeably if you do.
-The groundwork for a PWM engine by 6646 and I is placed, although it is currently not functional. It should be ready by the release candidate for AMK 1.1.
-Asynchronous loops are now possible! Make a channel loop independently from the other channels by including $F4 $0F at the beginning of that channel. No #option is needed to get this running.
-6646's new syntax mentioned in the standard AMK thread has been included. See this post
for more information.
-To make it easier to set arguments via command line, I included a .bat that launches AddmusicK.exe for your convenience.
These new features should be used with "#amk 3" to work properly, as they are certainly not compatible with 1.05's .exe even though I designed these changes such that people should be able to safely migrate from 1.05 to 1.1. Please back up your ROMs before doing so though, please, as this is still being tested as an open beta.
-Sound effects that use only one channel and call a routine via code insert two bytes of garbage data which affects the sounds. As the Hurry Up sound is now polyphonic and the pause-related sounds now have a second channel for an echo, this won't affect the sound files currently included, although I plan on resolving this issue and giving an alternative pause sound that uses only one channel.
-A handful of features are currently not fully tested, including the loop break syntax ":". It'd be great if I could get some verification on their functionality
-Generation of ARAM images has been temporarily disabled
-AMK will occasionally claim that the ROM is using AMM instead of AMK due to how drastic the overhaul is. I need to adjust how it recognizes the engine to eliminate this issue and allow it to be overruled.
-the source files are not currently included, as I am still making changes
-When using musician mode via "-m", songs that are set up to be altered by riding Yoshi do not play the Yoshi channels due to having no sound effects present to activate this property
-Very light notes sometimes are registered as silence when paused, this is currently being tweaked so that the rate that volume is reduced when paused is non-linear to avoid this
Plans for the release version of 1.1 not present in this beta:
-A re-disassembled soundtrack for Super Mario World, fixing the various inaccuracies among the text files (which sometimes contain additional or missing notes or commands)
-A minor update to ASAR to fix some improper SPC700 syntax for tset1 and tclr1
-fixing the known issues listed above
-update the ARAM image generator feature to be usable again
-completed PWM, including the ability to have song-specific PWM routines
-include the source files
-include an option to generate global songs for a single local
-include an option where if you use -norom and no text files are designated, it defaults to generating spcs from a list
-provide some custom sound effects, including some altered YI sounds that use SMW samples by default
-create some custom sound effects for Bowser so that the SMW Bowser fight is a bit more salvagable with AMK than it currently is
-update the readme
I hope people enjoy the effort I put into this upgrade. As this is an open beta, please mention any issues you find here so I can clear them up and, like I mentioned before, please back up your ROMs before making the transition to ensure everything is fine.
New features in the 5/7 build:
-the ability to have quick transitions between SMW level themes (and the boss theme), between SMW OW themes, SMW Credits themes and SMW's bowser fight themes has been implemented go into SNES/patch.asm and set "!fastTransition" to "!true" to try it out as it actually makes the fight and credits in a playable state again! Do note that I set the org position in the new SampleChecker.asm to org $108000 for testing purposes. Move it around to wherever you have room if that's not free for you.
-as a consequence of testing this, all samples have been set to important in the default sample group as it seems AMK only will set the importance of a sample on the first attempt to locate it (i.e. I tried to make a sample group where all samples were important separate from the default, but it just resulted in some not being included based on the song). This should hopefully be fixed in the release candidate by making an easy way to group songs with a padding value. DO note though that I may not be able to get around that sfx still get dropped when transitioning songs as in earlier AMK builds, although I am toying around with an idea that may be able to get around this.
-fixed a bug that would occasionally crash the soundchip if a song didn't loop due to changes in how they were compiled
-included some sound effects from the GBA ports done by ear (can't rip them yet directly). They're not in the default sound effect list, which only has SMW and SMAS sounds, but a list with them is also included. Speaking of which, I will be changing the sound ids for several SMAS and GBA sounds in the next major 1.1 release (in order to remove several of the less necessary sounds, such as the unused ones), although the SMAS sounds themselves should be accurate.
-included two new .bat files for your convenience. AddmusicK+SFX.bat (launches AddmusicK like normal, but also will compile SFX SPCs) and Trackmusic.bat.
-Trackmusic.bat is a new feature, which allows you to quickly compile SPCs without SFX or SFX-related code being included and without needing to use a ROM or arguments! In fact, you can use a separate list from Addmusic_list.txt called "trackmusic_list.txt", which will be referenced to determine which SPCs you want to produce, keeping your ROM songs and your tracker music separate while remaining in the same folder! Do note though that SPCs for both are currently placed in the regular SPC folder. I may change that so that the ones made using the Trackmusic.bat are instead loaded into "TrackSPC" or something like that. Also, if you do not have a "trackmusic_list.txt" in your folder (the zip provides one, though), it assumes that it should read the "addmusic_list.txt" instead. Don't worry though, in either case, it won't include the global songs, providing the maximum amount of space possible!
-made the NINTENDO logo load moderately faster by making it upload only the one sample it uses for the coin sound