Author Topic: Freebasic MiniFmod 1.70  (Read 22546 times)

0 Members and 1 Guest are viewing this topic.

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Freebasic MiniFmod 1.70
« on: December 24, 2008 »
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

« Last Edit: September 06, 2009 by rbz »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Freebasic MiniFmod 1.70
« Reply #1 on: December 24, 2008 »
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:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #2 on: December 24, 2008 »
oh cool cheers rbz k+,

sticky it please!
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Freebasic MiniFmod 1.70
« Reply #3 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?
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #4 on: December 24, 2008 »
Thanks!

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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Freebasic MiniFmod 1.70
« Reply #5 on: December 24, 2008 »
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:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #6 on: December 24, 2008 »
Yeah, works fine!   :cheers:
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #7 on: February 01, 2009 »
What music formats can this play?
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #8 on: February 01, 2009 »
Fast tracker II format - ".xm"
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #9 on: February 02, 2009 »
Ah ok, cheers for the info.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #10 on: March 03, 2009 »
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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #11 on: March 03, 2009 »
In FB you can avoid that kind of mistake, add:
Code: [Select]
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #12 on: March 03, 2009 »
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #13 on: March 04, 2009 »
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:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #14 on: March 05, 2009 »
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:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Freebasic MiniFmod 1.70
« Reply #15 on: March 05, 2009 »
The easiest way to add volume control is probably "FSOUND_MixerClipCopy_Float32".
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #16 on: March 05, 2009 »
@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:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Freebasic MiniFmod 1.70
« Reply #17 on: March 05, 2009 »
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:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2756
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Freebasic MiniFmod 1.70
« Reply #18 on: March 05, 2009 »
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:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Freebasic MiniFmod 1.70
« Reply #19 on: March 05, 2009 »
Luvly Jubbly :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: