Acknex pxtone plugin

Posted By: Kartoffel

Acknex pxtone plugin - 06/01/17 21:12

Hey there,

Not sure if it'll be helpful to anyone but I started making an Acknex wrapper for pxtone by Daisuke "Pixel" Amaya (the Japanese guy who created Cave Story). It's a somewhat minimal music format he made a while ago, including a complete set of tools (called "pxtone Collage") for creating & editing music files in this format. It's primarily targeted towards more "retro" sounding tracks and has been used in some of his games (including Cave Story). One advantage is that the files are generally really small, unless a lot of .wav samples are used while providing lossless 16bit stereo audio.

in case you want to know more about it:
http://www.cavestory.org/pixels-works/pxtone-collage.php (more links, related stuff, sourcecode, download including english translation, etc.)

Right now, the wrapper I'm making can load a file (both .ptcop & .pttune), extract the track name from the file and sample the track into an Acknex SOUND* object (which can be played by the engine). At the moment there's no on-the-fly "live" sampling of tracks but I'm not sure if it's really needed.
(the updated version can do more)

So if (for some reason) anyone wants this wrapper, let me know and I'll upload it once it can be used.

regards,
Kartoffel

-----

newest version (03.06.2017 update3): download (Dropbox)

Code:
New Changes:
- removed all the unnecessary 'Ack's from the names ("AckPxtn_..." -> "Pxtn_...")
- PxtnLoader improved
- PxtnLoader: on-the-fly streaming of Pxtone files (kind of experimental, but works)
  (causes less memory consumption, but slightly more CPU usage than prerendered tracks)
- acknex-style file loading (search paths are now used)
- support for loading pxtune files directly from memory (useful for encrypting songfiles)
- made a pxtone banner that you can show in the credits
- minor fixes
- fixed some typos

TODO:
- OpenAL support
- bugfixes?

Posted By: 3run

Re: Acknex pxtone plugin - 06/01/17 21:15

Hey!

I'm always interested in oldschool stuff! grin Would be great to have such a useful tool! What about license stuff?

Best regards!
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/01/17 21:24

Well, my Japanese sucks and so does Google Translate. grin

But as far as I understood the license it's free to use. There's also an implementation for game maker. On the forums it says: "I believe Pixel asserts that there is no limitation on pxtone's use but asks politely to attribute him for his work. To do so he asks for you to use the banner he provides, pxtone.bmp, in anyway you like."

(Edit: In the readme I have it doesn't really say anything about a banner, although from what all these different sources say it's pretty clear that the software is free to use and the dev would appreciate being mentioned somewhere if possible)
Posted By: 3run

Re: Acknex pxtone plugin - 06/01/17 21:26

Great to hear this! Looking forward for it! laugh
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/01/17 22:46

Here's a first, wip version: download (Dropbox) (updated, see first post for download)

It's still missing some stuff and needs a few bugfixes.
Posted By: 3run

Re: Acknex pxtone plugin - 06/01/17 22:56

It worked here! I loved the tune btw! laugh
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/02/17 11:58

Originally Posted By: 3run
It worked here! I loved the tune btw! laugh
great to hear! and yeah, I really like the music in CaveStory, too laugh

Updated the plugin. Info and download in the first post wink
Posted By: 3run

Re: Acknex pxtone plugin - 06/02/17 20:22

Updated version works as well! Will your wrapper be able only to load .ptcop files, or are you planning to use if for creating them too?
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/02/17 21:44

I won't make a tool for creating/editing those files. There's already the official "pxtone Collage" and it would take ages to create a program that can match it's level (or even a better one).
Posted By: 3run

Re: Acknex pxtone plugin - 06/02/17 21:52

Well, being able to load them into the Acknex is already awesome! And it might be a right way to do, not even trying to pull those creating/editing tools into the wrapper. Gonna check that 'pxtone Collage' out.

Best regards man! Thank you and keep it up! laugh
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/03/17 09:34

Thanks a lot laugh

The programs used to create those files are a bit strange to use (they're not super intuitive in my opinion), especially if you haven't used any DAW software before. But once you're familiar with them it's not as bad grin
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/03/17 14:01

So, this is probably the (second) last update for the AckPxtone plugin.

The only thing I'd like to fix is OpenAL support, other than that I'm happy with the result.

Once again, all the new stuff is in the first post
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/03/17 17:34

Okay, I'm just now realising that once I compile my script to an executable, pretty much any dll-function call crashes the game. Does anyone know what's causing this?
Posted By: Ch40zzC0d3r

Re: Acknex pxtone plugin - 06/03/17 17:42

Use LoadLibrary and GetProcAddress and dont let the engine load dependencies
Posted By: Kartoffel

Re: Acknex pxtone plugin - 06/03/17 20:20

I tried it but the result is the same. I also realized that the crash is somewhat random (sometimes it works the way it should) smirk

edit: I changed something and it seems to work now
...just in case: This is how I'm supposed to do it, right?

Code:
HMODULE HAckPxtn = LoadLibrary("dll\AckPxtn.dll"); // the forum code-box deletes the double backslash o.O

_Pxtn_CreateInstance = GetProcAddress(HAckPxtn, "_Pxtn_CreateInstance");

etc...

Posted By: Ch40zzC0d3r

Re: Acknex pxtone plugin - 06/03/17 22:24

Yes that looks right, the forum seems to try to escape "\" by deleting one. Using four works fine => "\\"
Anyways, you can make sure everything is right by checking the return values for 0.
Both functions return 0 incase of a failure
© 2024 lite-C Forums