Language…
6 users online: anoMaly666, HD_DankBaron, Jordan, monkey03297,  Nanako, Shiki_Makiro - Guests: 236 - Bots: 333
Users: 64,795 (2,377 active)
Latest user: mathew

Posts by HertzDevil

HertzDevil's Profile → Posts

  • Pages:
  • 1
  • 2
Code
o2 q3F l8
[aa>cc<aagg aaaaar4.]2


No nested loops, no labels. Using loops just to hide away two or three notes will often consume more space than manually expanding the loops.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
Originally posted by MarioFanGamer
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 [...]
False. Although the normal loop command takes 4 bytes, AMK also adds an extra terminating $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
[...] the amount of bytes you save is in total zero bytes as if the loops were unrolled there.
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).
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
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 bytes
  • a16r16a16r16: $0C$7F$95 $C7 $95 $C7, 6 bytes (first 2 possibly elided)
On the other hand, something like the following will use more bytes if unrolled:
  • [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 bytes
  • q7Fa12q6Ba24q7Fa12q6Ba24: $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)
I have both seen and used loops like this, and very often this same loop will repeat more than 2 times or be reused multiple times (e.g. bass track), so the general rule of not using loops to save just two or three notes still applies.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
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.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
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:
  • ???: The specified sample group, "???", could not be found., the main reason behind this build
  • Could not delete critical file "???"., raised when AddmusicK cannot remove temporary files used during assembly
  • Error: "???" could not be found., raised when certain labels cannot be found in "asm/SNES/patch.asm"
  • Uncaught C++ exceptions
Additionally, the following error messages previously queried user input (through the standard input stream) even when using the GUI; these errors now reject the ROM automatically if -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.
Upgrade to Visual Studio 2017 / C++17

Several cosmetic changes in AddmusicK's source code:
  • The AddmusicK source now uses std::filesystem or std::experimental::filesystem::v1 instead of boost::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 with uint8_t, because the C++17 standard defines its own std::byte now.


Get the unofficial AMK 1.0.6 here.
YouTube · Bandcamp · Twitter · Github
Constructing Chiptune; Construing 8-Bit.
Custom theme based on Zenburn; install Lato and Liberation Mono for best results
  • Pages:
  • 1
  • 2