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:

Zackary200

Member
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:

Zackary200

Member
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.
 

Zackary200

Member
I found a few bugs with the Chiptune player,
When I switch to a new track it stutters for a second then it plays like normal.
And, when I load a new music file it doesn't start at the beginning.
Is this a bug or is this a Game Maker Issue?
 
Last edited:

Zackary200

Member
Here's the Code used to swap between files:
if(mouse_check_button_pressed(mb_left))
{
var filename = working_directory + "SD3_06-Axe_Bring_Storm.spc";
sound_index = GME_LoadSong(filename);
if(sound_index != noone)
{
track_number = 0;
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();
pause = false;
tempo = 1;
GME_SetPosition(0);
}
}

if(mouse_check_button_pressed(mb_right))
{
var filename = working_directory + "29 - Staff Roll.vgm";
sound_index = GME_LoadSong(filename);
if(sound_index != noone)
{
track_number = 0;
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();
pause = false;
tempo = 1;
GME_SetPosition(0);
}
}
 

Trianull

Member
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:
Top