Modding Help Adding music file to the Portable Music Player (FU)?

Discussion in 'Starbound Modding' started by daycj, May 20, 2018.

  1. daycj

    daycj Space Spelunker

    Hello,

    I am relatively new to modding, and I was wondering if anyone could walk me through adding a music file to the Music Player in Frackin Universe,

    I saw the brief guide on the wiki about it but I am pretty lost! I have the song I want in ogg format though!

    I've been wanting to have the Mass Effect title theme 'Vigil' to play in the ship background, since currently there's no music whatsoever.

    If not possible, can anyone recommend a mod which plays bgm on your ship?


    Thank you so much!!
     
    See_Food likes this.
  2. See_Food

    See_Food Yeah, You!

    ' Song.ogg Will Be Used As A Song File Example (Song Should Be In .ogg Format) '

    ---> FU = FrackinUniverse <---

    ---> FM = Frackin' Music <---




    * Adding Songs To The FrackinUniverse Music Player * :
    a- Using FrackinUniverse:


    1.Open Folder: "mods/FrackinUniverse/music", Then Put Your Song.ogg Inside.
    2.Go To The Folder: "mods/FrackinUniverse/interface/scripted/fm_musicplayer".

    3.
    (For FU 5.6.254 And Newer):
    Open "musiclist.config" Using A Suitable Text Editor.
    Go To The Bottom And You Will See Something Like:

    Code:
            },
            {
                "name" : "wastelandboss",
                "directory" : "/music/wastelandboss.ogg"
            },
            {
                "name" : "eight magics",
                "directory" : "/music/eightmagics.ogg"
            }                                                
        ]
    }
    


    Now Add Your Song Under The Last One. It Should Look Like This :

    Code:
            },
            {
                "name" : "wastelandboss",
                "directory" : "/music/wastelandboss.ogg"
            },
            {
                "name" : "eight magics",
                "directory" : "/music/eightmagics.ogg"
            },
            {
                "name" : "Song",
                "directory" : "/music/Song.ogg"
            }                                            
        ]
    }
    



    (For FU 5.6.253 And Older):
    Open "fm_musicplayer.config".
    At The Bottom You Should See Something Like:

    Code:
         
            },
            {
                "name" : "Sulphuric Ambiance (ambiance)",
                "musicDirectory" : "/sfx/ambiance/sulphuricambiance2.ogg",
                "category" : "frackin"
            },
            {
                "name" : "Tide Water Ambiance (ambiance)",
                "musicDirectory" : "/sfx/ambiance/tidewaterambiance.ogg",
                "category" : "frackin"
            }
        ]
    }
    



    Add Your Song Under The Last One. The File Should Look Like This:

    Code:
         
            },
            {
                "name" : "Sulphuric Ambiance (ambiance)",
                "musicDirectory" : "/sfx/ambiance/sulphuricambiance2.ogg",
                "category" : "frackin"
            },
            {
                "name" : "Tide Water Ambiance (ambiance)",
                "musicDirectory" : "/sfx/ambiance/tidewaterambiance.ogg",
                "category" : "frackin"
            },
            {
                "name" : "Song",
                "musicDirectory" : "/music/Song.ogg",
                "category" : "frackin"
            }
        ]
    }
    





    * * * Pay Attention To The " , " And The " } " Before You Save. Look At The Example For Reference. * * *


    b-Using FrackinMusic: (Tested On Version 3.4):

    1.Open The Folder: "mods/FrackinMusic-3.4/music". Put Your Song.ogg Inside.
    2.Now Open The Folder: "mods/FrackinMusic-3.4/interface/scripted/fm_musicplayer".
    3.Open "FrackinMusic.config" Using A Suitable Text Editor.
    4.At The Bottom You Should See Something Like:

    Code:
        
            },
            {
                "name" : "Met1",
                "directory" : "/music/met1.ogg"
            },
            {
                "name" : "Wa1",
                "directory" : "/music/wa1.ogg"
            }
        ]
    }
    


    5.Add Your Song Under The Last One So That The File Looks Like This:

    Code:
        
            },
            {
                "name" : "Met1",
                "directory" : "/music/met1.ogg"
            },
            {
                "name" : "Wa1",
                "directory" : "/music/wa1.ogg"
            },
            {
                "name" : "Song",
                "directory" : "/music/Song.ogg"
            }
        ]
    }
    



    * * * Pay Attention To The " , " And The " } " Before You Save. Look At The Example For Reference. * * *



    * Adding Songs As World Background Music * : Tested On FrackinMusic (Version 3.4):

    1. Open The Folder: "mods/FrackinMusic-3.4/music". Put Your Song.ogg Inside.
    2. Now Open The Folder: "mods/FrackinMusic-3.4/biomes".
    3. Choose If You Either Want The Song To Play When The Player Is On The Surface Of The Planet Or In The Underground By Selecting The Corresponding Folder ( biomes/surface or biomes/underground ).
    4. Choose A Biome To Add The Song To. We Will Be Using The Forest Biome As An Example.
    5. Open The "forest.biome.patch" File With A Text Editor And You Will See A List Between " [ ] " Like:

    Code:
      
            [
            .
            ..
            ...
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/ds31.ogg"},
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/met1.ogg"},
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/wa1.ogg"}
            ]
    


    6.Add This Line Under The Last Song (wa1.ogg For This Example):

    For Daytime:
    Code:
    {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/Song.ogg"}

    For Nighttime:
    Code:
    {"op":"add", "path":"/musicTrack/night/tracks/-", "value":"/music/Song.ogg"}


    7.Don't Forget To Add " , " To The wa1.ogg Line. The Text File Should Look Like This (Daytime As An Example):

    Code:
            [
            .
            ..
            ...
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/ds31.ogg"},
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/met1.ogg"},
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/wa1.ogg"},
            {"op":"add", "path":"/musicTrack/day/tracks/-", "value":"/music/Song.ogg"}
            ]
    


    * * * Pay Attention To The " , " And The " } " Before You Save. Look At The Example For Reference. * * *


    ** This Is Only An Attempt To Help **
     
    Last edited: Aug 21, 2018
    Feral_Bloom likes this.
  3. YanFuaChan

    YanFuaChan Void-Bound Voyager

    i added more music and some how when the next time i start the game and the music tracks are all gone
     
  4. bk3k

    bk3k Oxygen Tank

    This is a > 2 year old thread, and you provided no real information about what specifically you did. I'll ASSUME that you refer to the music player. Now seeing the example above about how to do it, I wouldn't recommend editing their files directly. Your edits will be gone the moment you edit FU. Instead of that. make your own mod that patches theirs. Start by creating a folder in \Starbound\mods\ and give it whatever name you want for the mod.
    In that folder, create _metadata
    Code:
    {
      "version" : "1.00",
      "author" : "your_handle_here",
      "description" : "patches FU stuff",
      "name" : "FU_edits",
      "friendlyName" : "FU Edits",
      "includes" : ["FrackinUniverse" ]
    }
    Edit the name, put in yourself as author, etc.

    Create a folder in there called music
    put your .ogg files in that folder

    Then the patch their files. Namely create your own folder structure matching theirs for the things you want to patch.
    From the base folder of your mod(the same folder containing _metadata), create a folder named interface.
    Inside that folder, create a folder named scripted
    Inside that folder, create a folder named fm_musicplayer
    Inside that folder, create a file named musiclist.config.patch
    You could go 2 directions with this.
    1. Add to an existing Album.
    Code:
    [
      {
        "op": "add",
        "path": "/Starbound/-",
        "value": {
          "name": "myTrack 1",
          "directory": "/music/myTrack_01.ogg"
        }
      },
      {
        "op": "add",
        "path": "/Starbound/-",
        "value": {
          "name": "myTrack 2",
          "directory": "/music/myTrack_02.ogg"
        }
      }
    ]
    That would add myTrack_01.ogg and myTrack_02.ogg to the "Starbound" album.
    1. Create your own Album
    Code:
    [
      {
        "op": "add",
        "path": "/My_Album",
        "value": [
          {
            "name": "myTrack 1",
            "directory": "/music/myTrack_01.ogg"
          },
          {
            "name": "myTrack 2",
            "directory": "/music/myTrack_02.ogg"
          }
        ]
      },
      {
        "op": "add",
        "path": "/##album_icons##/My_Album",
        "value": "/interface/scripted/fm_musicplayer/icon_myAlbum.png"
      }
    ]
    In this case, you'd also want to put your choice of PNG file to represent your album in the player. You could technically just copy an existing one - in which case just point to that. By the way please name it something better than My_Album. That's purely for example's sake.

    edit:
    seems like you can also load external config lists by adding the path/file in ##files## and that could be good if you have a huge pre-made lists with multiple albums to load (rather than patching everything in).
    Code:
    [
      {
        "op": "add",
        "path": "/##files##/-",
        "value": "/myBig_trackList.config"
      }
    ]
    Where the external config file would follow the same format as the musiclist.config file.
     
    Last edited: Aug 28, 2020
    Feral_Bloom and YanFuaChan like this.
  5. YanFuaChan

    YanFuaChan Void-Bound Voyager

    Thank you so much bro! I appreciated!
     
    bk3k likes this.
  6. Feral_Bloom

    Feral_Bloom Aquatic Astronaut

    Hey I know it's literally been 2 years but I can't figure out how to get the custom album icon to work
     

Share This Page