Posts by HertzDevil
HertzDevil's Profile → Posts
- Pages:
- 1
- 2
Originally posted by MarioFanGamer
False. Although the normal loop command takes 4 bytes, AMK also adds an extra terminating In this case, if one replace all the loops into superloops in this note pattern than the amount of bytes you save is in total zero bytes [...]
$00
at the end of the loop data because all normal loop data is flushed to a separate "channel 8" chunk. Therefore 5 bytes can be saved by replacing loops with superloops, other things unchanged.Originally posted by MarioFanGamer
Also false in this case, because every time a loop is issued AMK will re-insert the current note length and gate (even though they are unnecessary for this MML string).[...] the amount of bytes you save is in total zero bytes as if the loops were unrolled there.
Originally posted by MarioFanGamer
[...] if you take the above sequence and replace the loops with superloops then there wouldn't be a difference in size to the unrolled sequence since these loops takes four bytes.
Except there would be a difference for this particular case, because AMK elides unnecessary length and gate commands for normal notes, which means these unrolled loops take two fewer bytes starting from the first repetition, viz.:
[a16r16]2
:$E9$xxxx$02
+$0C$7F$95 $C7 $00
, 9 bytes[[a16r16]]2
:$E6$00 $0C$7F$95 $C7 $E6$01
, 8 bytesa16r16a16r16
:$0C$7F$95 $C7 $95 $C7
, 6 bytes (first 2 possibly elided)
[q7Fa12q6Ba24]2
:$E9$xxxx$02
+$10$7F$95 $08$6B$95 $00
, 11 bytes[[q7Fa12q6Ba24]]2
:$E6$00 $10$7F$95 $08$6B$95 $E6$01
, 10 bytesq7Fa12q6Ba24q7Fa12q6Ba24
:$10$7F$95 $08$6B$95 $10$7F$95 $08$6B$95
, 12 bytes (first 2 possibly elided, but hardly any music would do that)
Code
[[r1]]63 r2..
A superloop behaves like a normal loop but saves more space (normal loops are really anonymous label loops), and should always be considered for loops at the top level. To optimize even further you could do
Code
[[r4..]]146
Since notes that are longer than or equal to a
{r1}
/ r=128
generally require at least three bytes instead of at least one.In fact, both
r2^4^8
and r2..
should compile to the same data, and since AMK automatically combines adjacent rests, even r2r4r8
should do the same thing. The difference comes in when later you might want to split the rest and insert other commands in between.I have decided to claim the authorship of version 1.0.6 myself after seeing the same screenshots at the Discord music channel every now and then. The executable and the changed source files are available at the end of this post; just copy AddmusicK.exe to an existing AddmusicK directory (after possibly making a backup of the original file). If this works as intended I will submit the whole archive to the Tools section later. Last time I checked, the 1.1.0 beta did not have these changes.
These are the (only) changes in this build:
Write error messages to standard error stream
All strings that indicate abnormal program termination are now properly written to the standard error stream instead of the standard output stream. From the command prompt there are no visible differences; however, the AMK GUI depends on these streams so that only the error messages and not the progress indicators are shown if an error occurs. When the program returns a non-zero exit status, the GUI displays the error stream instead of the output stream; if error messages go to the wrong stream, the user will not see them at all, instead seeing an empty dialog box. In particular, the following previously unseen messages are now available through the GUI:
Several cosmetic changes in AddmusicK's source code:
Get the unofficial AMK 1.0.6 here.
These are the (only) changes in this build:
Write error messages to standard error stream
All strings that indicate abnormal program termination are now properly written to the standard error stream instead of the standard output stream. From the command prompt there are no visible differences; however, the AMK GUI depends on these streams so that only the error messages and not the progress indicators are shown if an error occurs. When the program returns a non-zero exit status, the GUI displays the error stream instead of the output stream; if error messages go to the wrong stream, the user will not see them at all, instead seeing an empty dialog box. In particular, the following previously unseen messages are now available through the GUI:
???: The specified sample group, "???", could not be found.
, the main reason behind this buildCould not delete critical file "???".
, raised when AddmusicK cannot remove temporary files used during assemblyError: "???" could not be found.
, raised when certain labels cannot be found in "asm/SNES/patch.asm"- Uncaught C++ exceptions
-noblock
is specified or the GUI is used, and also correctly flush the messages to the standard error stream:Error: The identifier for this ROM, "???", could not be identified. It should be "@AMK". This either means that some other program has modified this area of your ROM, or your ROM is corrupted.
WARNING: This ROM was modified using a newer version of AddmusicK. You can continue, but it is HIGHLY recommended that you upgrade AMK first.
Several cosmetic changes in AddmusicK's source code:
- The AddmusicK source now uses
std::filesystem
orstd::experimental::filesystem::v1
instead ofboost::filesystem
, whichever is available, so that developers now have one fewer external dependency to worry about. - LodePNG is now added to the source archive, so AMK should now build without extra configuration.
byte
has been replaced withuint8_t
, because the C++17 standard defines its ownstd::byte
now.
Get the unofficial AMK 1.0.6 here.
- Pages:
- 1
- 2