Hi!
Most of the memory used by the packed tune is used by the player code, rather than the player data. This is why you see that it takes quite some size even if you make just a small tune. Also, 5 second tunes are rarely used, so in practice this is seldom that much of a drawback.
The player code in defMON is optimized for speed rather than size. There is always a trade-off. Either you write a player which is very small and takes little RAM, but then the code will also be slower, or you write a player which is very fast, but then the code will also be larger.
It would be possible to write another player (code) which takes much less space but which is also much slower, but that is able to play the very same music data. That could be desirable in some cases, but having more than one version of the player code often complicates things, so I have opted just to go for a single "one size fits all" player for defMON — and that one is optimized for speed, rather than size. Most C64 productions tend to prioritize speed optimization.
If you have a look at the table presented in the link below, you will see that the player code in defMON is among the fastest, compared to other editors. There are some editors that are substantially faster, but then it comes at the expense of limiting the features of the player quite a lot:
http://chordian.net/c64editors.htm
So the editors that you are comparing with are precisely those editors that haven't prioritized speed quite as much as I have done in defMON (or those that are both faster and smaller, because they offer less features). In the case of defMON optimization for speed (rather than RAM size) makes sense in yet another way, which is because it supports stereo sid and multispeed. When doing a stereo sid tune in 4x speed, having a speed optimized player is almost a requirement.
Having more then one player (e.g. one optimized for RAM size and another one optimized for CPU speed, and perhaps yet another one which is somewhere in between these other two) for the same editor also complicates things in the sense that the tune will sound sliiiightly different since the SID registers are written at slightly different times, depending on how fast the player code is that you are using. People tend to complain about that.
Did you ask out of curiosity, or because you are actually in a situation where you need a tune that is smaller than the one that the defMON packer has produced for you? Like, for something a one file demo where a lot of things has to fit in RAM at the same time, and so forth? For "special occasions" I can do some manual work on a packed tune, to pack it a bit further than the packer in defMON is able to do. This isn't something that is going to be implemented in the packer, precisely because it requires some manual work. That still won't make the playe code smaller though. It is just a matter of packing the music data a bit further. If you really need super small tunes, then defMON would probably simply be the wrong choice.
Here is a link to a tune that I created once, where the player code and the player code together only takes 256 ($100) bytes. That was clearly optimized for size though, and it (obviously) wasn't created by defMON:
https://codebase64.org/doku.php?id=base
une_player
https://deepsid.chordian.net/?file=/MUS
_Block.sid
...and another one which is also only 256 bytes:
https://deepsid.chordian.net/?file=/MUS
_bytes.sid
Last edited by frantic (Sep 21, 2020 6:01 am)