Jump to content


Photo

Fmod Sound System Engine


  • Please log in to reply
1037 replies to this topic

#481 imuh3

imuh3

    GMC Member

  • New Member
  • 25 posts

Posted 19 August 2010 - 11:16 PM

Yo icuurd

I was wondering how to get the spectrum data of a point in the song different from the point that is playing at the moment. I know this is pretty stupid, but I have to ask. It's a DDR game but I need the player to be able to see what's coming up ahead... Thanks in advance,

-Imuh3
  • 0

#482 rinkuhero

rinkuhero

    Paul Eres

  • GMC Member
  • 1829 posts
  • Version:GM7

Posted 19 August 2010 - 11:30 PM

i've a question too: do you have any plans to port this to gm4mac? i'm not really sure what to do about the sound for my games on mac, and it'd be nice to have this available on mac too. failing that, perhaps you could provide the source so that someone else with a mac can compile it for gm4mac?

oops, i forgot to address this:

"But does that mean that for bullet sound for example, you shoot 1000 bullets in room0, the effects wont free until you hit room 1? That is why I suggested the GM instance with the alarm method, so that checks is perform against sound instances with is-playing to then free the effect when the sound instance is done. Count how many sound are concurently playing at one time. Maybe you can deal with 20-50 intances... That car example only has 10-30 sounds playing concurently. using the GM instance method, that would only add 10-30 instances. With the alarm, to ease the CPU cost..."


i actually only use an effect in special cases, not for bullets or anything, just for 'friending sounds' when a creature is friended and makes its call sound, which happens at most 100-200 times in a room (if there are a lot of creatures and they're all friended there), and most likely more like 0-10 per room. if the player just friends some creatures and sits there in the room for half an hour without pausing the game, then yes there may be a memory problem in that case, i'll have to test how severe that is later on. but i think for general use clearing them when you leave the room may work best. if it doesn't, i'll try your method instead. it's just that the number of objects is the biggest speed bottleneck in my game, that my instinct is to never use new objects if i can get away without using them.

Edited by rinkuhero, 19 August 2010 - 11:35 PM.

  • 0

#483 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 20 August 2010 - 02:48 AM

Yo icuurd

I was wondering how to get the spectrum data of a point in the song different from the point that is playing at the moment. I know this is pretty stupid, but I have to ask. It's a DDR game but I need the player to be able to see what's coming up ahead... Thanks in advance,

-Imuh3


Simple enough... just start 2 instances of the same sound, forward and mute the first or play it a little while before playing the second unmuted. Get you data from the first as the player hears the second.

i've a question too: do you have any plans to port this to gm4mac? i'm not really sure what to do about the sound for my games on mac, and it'd be nice to have this available on mac too. failing that, perhaps you could provide the source so that someone else with a mac can compile it for gm4mac?


I dont own a mac and the cheap fmod licence only covers PC... The source is included. all you need is get the fmod stuff and link it with your project.

oops, i forgot to address this:

"But does that mean that for bullet sound for example, you shoot 1000 bullets in room0, the effects wont free until you hit room 1? That is why I suggested the GM instance with the alarm method, so that checks is perform against sound instances with is-playing to then free the effect when the sound instance is done. Count how many sound are concurently playing at one time. Maybe you can deal with 20-50 intances... That car example only has 10-30 sounds playing concurently. using the GM instance method, that would only add 10-30 instances. With the alarm, to ease the CPU cost..."


i actually only use an effect in special cases, not for bullets or anything, just for 'friending sounds' when a creature is friended and makes its call sound, which happens at most 100-200 times in a room (if there are a lot of creatures and they're all friended there), and most likely more like 0-10 per room. if the player just friends some creatures and sits there in the room for half an hour without pausing the game, then yes there may be a memory problem in that case, i'll have to test how severe that is later on. but i think for general use clearing them when you leave the room may work best. if it doesn't, i'll try your method instead. it's just that the number of objects is the biggest speed bottleneck in my game, that my instinct is to never use new objects if i can get away without using them.


But the instance monitoring the sound instance and it's effect would only last for the durarion of the sound. In an alarm, meaning they are almost the same as having a few instances with no code and no sprites. You can have thousands of those before it has ill effect in your game. You are right about your instincs, but you can relax them when we are just talking about a few instance.

Realisticaly, you could have 1000 monsters in the room, there sounds limited to distance so you only play those otherwise it would be too noisy

So you dont play a sound if it's too far, that is good practice. So you only deal with monsters withing hearing range. Say you have 10 you can hear, but they all screach, say randomly... Say you hear 3 screaches every 10 seconds, worst case they all screach at the same time, 10 screaches... So that means you will have 3 to 10 sound managing instance on top of your regular instance... 0 if no one is screaching... Since they commit suicide when done, their count should remain relatively low throughout.

[edit] I forget to mention you can also set the alarm to trigger based on the sound lenght... istead of palling every second if it's playing, you just set the alarm to trigger when the time the sound takes to play has passed
I appreciate the reasoning behind not wanting to use instances to hold data or for monitoring a simple single thing, but you need to balance that realisticaly.

There is this guy in the fmod forum wanting to uptimise through casting the listener position call. I mean you only have one call every step for the listener. he's been at it for a few days, you have to slap yourself in the face sometimes.

Not to sound derogative in any away, I've been there myself, sometimes by my own perfectionism, sometimes by the unrealistic demands of a zealot boss. You need to balance.

In any case, if you have a solution that works then there is absolutely no need to make any changes.

Edited by icuurd12b42, 20 August 2010 - 05:13 AM.

  • 0

#484 imuh3

imuh3

    GMC Member

  • New Member
  • 25 posts

Posted 20 August 2010 - 03:58 AM

Oh wow. I never thought of that. Thanks! I have successfully added this to my game.
  • 0

#485 Kinnik

Kinnik

    GMC Member

  • New Member
  • 7 posts

Posted 13 October 2010 - 02:21 AM

Hello icuurd! I am amazed how well you extension works with GM! I made myself a basic DJ mixing application with two virtual C-DJ decks and a simple mixer. The jog wheels on the decks work fantastic! Very accurate feeling and easy to mix with. Adjustable range 'pitch sliders' (using change freq) feels pretty darn precise too. I plan to use this to make a program that teaches people how to DJ music and eventually to include a game based around this.

I have one (maybe a big one) question for you. I have seen that fmod supports ASIO sound output for having multiple outputs. This would be essential to using my program for actual DJing (you need to pre-listen to tracks in headphones to prepare them for playing over the speakers WHILE the speakers are playing the other track). Would it be very difficult to add ASIO & multiple output support to your DLL? I've been trying to figure out how to recompile your source using Dev-C++ but I've very very green to anything outside java/flash/basic and GM... I'm not sure where to find many of the includes like fmod.h (it's not in FMOD Ex Programmers API?) or stdfx.h... I also don't exactly know where to start with actually compiling into DLL format. :(

EDIT: I found the fmod.h (by downloading the version you used instead of current. ;p ) Still don't know about stdfx...

Any help you could give would be HUGELY appreciated. Also, if you want, I'll post the program for you to try out! It is really quite fun as it is!

THANKS AGAIN FOR MAKING SUCH AN AMAZING EXTENSION!!!

-Kin

Edited by Kinnik, 13 October 2010 - 03:08 AM.

  • 0

#486 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 13 October 2010 - 03:31 AM

coment out stdafx.... and coment out the gmlib stuff if it causes trouble; the includes and the setup lines and vars

Devc++ may not compile right if you dont have the right setup

1) make a folder, mygmfmodsimple in you documents folder
2) Make a new dll project in dev c++, name it mygmdmodsimple
3) paste the code from my c file to the new one
4) paste the code from my h file to the new one
5) save the files in the folder you created
6) copy the fmod inc and lib folders in your folder (this you must do for it to compile, a devc++ bug on many PC for compiling dlls)
7) add the library fmodex.a to the extra libs in the project properties
8) add the fmod inc folder to you project extra include folder in the project properties

Edited by icuurd12b42, 13 October 2010 - 03:31 AM.

  • 0

#487 Kinnik

Kinnik

    GMC Member

  • New Member
  • 7 posts

Posted 13 October 2010 - 04:04 AM

I'm giving it a try! I've got the dllmain.release.cpp put into the maindll.cpp created by Dev-c++ but I don't have an .h file in your source directory... I'll check your older releases.

So stoked to play around with this! Thank you so much for help!!


Edit: I've all setup to compile, but I'm still looking for the .h file for:

"4) paste the code from my h file to the new one"

Is it included in the .cpp? This seems like it should be obvious to me.. :P

Edited by Kinnik, 13 October 2010 - 04:41 AM.

  • 0

#488 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 13 October 2010 - 06:06 AM

I'm giving it a try! I've got the dllmain.release.cpp put into the maindll.cpp created by Dev-c++ but I don't have an .h file in your source directory... I'll check your older releases.

So stoked to play around with this! Thank you so much for help!!


Edit: I've all setup to compile, but I'm still looking for the .h file for:

"4) paste the code from my h file to the new one"

Is it included in the .cpp? This seems like it should be obvious to me.. :P


Actulaly, no.... the template h file generated from devc++ should do the trick, really, there is nothing of value in it but the same stuff the devcpp template has.
  • 0

#489 Kinnik

Kinnik

    GMC Member

  • New Member
  • 7 posts

Posted 13 October 2010 - 07:02 AM

Thank you! I got it. Testing now...

Edited by Kinnik, 13 October 2010 - 07:20 AM.

  • 0

#490 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 22 October 2010 - 02:06 PM

You made a really nice program / example: midihero. Is there also a way to draw a 'normal' notebar (would not be that hard right, I can provide sprites when needed). So people can create programs like Anvil Studio. Could you please extend your example a bit? It would help me and many others too. Many thanks in advance.

#491 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 23 October 2010 - 02:16 AM

I guess, but there is little point as the midi hero example reads midi using gm's file system
  • 0

#492 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 23 October 2010 - 09:44 AM

Yeah, that's no problem... Well, is there anyone who could create a small example of drawing a note bar from a MIDI-file (not a whole application)? I can provide sprites etc., except I do not know how to code it. Please help me and some others, many thanks in advance. I really appreciate every help.

#493 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 23 October 2010 - 10:05 AM

The file reading is in a script. I display verticaly. it's should not be too hard to flip it on it's side.
  • 0

#494 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 30 October 2010 - 09:52 AM

Indeed, that's not that hard. However that was not really what I meant.
This is more like it:
Posted Image

Extra information such as dynamics (see: http://en.wikipedia....Dynamics_(music) ) and tempo changes make this even harder.

I don't know where to start actually. I'll PM you later this week with some more information (if you don't mind), because I'm too ill at the moment. Many thanks in advance, this dll helped a lot and so do your answers. My intention is not letting do you everything, please remember that.

#495 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 30 October 2010 - 02:36 PM

Before you invest too much time, Smarty has a dll better suited for this, he even has a demo that plays a virtual piano. You should look it up.
  • 0

#496 Nubcake

Nubcake

    Nubcake

  • GMC Member
  • 1320 posts
  • Version:Unknown

Posted 31 October 2010 - 12:10 PM

i think i saw as i was looking for but if you have a mp3 which starts of differently at the beggining and when it finishes can you make it start from x seconds inwards or keep on looping ?
  • 0

#497 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 31 October 2010 - 11:50 PM

i think i saw as i was looking for but if you have a mp3 which starts of differently at the beggining and when it finishes can you make it start from x seconds inwards or keep on looping ?


Loop the sound then set the loop points.
  • 0

#498 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 07 November 2010 - 01:12 PM

        for (count = 0; count < 256; count+=10)
        {
            val = ds_list_find_value(l1,count)
            mmax += val; 
        }            
        mmax = mmax / 256;
        
        decibels = (log10(max(0.000000000001,mmax)) * 10 * 2);

Can I say the ratio A1 / A0 is given by the average surface below the spectrum? It would love to have some scientific information about this decibel formula.

Because A1 / A0 = the average surface below the spectrum, A1/A0 = mmax? Right?
Posted Image

FMOD core docs said:

Where did you get this info from? Could you please send me this docs? http://www.fmod.org/docs/ is down

Edited by zytro, 07 November 2010 - 01:34 PM.


#499 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 08 November 2010 - 12:57 AM

>>Where did you get this info from? Could you please send me this docs? http://www.fmod.org/docs/ is down

You can download and install the whole thing from their site. The help file is included.
  • 0

#500 zytro

zytro

    GMC Member

  • Validating
  • 16 posts

Posted 08 November 2010 - 03:19 PM

Yeah, thanks I found the file finally.

Can someone please answer my previous question? Many thanks in advance.

#501 Nehacoo

Nehacoo

    GMC Member

  • New Member
  • 180 posts
  • Version:GM8.1

Posted 13 November 2010 - 10:16 PM

Hey icuurd12b42, many thanks for this great DLL!
It has worked perfectly for me until now on the admittedly quite few computers I've tested it on (including never having a problem on my main desktop computer on which I've run my game hundreds of times).

But now that I tested my game on my old laptop, it throws out ye olde "Error defining external function", once for every function defined in LoadFMOD(). If I ignore all of those errors it shows the message "Failed to load sound file <file>" for every sound added. Then the game works, but completely lacks sound.
I've seen the mentions of similar problems earlier in the topic, but this persists through restarts (I've never once got it working on that computer). Another DLL (Yourself's High resolution timer) works as it should even on the laptop, and I think, but I can't remember clearly as it was at least a year ago, SXMS worked on that laptop as well.

The laptop runs Windows XP SP2.

Any idea what causes this problem or any possibilities of fixing it? Thanks.
  • 0

#502 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 14 November 2010 - 03:49 AM

Any idea what causes this problem or any possibilities of fixing it? Thanks.


Darn, did I publish a release with msvc compile instead of codeblocks!!??

Install this and see if it fixes it. In the system or the game directory...
http://www.microsoft...4d-074b9f2bc1bf

When I have more time, I'll compile it without the dependency. I'm really sorry about that. if that is the problem. Another problem is GM itself starts to hickup on loading ANY dll. Truely reboot your PC to fix this

Edited by icuurd12b42, 14 November 2010 - 03:49 AM.

  • 0

#503 Nehacoo

Nehacoo

    GMC Member

  • New Member
  • 180 posts
  • Version:GM8.1

Posted 14 November 2010 - 12:05 PM

Yup, it worked fine after I installed the re-distributable package, good to see it was something (to my knowledge) easy to fix!
Actually I suspected it was something like this because I think I've seen you mention this kind of problem in some other thread months ago. :)

Oh and personally, I'm not in a very big rush to get it fixed as long as I can work on my game (as it will take a while before it's finished), but I guess I can't speak for everyone here.

Thanks a lot!

(Why do applications compiled with visual c++ require such a package anyway? To keep down file size?)
  • 0

#504 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 15 November 2010 - 02:23 AM

(Why do applications compiled with visual c++ require such a package anyway? To keep down file size?)


Yes. Useless IMHO... My dll is not even using the things in those. but MS decided the linker would force it on you anyway. There is an option to turn it off. Someone mentioned it a few places. But everytime I have the energy to recompile my stuff, I try to locate the info and fail to find the post stating the option on how to turn it off. If anyone knows what I'm talking about here please post up the option here.

Edited by icuurd12b42, 15 November 2010 - 02:23 AM.

  • 0

#505 Revel

Revel

    ɹǝqɯǝɯ ɔɯƃ

  • GMC Member
  • 4923 posts
  • Version:GM8

Posted 15 November 2010 - 07:44 AM

Posted Image
  • 0

#506 TheMagicNumber

TheMagicNumber

    GMC Member

  • GMC Member
  • 5247 posts
  • Version:Unknown

Posted 15 November 2010 - 11:53 AM

My dll is not even using the things in those. but MS decided the linker would force it on you anyway.

It is used, but if you saw it you would be more frustrated that your creation has just crashed. It implements the standard functionality for the language, such as string and vector.
  • 0

#507 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 15 November 2010 - 03:02 PM

My dll is not even using the things in those. but MS decided the linker would force it on you anyway.

It is used, but if you saw it you would be more frustrated that your creation has just crashed. It implements the standard functionality for the language, such as string and vector.


Which I dont use. I only use the basic C++ language (none of the standard classes) and standard c types. I think Revel pointed out the right spot. this will cause either the references to not be included or the implementation be included in my dll directly.

Thanks revel.
  • 0

#508 imuh3

imuh3

    GMC Member

  • New Member
  • 25 posts

Posted 29 November 2010 - 04:11 AM

Hello again, I come back to the sound guru for advice. The FMOD feature list says there is a WAV writer output that writes all FMOD output to a wag file. However, I can't find anything in GMFmodSimple. Please help!

Lastly, I would like to know if there is a way to get VST plugins in game maker. Thanks in advance
, Imuh3

P.s. I'm making a composer, haha

Edited by imuh3, 29 November 2010 - 04:11 AM.

  • 0

#509 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 15937 posts
  • Version:GM:Studio

Posted 29 November 2010 - 04:21 AM

It's a flag you pass to the core fmod create_sound function... Which does not send the sound to the audio device... system update is called until the whole file is read while you get the wave data. My wrapper does not allow such fine use. Perhapse the other older fmod system by shaltif allows this.

As for the dsp, I only support fmod's included ones.
  • 0

#510 whothat

whothat

    GMC Member

  • New Member
  • 18 posts
  • Version:GM8

Posted 30 November 2010 - 02:02 AM

i get this error

ERROR in
action number 2
of Other Event: Game Start
for object gamestart_cont:

Error defining an external function.

and after i click ignore 20 or so times, the game runs normal and all the sounds work, any idea whats wrong?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users