music modpack

Music modpack with API for easy in-game music playback and custom track registration.

Environment / Weather API / Library

Download (43.4 MB)

How do I install this?

music_modpack

Overview

Music modpack with API for easy in-game music playback and custom track registration.

Requirements

  • Minetest 5.0.0+
  • Minetest_game 5.0.0+
  • sfinv_buttons (Optional, but highly recommended: easy way to open music settings menu)

Features

  • Time-based music
  • Elevation-based music
  • Formspec for music settings

Settings

By default, settings menu is only available with /musicsettings command. If you have sfinv_buttons installed, music menu is available in inventory->more->music settings

Adding your own music

Call music.register_track() with following definition:

music.register_track({
    name = "my_track",
    length = 200,
    gain = 1,
    day = true,
    night = true,
    ymin = 0,
    ymax = 31000,
})
  • name - name of the sound file in your mod sounds folder, without extension (.ogg)
  • length - length of the track in seconds
  • gain - volume, value from 0 to 1
  • day - track will be played at day
  • night - track will be played at night
  • ymin - minimum elevation for track to play
  • ymax - maximum elevation for track to play

Settingtypes

Available settings that you can put in your minetest.conf directly, or access them via "Settings->All Settings->Mods->music_modpack" menu.

music_time_interval = integer, Interval between attempts to play music, default is 60
music_cleanup_interval = integer, interval between attempts to clean up player state, default is 5
music_global_gain = float, global music volume, default is 0.3
music_add_random_delay = boolean, if to add a random delay to interval between attempts, default is true
music_maximum_random_delay = - integer, maximum random delay in seconds, default is 30
music_display_playback_messages = boolean, display messages when music starts for a certain player, default is true

Music packs also provide settingtypes with corresponding height limits.

Content

Default pack features 11 tracks from composer Kevin McLeod. Tracks are split into day tracks and night tracks. If music_dfcaverns is not enabled, night tracks also play underground (up to -31000).
Music_dfcaverns is an additional pack of music for underground layers from dfcaverns, featuring 13 tracks from composer Kevin McLeod. Tracks split into three categories, each for one cavern layer from dfcaverns, and their heights are set accordingly. Dfcaverns modpack is not required, however, and it is recommended to enable this pack even without dfcaverns, unless client connection speed is an issue.

License

Code is licensed under GPLv3.

All music used in this mod was produced by Kevin McLeod and released under CC BY 4.0. link to the license.
Original music can be found here.

Reviews

Review

Do you recommend this mod?

  • Thank you for the mod.

    I will add this to my game :)

    0 comments
  • Easy Way To Add New Tracks

    The ability to add new tracks is quick and straightforward, and specifying the time/elevation the tracks play never crossed my mind until I started using the mod. There are tracks in other bgm mods that I like, but played them on shuffle. When used with this mod however, they can be added and set to play only at night, maybe 1000 blocks up or -1000 blocks below ground. This mod is great.

    0 comments
  • Nice mod that works well for ambiance

    The music API is very easy to use, has a good set of parameters for creating the right atmosphere in different environmental conditions, and has good logic/rules for selecting music tracks. It works out of the box with the included music tracks and also works flawlessly with other music tracks. In-game music really doesn't get any easier than this.

    0 comments
  • Adds some excellent ambiance

    I haven't tried it for long, but I really enjoyed it. The soundtracks seem to blend into each other well when changing times and elevation. It definitely adds a new element. Well done!

    0 comments