XML and XSLT

The AKS format is simply a zipped XML file (note that non-zipped XMLs work too). The XSD of the AKS format can be found at the root of the AT2 package.

Why XML some might ask?

Simply because this is a standard exchange format that is:

  • human-readable (most of the time)
  • quite easy to parse
  • easy to generate

Its only real inconvenience is its verbosity.

But there is one more advantage: thanks to a language like XSLT, it is possible to transform a song. With a script, one can, for example:

  • modify notes
  • generate new notes
  • mix songs into one
  • etc.

Don't hesitate to send me XSLT scripts, which can be published here for anyone to use!

Example: swap track notes

This example was kindly provided by Cpcitor. It swaps the middle (channel 2) and right (channel 3) notes.

Use:

[[code]]czoxMzk3OlwiJmx0Oz94bWwgdmVyc2lvbj1cIjEuMFwiIGVuY29kaW5nPVwidXRmLThcIj8mZ3Q7CiZsdDt4c2w6c3R5bGVzaGVldCB4bWxue1smKiZdfXM6YWtzPVwiaHR0cDovL3d3dy5qdWxpZW4tbmV2by5jb20vQXJrb3NUcmFja2VyU29uZ1wiIHhtbG5zOnhzbD08YSBocmVmPVwiaHR0cDp7WyYqJl19Ly93d3cudzMub3JnLzE5OTkvWFNML1RyYW5zZm9ybVwiPlwiaHR0cDovL3d3dy53My5vcmcvMTk5OS9YU0wvVHJhbnNmb3JtXCI8L2E+IHtbJiomXX12ZXJzaW9uPVwiPHN0cm9uZz4xLjE8L3N0cm9uZz5cIiZndDsKICAmbHQ7eHNsOm91dHB1dCBtZXRob2Q9XCJ4bWxcIiBlbmNvZGluZz1cInV7WyYqJl19dGYtOFwiIGluZGVudD1cInllc1wiLyZndDsKICAmbHQ7eHNsOnByZXNlcnZlLXNwYWNlIGVsZW1lbnRzPVwiKlwiLyZndDsKICAmbHQ7IS0te1smKiZdfUJhc2UgdGVtcGxhdGUgaW1wbGVtZW50aW5nIFhNTCBpZGVudGl0eSBmdW5jdGlvbi4tLSZndDsKICAmbHQ7eHNsOnRlbXBsYXRlIG17WyYqJl19YXRjaD1cIkAqfCp8cHJvY2Vzc2luZy1pbnN0cnVjdGlvbigpfGNvbW1lbnQoKXxub2RlKClc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