SMPS Optimizer is a small commandline tool that helps you to reduce the size of SMPS files. In order to make very small SMPS files, it processes the SMPS file 3 times: Pass 1: During this pass it does some general optimizations. (omit note/delay commands where possible, remove volume changes that are overridden at the tick) Pass 2: Small consecutive delays (likely to happen with mid2smps) are turned into one larger delay. Pass 3: This is probably the most efficient pass. The tool searches for repeating commands and turns them into F7 loops. I wrote this tool to reduce of the size of the large SMPS files mid2smps creates, but it also works well with xm?smps conversions. It is still no replacement for manual optimization. SMPS Optimizer fully supports the SMPS formats of Sonic 1, Sonic 3 & Knuckles. There's also support for generic SMPS 68k formats and Ristar, but I haven't tested these two. This version features a few bugfixes and improvements (like nested loops), compared to the version I included with the mid2smps 0.3 beta. Also you can use the -p parameter to choose, which passes the tool should execute. (all passes are enabled, if you omit the parameter) If you notice any bugs, please don't hesitate to report them. Download (Source) Enjoy! EDIT: Added source code. EDIT2: Updated the tool (some bugfixes, added -p parameter) EDIT3: Updated the tool (finally fixed the loop detection bug)
Very cool stuffs, someone I know had recently used this and managed to shave off a lot of data, well done!
Glad you got this program out. This will be extremely useful for anyone looking to shrink their ROM size. Does this also free up some processor speed if it's getting optimised? Awesome job.
Sorry, I'm terribly late with my reply, but I was busy with some projects and RL stuff. Anyway, thanks. I just updated the tool to fix a few bugs. One bug made a loop possible that starts in the middle of the E0 coord. flag, so the offset calculation failed and it generated an invalid loop. Also there was a bug related to nested loops. Finally I fixed the handling of the note-duration-delay-delay sequency for S3K SMPS files. And there's a new feature: the -p parameter, which allows you to select, which passes will be executed rhs: It mainly reduces the size of the SMPS files. The first two passes can save some CPU cycles, but loops need additional processing time, of course.
Hello, I'm having trouble using SMPS Optimizer, it just starts and shuts down, do I run it in command and if I do, what commands?
Yes I've done that but when I open it even in cmd the exe opens and just basically blinks. Any other commands?
(note to other moderators: Bejitto didn't bump this topic, as it was autolocked. He posted in another topic, and I moved here the 3 posts above to keep them sorted) That said, I shouldn't really answer your question since smpsopt comes with a help. However: Code: smpsopt.exe s1 input.bin output.bin
Thank you so much, nineko, now I can continue with my hack! On the side note, ValleyBell, Both mid2smps and SMPS Optimizer are amazing! Sorry for bumping the other topic though...
You didn't bump any topic. This one was locked, the other one wasn't, so you could post in it as much as you wanted. I moved your posts here because it makes more sense. I was actually informing the other moderators that you didn't break any rule, it was a good thing
I just updated the tool - this should finally fix the annoying loop detection bug that breaks SMPS files under certain conditions. It should also remove the invalid FM instrument command from DAC channels now. The download is in the OP. If you want an example of the previously failing loop detection, here is an example from the Shantae: Burning Town SMPS I submitted to the SMPS competition recently: Spoiler Code: SBT_Loop14: dc.b nRst SBT_Loop15: dc.b nC5, nRst, nC5, nRst, nC5, $06, $06, nRst, $0C, nC5 smpsLoop $00, $02, SBT_Loop14 SBT_Loop16: dc.b nRst, $0C smpsLoop $01, $02, SBT_Loop15 ; <--- loops into a part of Loop14, so it does Loop14 again dc.b nBb4, nRst, nBb4, nRst, nBb4, $06, $06, nRst, $0C, nBb4, nRst, nC5 dc.b nRst, nC5, nRst, nC5, $06, $06, nRst, $0C, nC5 smpsLoop $00, $02, SBT_Loop16 ; <--- loops into the end of Loop15, which results in doing Loop14 AGAIN implicitly ; ^^ This should've been a $02, but the overlap detection fails, because Loop16 isn't overlapping Loop14 directly
Thanks ValleyBell, I have a question, why when trying to optimising a song, for example, Introduction theme from AWS Pro Moves Soccer in a point the instruments sound out of place? I was put the loop with Midiorchestrator plus and programmed the instruments with Mid2smps, When I save the song I optimize and when listen the instruments sounds out of place any idea?
The better question is actually: Did it sound correct before optimizing the song? The chance of SMPSOpt itself breaking the song during optimization should be really low by now. If it should be the case, try using the "-p12" parameter to skip the loop detection. In any case, before-after examples are the only way to really tell what happens and where something goes wrong.
I found a minor issue with this program. It seems that when I convert a file, it resets the initial PSG envelope IDs to 0. Like, for instance, in the header, a PSG channel was assigned to start off with PSG envelope 1, but in the optimized version of it, it got changed to 0.
This never happened to me. It should keep the PSG envelope defined in the header. Can you send me an example file and the command line you used?
Nevermind, I found the issue. I was converter from ASM to BIN so I could optimize it, but I forgot to update thes1smps2asm header file to use the same parameters as the current smps2asm header. It's all good now. Tip: Never do hacking at 2 AM.
Hey, is there another place I could download this from? Vgmrips seems to be down, and the wayback machine isn't helping. :/
I'm attaching it here WITHOUT asking ValleyBell first, to save time and give you a quick mirror, but I'm going to delete it eventually, for obvious reasons, I don't like to interfere with other programmers' releases. Alright, it's been up for enough time. Attachment deleted as promised.