JMTrackr

Monkey Forums/Monkey Programming/JMTrackr

ElectricBoogaloo(Posted 2013) [#1]
One of my big issues with both BlitzMax and Monkey is the lack of simple "PlayMod" command.

I can't begin to explain my love of Mods, but it essentially boils down to small filesizes, and the ability to hop around and loop them and do other lovely things with them that you just can't do with a bog-standard mp3 stream.

So, armed with my recent "Image Loader" exploits, and with only a Monkey and BlitzMax by my side, (because the cat doesn't like the company of people) I decided to finally tackle my Music Engine once more.

I've done it once before in my BlitzMax framework, but it wasn't the most user-friendly experience, and had to be done piece-by-piece. I ended up neglecting it, and it only got used in about 3 or 4 of my BMax games.
So this time around, I started by building a proper Tracker-style interface for the thing, first. Usability is the key!

My first release includes the entire BlitzMax sourcecode for the tracker and player, as well as a simple Monkey sourcecode demo thing that you *should* be able to easily chuck into your own projects.

It's not AMAZING, it's not even really finished if I'm honest, but it's up to a working standard, so it's good enough for an initial release.

I'm 100% certain that the code could be better/neater, (I am NOT a neat coder!) and there are a million ways to make the player that much more awesome. There's also a lack of feedback/info functions, which I'll definitely be adding in later, for "Music Game" type events and things. Mmmm..
But for now it "works", and.. given that I only just started working on this last week, it works pretty darned well!

JMTracker Download
Includes
. JMTrackr (with instruments and a bunch of silly little tunes)
. JMTrackr BlitzMax Sourcecode
. BlitzMax Demo Sourcecode
. Monkey Demo Sourcecode

Youtube Video which may or may not help you understand it!

Feedback appreciated.
If you use it, lemmie know.


MikeHart(Posted 2013) [#2]
Like I said in the google community, thanks for sharing this. I really like it. Still trying to figure out the random part of it, but you really created some useful tool here. And I don't think you will use it alone ;-)

Does it save fine on Windows in all places? On OSX when I try to save it on the desktop, the path is cut somehow and it doesn't save it. If you don't have an OSX system, I can look into this and send you a fix.


ElectricBoogaloo(Posted 2013) [#3]
To be honest, it doesn't save very well at all in most places, and should probably only be saving to "Program Folder/tunes/".. It slices the pathname up to make it easier for lazy coders (ie me) to plonk tunes into their games really quickly without faffing about with folders and things.
If you want it to do more, feel free to fiddle about with it, and let me know what you get going on.


caffeinekid(Posted 2013) [#4]
This is great but I would love to see a simple tracker player mod bundled with Monkey still. Especially for mobile platforms where size matters it could be a "killer app" to be able to include lots of tunes in your game without making it fill your phone or tablet's memory.


muddy_shoes(Posted 2013) [#5]
A modplayer certainly has uses. The problem with using one in Monkey is timing. Both the update timing and the sound playback latency are untrustworthy on certain targets. It'll likely work well enough in most circumstances (as long as your code fits the framerate) but needs caution on targets like HTML5 and Android.

Also, there are obviously issues to be worked around when doing chunky tasks like loading levels if you want music to keep playing while doing it.


caffeinekid(Posted 2013) [#6]
I wonder if someone could wrap this easily for Monkey?

http://www.peculiar-games.com/libmodplug-in-android/andmodplug

I wish I knew how to do that stuff but I can barely use Monkey and don't have a clue about Java and stuff. :)


maverick69(Posted 2013) [#7]
I've wrapped the PlayMod-Commands of Bass from Un4Seen for Monkey some time ago (but only iOS Target). It was experimental but it played XM-Mods and you were also able to use Monkeys Sound-Commands at the same time. If you're interested I can share the code (although it wasnt' much code, just a few glue-functions and extern-defintions I think).