Free... music?

BlitzMax Forums/BlitzMax Module Tweaks/Free... music?

Hotcakes(Posted 2004) [#1]
At one stage it was mentioned that the FMOD guys might be releasing some sort of free (re: cheap and nasty:) module replayer sources and that might make it into Max. I was wondering what the status of that was? Did it fall through, or is it something we're likely to be treated to in the foreseeable future?


skidracer(Posted 2004) [#2]
I have the source but won't be touching it until after we achieve a proper Linux/Win32 release.


Hotcakes(Posted 2004) [#3]
I see. No point writing my own then. Thanks. =]

EDIT : Actually, would it be legal to release the source in the meantime? Replayers are my field of expertise and I wouldn't mind (re: really looking forward to:) having a tinker... or is it available from the FMOD site?

There are some more exotic formats I've been wanting to write support for since the Blitz2D days... but Max let's me do *stuff* better =]


Russell(Posted 2004) [#4]
The more the merrier! If you have a module player that works and you're willing to release it to the community, I say go for it!

I tried writing an .xm player in PureBasic, but ran into a hitch when it came to controlling the audio card at a low level. (Actually, I now know that this functionality is basically included in the OS, though not documented as well as I would like).

Anyways, with literally thousands of mods out there, having this ability would be a great boon, especially if it can be adapted to Mac and Linux as well (Audiere would be a great choice here, perhaps stripped to its bare mod-playing essentials for size\efficiency reasons).

On that note, I feel we should try very hard to make sure that the functions we add can be adapted to all versions of BlitzMax to keep this language a true cross-platform compiler. If, for example, someone writes a GUI module, it would be quite helpful if the same code opens\manipulates native windows on that particular OS. This way, Mac windows look lke Mac windows, and Windows windows look like Windows windows, etc. I don't know if the event callback structure would be the same on all platforms, but I have confidence that this too can be accomplished across all platforms.

Russell


Hotcakes(Posted 2004) [#5]
I'm only willing to add to a base, unless none exists. If there is already a base (like a miniFMOD lib) then firstly I don't want to reinvent the wheel and secondly, anything I invent is more likely to resemble a square anyway. I like square waveforms, but wheels don't translate too well when they have corners. </ramble>

I was going to build in sound loaders for freeaudio aka freemusic but I'll wait to see how this turns out first.

I'm gunna take the lack of response as a 'shove off and wait you git' so in the meantime I'll do some sample loaders instead. Maybe. If I can stop playing with Xmas presents. =]


Russell(Posted 2004) [#6]
I think a lot of us are kind of playing the waiting game when it comes to forthcoming modules: We know a lot of them are in the works, so to speak, but don't know what they will entail and so don't want to, as you say, re-invent the wheel.

What would be nice would be a listing of modules that BRL et al are planning for the near future. I think it is safe to assume that 3D will be one of them, and probably a GUI module, but I'm sure I'm not the only one who is curious as to how this will be implemented (a'la Blitz Plus, or some new\better command set?).

Anyways, it's nice to have a real feeling of community contribution towards a common goal: BMax superiority! ;) Hopefully Mark\BRL will announce shortly what the official module inclusion procedure is going to be so that we can keep everything from spinning out of control.

Russell


LeisureSuitLurie(Posted 2004) [#7]
MOD playback would be very cool. If we can't get midi support easily, MOD will do.


Hotcakes(Posted 2004) [#8]
@Russell : I agree wholeheartedly. I know of 2 modules in development right now (both GUIs - one based on BlitzPlus (windows side) and another based on FLTK (Linux side)). Skid has given good indication they intend to release a music/replayer module in this thread and Mark is clearly interested in writing the 3D module. But other than that, their minds are a mystery box =] I guess four modules is enough for them to worry about before saying anything more.

@LeisureSuitLurie : Some clever git has already devised some midi playback routines, if you can't wait - can't remember where around here those routines were posted though, and I think it was Win32 only.


Russell(Posted 2005) [#9]
@LeisureSuitLurie (In the land of the lounge lizards?): Although MIDI files are amazingly small, I've not been overly impressed by any of them (If you know of any cool midi websites with really impressive examples, let me know!) Anyway, I personally think that MODs (especially the more advanced formats such as .md2) offer far more versatility overall and can really sound amazing.

@Riot: On the topic of a GUI module, I suppose there are a number of ways they could be done, all with advantages and disadvantages:
1) Write the GUI functions in BMax using the bgl\ogl commands. This would make the module pretty much immediately portable to the other platforms, and would make the GUI look the same on all platforms (an advantage or disadvantage, depending on how you look at it). But would it be more trouble than it's worth for creating stand-alone applications?

2) Have different modules for different platforms that 'talk' to the underlying OS, but have the commands have the same names and usage. The advantage here is that code would be portable and the GUI would look like a native GUI for that platform. The disadvantage is that only the features that are supported on all platforms could be used, and so special features on MacOS, for example, would have to be implemented some other way.

Using this last scenario, how do we then construct a proper event-driven application program that opens windows, creates buttons and responds to events, etc on all platforms?

This is one that I think needs careful thought if we want to keep BMX truly cross-platform. And I, for one, do!

What are your thoughts on this?

Russell


Bot Builder(Posted 2005) [#10]
Yes, of course. You can have real music in mods, in midi you cannot. Also, midi quality is determined by your sound card. It will sound completly different on different cards. Mods are basically midi files (ok, so completly different format but hey) that include their basic sound effects.

@Russel

This has been discussed before. And apparently implemented in different languages than blitz. The solution is an abstraction layer between your program and the OS that works differently depending on the target OS, however you use it in the same way. One solution is wxWindows which is a cross platform native gui lib that works on multiple platforms. This could be directly used by BMax or Mark could mirror the method and improve. Python lib tkinter has 3 methods, the one im most familiar with allows you to set your gadget's positions in rows/columns kinda like an html table where your elements can have row/colspans. Then, it decides how to lay it all out and the size of the window. My personal favorite is one that I dont think has been used before - let the user decide. Basically, bmax will supply data about the size of the OS's controls, and you will access this data to decide the exact method of layout. Mark could also release a lib on top of this that automates the process, while allowing those that want it the power of direct access.


xlsior(Posted 2005) [#11]
Although MIDI files are amazingly small, I've not been overly impressed by any of them


While digitized music like MP3 or MOD's sound prettty much identital on every computer, there is a *huge* range of quality differences of MIDI from computer to computer.

I used to have a Yamaha DB50-XG synthesizer add-on module on my old SoundBlaster AWE32, and it completely blew the AWE32's built in midi capabilities out of the water.

MIDI -can- sound great. The big disadvantage of midi is that you never know what it will sound like on any particular PC -- on some it might only be a marginal improvement over using the ol' standard PC beeper. :-?


tonyg(Posted 2005) [#12]
From the BMX front-page blurb...
"Modules are also a great way to distribute 'libraries' of commands, and Blitz Research have many weird and wonderful modules lined up for future release!"
I don't consider the 3D, GUI or music modules 'weird and wonderful' so a peek at the list would be interesting.


Hotcakes(Posted 2005) [#13]
What are your thoughts on this?

Basically where cross platform apps are concerned, it's one big ugly mess =] It's easy enough to get your basic buttons and basic gui elements working across platforms, but even the 'Event'ing is handled so different across platforms it really is a nasty thing to tackle. I think your scenario 2) is worth more time considering than scenario 1), but that's personal taste - I don't like the thought of BlitzMax programs being distinguishable. I think the best solution (and I came up with this on my own, so it's likely to be a very flawed idea:), is to make one module dedicated to each platform, with platform specific code (obviously) and implementations, then a fourth 'wrapper/helper' module that tries it's best to tie them all under one umbrella. Kinda like how Max2D works with OpenGL - it's an abstraction on top of the OpenGL module, which ultimately means you can use OpenGL code in between Max2D code. The same thing would apply for this GUI idea, if you need more functionality than the standard helper module provides, you can go between the lines (esp if you're only coding for one platform) and use the platform specific commands as well. After all that is done, then, and only then, would I consider a fourth 'OS' module, which implements a crossplatform 'home grown' GUI system, like your option number 1).

Mods are basically midi files (ok, so completly different format but hey) that include their basic sound effects.

Basically the equivalent of a midi file with an attached patch file.

I don't consider the 3D, GUI or music modules 'weird and wonderful' so a peek at the list would be interesting.

The only other rumour I have heard is that of a 'database' module, but this rumour was very vague.


Russell(Posted 2005) [#14]
@Bot Builder: wxWindows sounds like a great plan. And if it's open source, then even better! Hopefully, the way it is "officially" implemented (hopefully, an 'official' module for this will be released by BRL in addition to the 3rd party ones that I'm sure will be released) will be powerful, portable and reasonably easy to use... Although being able to directly work with the different OS's APIs would be a great plus (Just in case you want to work with only MacOs, for example).

@tonyg: Yes, a look at the proposed list of forthcoming modules would be nice indeed! I guess Mark has his hands a little full at the moment, though ;)

@xlsior:

While digitized music like MP3 or MOD's sound prettty much identital on every computer, there is a *huge* range of quality differences of MIDI from computer to computer.


Exactly. In fact, that's the very reason I prefer MODs: They sound pretty much exactly the same on every platform that can play MODs (naturally, the quality of the MOD player can have a significant impact as well).

I have confidence that BRL will 'do the right thing' in the GUI module that it will eventually release. And with Audiere (ala D.U.M.B.) being open-source and adaptable to our needs :) I think we will see something along these lines in just a few months or so... <crosses fingers>...

Russell


flying willy(Posted 2005) [#15]
MODS also support ogg vorbis compressed samples, leading to not only versatile playback (ie for mood) but also really small music files. You could have 30 tracks take up the space of 3 tracks if the same sample pool is used.


Panno(Posted 2005) [#16]
how about mo3 and the bass.dll ?


LeisureSuitLurie(Posted 2005) [#17]
@LeisureSuitLurie (In the land of the lounge lizards?): Although MIDI files are amazingly small, I've not been overly impressed by any of them (If you know of any cool midi websites with really impressive examples, let me know!) Anyway, I personally think that MODs (especially the more advanced formats such as .md2) offer far more versatility overall and can really sound amazing.


@Russell: The point is to avoid having to use a huge ogg for a soundtrack. Some MIDIs sound fine for most purposes. I have no problem with using MOD instead, although Mac does not have the number of MOD trackers you guys do...


Russell(Posted 2005) [#18]
Oh, no arguments here: Size is one of the main reasons I would use a MOD over a (basically) non-dynamic wave file (be it Ogg, MP3, Wav or whatever). If you have a look at the mods at, for example, "The Mod Archve", you'll notice that a lot of them are considerably small (<500k).

MOD with OGG support is even better, but I'm not sure if this would be supported by Audiere, if that is what is used.

However it's done, I sincerely hope that portability of BMX source code and modules remains consistant. In the long run, for the programmer wanting to do cross-platform programming this is the Holy Grail.

We'll see what happens in the next few weeks and months...

Russell


shqwerty(Posted 2005) [#19]
I found a library on the net called mikwin (gpl licensed). MikWin is a decendant from Mikmod (multiplatform, mikmod.raphnet.net/). I compiled MikWin to a dll and wrote a wrapper for it. Though not yet fully tested/debugged.

MikMod should be able to run under all operating systems, though I wasn't succesful in compiling it with MingW, so feel free..... Would be cool to have a multiplatform music library.

Following music formats are supported:
669 (Composer 669, Unis 669), AMF (DSMI Advanced Module Format), AMF (ASYLUM Music Format V1.0), APUN (APlayer), DSM (DSIK internal format), FAR (Farandole Composer), GDM (General DigiMusic), IT (Impulse Tracker), IMF (Imago Orpheus), MOD (15 and 31 instruments), MED (OctaMED), MTM (MultiTracker Module editor), OKT (Amiga Oktalyzer), S3M (Scream Tracker 3), STM (Scream Tracker), STX (Scream Tracker Music Interface Kit), ULT (UltraTracker), UNI (MikMod), XM (FastTracker 2)

files:
62.131.157.223/blitzmax/mikwin.bmx
62.131.157.223/blitzmax/mikwin.dll
62.131.157.223/blitzmax/SA_WOLF.XM
62.131.157.223/blitzmax/mikwin_3.1.5.3.zip (requires vc6 to compile)

Have fun,
Niels


Russell(Posted 2005) [#20]
Ah, very nice! But I'll leave it to the professionals to integrate it into the BMax environment (I know a lot of people are waiting for this ability).

Dlls are fine, but I'd prefer a static link option if possible. :)

Russell

p.s. "d.u.m.b." is also available and supports many of the same formats (and additional ones as well).