Pages: 1
  Print  
Author Topic: libGME  (Read 1701 times)
Offline (Unknown gender) FroggestSpirit
Posted on: March 26, 2014, 09:47:22 AM

Member
Joined: Mar 2013
Posts: 79

View Profile
I stumbled upon libGME, and would like to look into it, but im not sure how to get it to work in ENIGMA. I know i can enable it as an extension, but I couldn't find documentation on any functions for it. Also, I came across the source, and was wondering how easy it would be to modify it for enigma. I might use it for my sound engine, but rather than reading from an emulated music file, I would have it read from memory, where I could easily change instruments, and pitches with modifying a variable.
Logged
This isn't easy to say, but…
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: March 26, 2014, 10:58:35 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
If it's an extension, then you can see the functions in the header: https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Universal_System/Extensions/GME/include.h

As you see it has only one - sound_add_from_gme(). That means it works together with OpenAL for playback. So you use that function to load GME and then regular sound functions, like sound_play() to play it.
Note that I haven't tested that extension and I don't know if it works. Supposedly it does.
Logged
Offline (Unknown gender) FroggestSpirit
Reply #2 Posted on: March 26, 2014, 11:08:05 PM

Member
Joined: Mar 2013
Posts: 79

View Profile
I get this error  fatal error: gme/gme.h: No such file or directory
 #include <gme/gme.h>
I'm not sure if the file got moved or deleted, or if i need to install something
Logged
This isn't easy to say, but…
Offline (Male) Josh @ Dreamland
Reply #3 Posted on: March 27, 2014, 09:36:39 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2958

View Profile Email
You need to install libGME on your computer. If you're on Ubuntu, this is as simple as sudo apt-get install libgme-dev. If you are on Windows, you will need to find a distribution of it and add it to your MinGW installation manually.

Aside from that, the extension should work fine. We could add a function to ENIGMA (and so to the IDE) to give a list of functions, globals, and locals provided by a given extension. In fact, the compiler already does this internally; I can modularize that segment of it so that the IDE will have access to it in the future.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) FroggestSpirit
Reply #4 Posted on: March 27, 2014, 10:46:39 AM

Member
Joined: Mar 2013
Posts: 79

View Profile
Thanks! Whenever you have the time to, that'd help. I'm eventually going to look at modifying it so I can just make my own music format (sequenced)
Logged
This isn't easy to say, but…
Offline (Unknown gender) Darkstar2
Reply #5 Posted on: March 27, 2014, 11:29:52 AM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Thanks! Whenever you have the time to, that'd help. I'm eventually going to look at modifying it so I can just make my own music format (sequenced)

Personally that's what I would do, I would convert the MIDI to an OGG or use some other format if supported.

BTW yes it would be nice if LGM would list all available functions, globals, etc, not just for extensions but all enigma supported ones, just like gamemaker always did.

Logged
Offline (Unknown gender) FroggestSpirit
Reply #6 Posted on: March 27, 2014, 10:42:34 PM

Member
Joined: Mar 2013
Posts: 79

View Profile
I'm thinking a custom format though. The only things that would be streamed are the instruments/sound effects, the rest rould be sequenced. This would allow for smaller file size, aswell as doing cool things, like changing tempo, pitch, or even instruments during the song
Logged
This isn't easy to say, but…
Pages: 1
  Print