Pages: 1
Author Topic: libGME  (36,458 Views)
Offline (Unknown gender) FroggestSpirit

Member
Joined: Mar 2013
Posts: 79
View profile
Posted on: March 26, 2014, 02:47:22 PM
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.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #1 Posted on: March 26, 2014, 03:58:35 PM
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.
Offline (Unknown gender) FroggestSpirit

Member
Joined: Mar 2013
Posts: 79
View profile
Reply #2 Posted on: March 27, 2014, 04:08:05 AM
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
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Reply #3 Posted on: March 27, 2014, 02:36:39 PM
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.
Offline (Unknown gender) FroggestSpirit

Member
Joined: Mar 2013
Posts: 79
View profile
Reply #4 Posted on: March 27, 2014, 03:46:39 PM
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)
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #5 Posted on: March 27, 2014, 04:29:52 PM
Quote from: FroggestSpirit on March 27, 2014, 03:46:39 PM
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.

Offline (Unknown gender) FroggestSpirit

Member
Joined: Mar 2013
Posts: 79
View profile
Reply #6 Posted on: March 28, 2014, 03:42:34 AM
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
Pages: 1