Log In  

This here is the Kiloman Music Encoder, or KM-Encoder for short. I made it to store the music for a Mega Man clone project that's been on the backburner for a while.

Multi-channel examples

Two covers by me, two originals by @Gruber and @BoneVolt respectively.

Cart #km_example-0 | 2023-04-09 | Code ▽ | Embed ▽ | No License
10

As many 2-channel Mega Man covers as I could fit

Originally 8 seperate carts worth of music, all in one!

Cart #kilomus-1 | 2023-04-09 | Code ▽ | Embed ▽ | No License
10

The only limit for storing music now is the character (and cart size) limit! Even SFX filters are stored properly!

It uses the full range of ord() and chr() to store the data in base-256. (A pointer from @merwok helped me bump that up from base-240!)

The Tools

How to use: https://docs.google.com/document/d/1A1dydhxVaCSEObqKKoZIaOsFkMbZXg4FakKssZkFpEQ/edit?usp=sharing

Cart #km_template-1 | 2023-04-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10


Cart #km_encoder-1 | 2023-04-09 | Code ▽ | Embed ▽ | No License
10


Have fun!

OLD VERSION:


This here is the Kiloman Music Compressor, or KCOMP for short. I made it to store the music for a Mega Man clone project that's been on the backburner for a while.

Multi-channel examples

Two covers by me, two originals by @Gruber and @BoneVolt respectively.

Cart #kcomp_example-0 | 2023-04-07 | Code ▽ | Embed ▽ | No License
10

As many 2-channel Mega Man covers as I could fit

Originally 8 seperate carts worth of music, all in one!

Cart #kilomus-0 | 2023-04-07 | Code ▽ | Embed ▽ | No License
10

It can compress any kind of sound effect, and music with any number of channels and at any length (provided your cart has the character space to store it.)

It uses the full range of ord() and chr() to store the data in base-256. (A pointer from @merwok helped me bump that up from base-240!)

The Tools

How to use: https://docs.google.com/document/d/10aF3-KLCE2ujXwpu3zjZbS1L8AXfJ9Spy1gaqlVRrE4/edit?usp=sharing

Cart #kcomp_template-0 | 2023-04-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10


Cart #kcomp_compressor-0 | 2023-04-07 | Code ▽ | Embed ▽ | No License
10


Have fun!

P#128274 2023-04-07 23:23 ( Edited 2023-04-09 17:16)

Guess this makes two of us using music compression systems to store Mega Man tracks ;). In my case I found that plain base-256 strings compressed just about as well (in terms of compressed bytes) as a complex RLE variant I made. You seem to possibly be using some additional compression methods in your code, did you notice better byte compression than raw strings?

P#128316 2023-04-08 22:55

@JadeLombax Nah I'm not compressing it any further than base-256 characters, honestly don't know if there's a way to compact the strings further without blowing up the token count.
Speaking of, I have a new version ready that I'll post soon which is nearly twice as effcient token-wise.

P#128322 2023-04-09 04:12

Yeah, I came up with a system that could encode changes in volume, note, and instrument type, but it didn't really beat the built-in compression by any significant margin and took more tokens.

As for token savings, I found that you can poke big chunks of data to memory using P8scii codes right in the string, so I'm just using a simple setup like this:

musicptrns={
""
}

musicsfx={
""
}

function decode(track)
 ?"⁶!3100"..musicptrns[track]
 ?"⁶!3244"..musicsfx[track]
end
P#128356 2023-04-09 16:57 ( Edited 2023-04-09 17:04)

@JadeLombax I... wow I'm surprised that ?"⁶!3200"..sfxdata[val] works. That's another 7 tokens saved. Doing one big poke to 0x3100 is only best used if every song is 4 channels though, otherwise there'll have to be a lot of empty space in the encoded patterns string.

P#128359 2023-04-09 17:15

Well, I'm currently using 3-channel tracks and trying to limit each one to 16 or fewer patterns, so with about 10 tracks total that's around 640 extra blank bytes in the strings. It's something, but I figure the compression should largely take care of it, and this saves tokens, but for your project it might work better to not have that blank pattern data.

P#128361 2023-04-09 17:30

I love all this music!!!

P#128388 2023-04-10 08:22

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-13 19:18:45 | 0.054s | Q:38