1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Asset - Extension Chiptune Player (game_music_emu) *Free*

Discussion in 'Marketplace' started by Mick, Apr 21, 2017.

  1. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    306
    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: May 28, 2019
    Mick likes this.
  2. Zackary200

    Zackary200 Member

    Joined:
    May 18, 2017
    Posts:
    14
    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: Nov 1, 2019
  3. Zackary200

    Zackary200 Member

    Joined:
    May 18, 2017
    Posts:
    14
    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.
     
  4. nesrocks

    nesrocks Member

    Joined:
    Nov 6, 2016
    Posts:
    306
    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.
     
  5. Zackary200

    Zackary200 Member

    Joined:
    May 18, 2017
    Posts:
    14
    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: Nov 3, 2019
  6. Zackary200

    Zackary200 Member

    Joined:
    May 18, 2017
    Posts:
    14
    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);
    }
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice