Reverse engineer Makecode arcade song hex buffers

So I told ChatGPT to generate a Makecode song hex buffer. It didn’t work, so I asked one more time and it generated two (almost) correct tunes that worked. It worked so good that I asked ChatGPT again to make Python code and it worked but the actual song didn’t and it just sucked. I know you’re just going to ask me to use @UnsignedArduino’s Midi song converter for Makecode. But it sounds like crap and I’m not going to use something that only supports a midi file that is like one instrument. Anyone at microsoft or something should know how the Makecode song buffers work (because they’re the ones that coded it) so I want to know how to covert midi files or rttl ringtones to be converted to the Makecode song hex buffer. Thanks!

1 Like

@maxitolplayer the format is documented here:

if you’re not used to working with binary encoded files then it can be a little tricky to wrap you’re head around. let me know if you have any questions!

2 Likes

Might also help

Do you have an example where it sounds very bad?

It’s due to lag and it sometimes has really high notes and sometimes lags out and plays a bunch of notes at the same time and i’m saying that it only supports a midi file with one track or channel and it lags due to excessive polyphony on different instruments.

Hello I saw this post but I still can’t figure out which parts of the hex mean what and how to generate a hex based off that. I saw the documentation in instrument.ts but I don’t fully know what it means. Is there some sort of in depth documentation or guide that I could use to attempt to reverse engineer this?

@releca52 nope, that big comment is the only documentation on the format. if you let me know what you’re stuck on, i can try and point you in the right direction

also, the code for the actual encoding/decoding of songs is in that file i linked above. if the comment is confusing, that code might make it a little easier to understand (or you could always just take it to use for yourself)

Thanks thought that it was same as music.ts in explorer. Mb

For RTTTL, you could use this.