• Welcome to Dark Bit Factory & Gravity.
 

Freebasic MiniFmod 1.70

Started by Rbz, December 24, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rbz

This is my little present for the freebasic users  :xmas:

MiniFMOD 1.70 by FireLight Multimedia.

A special minifmod version capable to load songs from memory buffer (using bin2bas ;) ) and an easy function to retrieve song sample/notes from current song playing.
You can now synch your intro with song, choosing a specific sample/instrument or note for each channel, you can start an effect with a particular note, make transitions etc, or even create a specific channel only for intro synchronizations , the possibilities are endless :)

Special thanks goes to Hellfire for writing a tutorial about how to sych with minifmod.


Functions:
==========

MiniFmod_Init
MiniFmod_Play
MiniFmod_Stop
MiniFmod_Free
MiniFmod_GetOrder
MiniFmod_GetRow
MiniFmod_GetTime
MiniFmod_GetSynch
MiniFmod_GetChannels
MiniFmod_SetVolume *new*

To install:
-----------
From "freebasic_minifmod170.zip" file extract and copy the file "libminifmod170.a"
library to the freebasic install folder:
Eg.:   C:\FreeBasic\lib\win32
And "minifmod170.bi" to the folder C:\FreeBasic\inc


Check out example test folder

Challenge Trophies Won:

Shockwave

My word!

How easy to use can it be? :)

Thanks Rbz, this means that it will be a piece of cake for anyone to write programs in freebasic that need spectrum analyzers, vumeters / music synch.

Thank you to Hellfire too for working on the tutorial.

I've tried it already with a few songs, it works really nicely and just in time for me to start my text mode demo too.

K+++

Shockwave ^ Codigos
Challenge Trophies Won:

ninogenio

oh cool cheers rbz k+,

sticky it please!
Challenge Trophies Won:

Shockwave

I have a question though rbz :)

When using getsynch, to return the note, what is the possible range please?
For example, is there a note returned between 0 and 128 for example?
Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

Thanks!

Quote from: Shockwave on December 24, 2008
I have a question though rbz :)

When using getsynch, to return the note, what is the possible range please?
For example, is there a note returned between 0 and 128 for example?
For notes the range are 0 to 133,  where 132=none and 133=keyoff
For samples/intruments the range are 0 to 99


Challenge Trophies Won:

Shockwave

Ah nice, I wasn't far off.

Thanks mate.
I have been playing with it.. Sorry for the buggy example, just hacked together in the last 10 mins :D
Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

Challenge Trophies Won:

Clyde

What music formats can this play?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Rbz

Fast tracker II format - ".xm"
Challenge Trophies Won:

Clyde

Ah ok, cheers for the info.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Clyde

Spotted an easily made typo in the example program.

channel = MiniFmod_GetChannels()
Should be:
channels= MiniFmod_GetChannels()

Kept wondering why I hade zero channels. :D
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Jim

In FB you can avoid that kind of mistake, add:

Option Explicit

At the top of every file.
Then FB won't let you use undefined variables.

All good high level languages make you define variables and variable types before you  use them.

Jim
Challenge Trophies Won:

Clyde

Thats what I use all the time Jim,

And something else, I dont think GetChannels is getting the correct amount, I have an xm song that in MPTrack aka ModPlug uses 16 channels, but in MiniFmod reports only 12.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Clyde

Is there a chance you can add in volume control for the overall song? As it would be pretty cool to be able to do stuff like fading in and out of the tune.

Big thanks,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Rbz

The original minifmod doesn't have a function for volume control, and I'm not sure if I could change the original source to add one  :-\
Challenge Trophies Won:

hellfire

The easiest way to add volume control is probably "FSOUND_MixerClipCopy_Float32".
Challenge Trophies Won:

Rbz

@Hellfire: thanks, but what I meant was, can I change minifmod source without permission or I'm being too much purist :)

Btw, you are right, it's easy to modify FSOUND_MixerClipCopy_Float32 function and add a volume control.
Challenge Trophies Won:

hellfire

I guess so:
Quote*** Disclaimer and legal ***
----------------------------
- *MiniFMOD is not FMOD*.  The code is a complete hack, and does
  by no way represent the source contained within the main FMOD library. 
  I stripped and copied code around, took out functions and
  inlined them (ie i put waveout code in the music file!), and generally
  turned it upside down to try and squeeze some size!
- MiniFMOD may not replay XM files 100% as FMOD does, due to some cutting of
  corners.  It seems to be ok so far.
- This source is provided as-is.  Firelight Technologies will not support or answer
  questions about the source provided.  (unless there are some REALLY nasty bugs..
  remember im NOT going to spend time on this! fix it yourself!)
- MiniFMOD Sourcecode is copyright (c) 2000, Firelight Technologies.
- This source must not be redistributed without this text.
- The source can be modified, and redistributed as long as no copyright or comment
  blocks (see at the top of each source file) are removed.
Challenge Trophies Won:

Rbz

Ok then  ;D

Library updated:
Added - MiniFmod_SetVolume

Use MiniFmod_SetVolume(vol) where "vol" range are 1.0 for full volume and 0.0 for no sound.
Challenge Trophies Won:

Clyde

Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won: