Community > Project / Coder's Corner

Any good Unity asset for playing Modules?

(1/2) > >>

Hi all,

I'm working on a google VR/cardboard project in unity. For the time being, I have been exporting my tracks to MP3 format for use in the project, which works.

But I was curious if there are any decent Unity assets for module playback. I can convert to several formats obviously, but .IT support would probably work best, or .MPTM.

Also, would I be best off using an MP3 for music? How big of a resource hit would I take by playing modules directly? bear in mind, it's a VR game for android, so resources are scarce to begin with.

Anyone with experience in this matter chiming in would be appreciated.

EDIT: I just read another post by the Unity Devs on here that mentioned native module support; I looked into it and I did find out that, yes, it supports ImpulseTracker modules natively. my bad.

Still, if anyone knows of an asset for Unity that supports OpenMPT modules, that's be great. and my other question regarding resources is still valid. Gotta keep that framerate high!.

Quick update on this topic:

Okay, I've tried it out; Converted an .mptm song to .IT format; dropped it into my project and there are some issues. If you're interested on my findings regarding modules in unity, read on...

Unity apparently supports .MOD .XM .S3M and .IT formats... Here's why:

Firstly the Unity engine uses FMOD for module support; needless to say, the module used didn't quite sound right in-game. Some samples, volumes and effects were a bit "off" but it would be passable if I worked around it with my composition. Seems to run good on the PC, I still have to compile and test on actual hardware to find out about the performance hit.

Next is file size. Unity's Module support would go a long way if you were using formats that would save space, such as old school MODs or other formats where you use fewer tracks, or if you are using only a handful of short, simple samples but in my example, My Module was almost 26MB, way larger than if I were to convert it to an MP3, which would probably be less than 3MB (almost 10x smaller)

However, if you keep your modules small, you can use scripting in the game to do things like change track volume, or enable/disable  tracks, etc. although I'm still looking at the docs to find out how to use these features. This could make for some interesting in-game features.

However, Seeing as to how playback is not accurate to how I intended it to sound, and the smaller size of an MP3; it looks like that's the route I'll be going. At least if I mix it to an MP3 in OpenMPT, it will preserve all the VST effects and playback will be accurate, not to mention make the final APK smaller.

Maybe I'll try to make some tiny modules for certain parts of the game where the track loops and such, while other parts use MP3 files instead.

Just thought I'd share my experience with this so far. Feel free to share ideas and input on this; I'm all ears!  ;D

Saga Musix:
I think I have seen other module players used with Unity as well (libmodplug/mikmod maybe?). If you are okay with doing a bit of coding yourself, you can try out OpenMPT's own rendering engine, libopenmpt. It can emulate most of the basic DirectX effects that are usable in OpenMPT also on other platforms, and while they are not as high-quality as many VST effects, they can still boost the quality of small files tremendously. You could even use the MO3 format which is a compressed variant of several popular module formats, including IT and MPTM.
And  even without using MO3 or libopenmpt, you can still shrink your IT files in OpenMPT:

Thanks for the info; I checked out the link re: compressing modules. I had already run the module through a cleanup which brought it down to half the original size; It's now at 11MB. If I strip the stereo samples down to mono, and maybe lower the sample rate a little I can probably get it smaller.

I'm not adverse to trying to write code to get another player to work with Unity; but I've been writing a LOT of code lately in regards to the game I'm developing. I may have to revisit that in the future; I could always put the end result up on the Unity asset store for others to use If I come up with another solution.

I'll be doing some more testing in hardware; I'll see how good I can get my app to perform with unity's module engine. Worst case scenario, I stick with MP3's as there isn't too much of a performance hit on Android.

Thanks for the input  ;D

I'm actually working on a final degree project on Unity, AR oriented. My intention is to play a tracker song (.mod, .xm, .s3m, .it and also .mid songs) to visualize a live concert with virtual artists who'd play the instruments with the right notes extracted from the tracker files somehow. The problem here is that i don't know if it's possible to get that kind of information (number and type of instruments, played notes, ...) directly from tracker music in Unity. After this time have you got into any interesting result or improvement on your work?


[0] Message Index

[#] Next page

Go to full version