• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asset - Extension Chiptune Player (game_music_emu) *Free*

nesrocks

Member
That's okay! I'm doing some tests using the extension demo project instead of mine to minimize confusion and hopefully I can come up with something.

edit: I think I have a not so pretty temporary workaround which is to reload the song everytime GME_Play() is used.

So GME_Play() becomes this:
Code:
/// @description GME_Play()
with obj_gme
{
    if !playing
    {
        sound_index = GME_LoadSong("mysong.nsf");
        if sound_index != noone
        {
            song_tracks = GME_NumTracks();
            song_voices = GME_NumVoices();
            GME_StartTrack(track_number);
            name = GME_GetName();
            author = GME_GetAuthor();
            comment = GME_GetComment();
            copyright = GME_GetCopyright();
          
            pause = false;
            tempo = 1;
            playing = true;
        }
    }

    if sound_index != noone audio_sound_gain(sound_index,mymusicvolume,0);
}
Not sure how much of this is totally necessary (sound_index being reloaded and GME_StartTrack() seem to be), but it has fixed my problem.
 
Last edited:
Z

Zackary200

Guest
I may need some help on this...
I'm using GMS 1.4.9999 and what does GameMusicEmu_LoadBuffer(size, buffer_address) and GameMusicEmu_Read() do?
I tried it and it crashed once my project started to boot up.

sound_index = GameMusicEmu_LoadBuffer(8, working_directory + "SD3_06-Axe_Bring_Storm.spc");
if(sound_index != noone)
{
GameMusicEmu_StartTrack(sound_index);
}

Edit: Nevermind, The extension didn't load all the way so I had to use 7-Zip to load the rest of the files in the Extension.
 
Last edited by a moderator:
Z

Zackary200

Guest
Sorry for asking this but, Is it possible to fade in and out a voice channel?
As in like if I want the SPC music to be dynamic by if I go in a certain area more channels/voices will fade in, but if I go away from that area it fades out.
 

nesrocks

Member
I think so, you just need to set the channel volume step by step during your fade code. If it's not possible to set a channel volume (I can't remember right now), then you set the volume for each sound that's grouped in a channel.
 
Z

Zackary200

Guest
Deleted Comment
 
Last edited by a moderator:
Z

Zackary200

Guest
Deleted Comment
 
Last edited by a moderator:
T

Trianull

Guest
I've run into another problem, whenever I switch rooms, the new music starts about half a second in. I'm using a new instance of obj_music for each room. This is the code that changes the file under the Create Event.
EDIT: If I stop the music and add a delay before the room change, the music works fine, but of course I don't want this delay.
EDIT 2: The buffer_count seems to have an effect on it, the higher the buffer count, the further into the song it starts. GME_StartTrack() should be covering this by resetting the buffer index and clearing the buffers though...
GML:
var filename;

switch(room){
    case rm_one:
        filename = working_directory + "music/" + "music1.nsf";
        break;
    case rm_two:
        filename = working_directory + "music/" + "music2.nsf";
        break;
}

sound_index = GME_LoadSong(filename);
if(sound_index != noone)
{
  GME_Stop();
  song_tracks = GME_NumTracks();
  song_voices = GME_NumVoices();
  GME_StartTrack(track_number);
  name = GME_GetName();
  author = GME_GetAuthor();
  comment = GME_GetComment();
  copyright = GME_GetCopyright();
  GME_Play();
  audio_resume_all();
}
I'd appreciate some help with this.
 
Last edited by a moderator:
Top