[Mod] Game background music [mpd]

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

[Mod] Game background music [mpd]

by orwell » Post

Hello again
There are no really full-featured background music mods. There are:
- ambience, which plays the music desynchronized, which is bad when multiple players play in the same room, and it can't be controlled (also, it happens very often that the same song is played twice)
- playmus, which basically does its job, but does not really good keep track of what's happening, and all players have the same volume and can't disable the music
- jdukebox/jukebox/jukerboxer. OK, these are jukeboxes, not background music.
I made a background music mod around a year ago. Here is it. Songs are picked in random order, with 30s pause between them (can be adjusted via settings)
EDIT: indeed, there is one, it's called tmusic_player

Now with vote functionality using https://github.com/minetest-mods/vote

For all players:
/mvolume <volume>
Set your individual music volume or disable background music. Saved across server restarts.

With mpd privilege:
/mpd_list: list available music
/mpd_play <id>: play a song
/mpd_stop: stop the current song. Unless /mpd_play or /mpd_next are invoked, no more music is played
/mpd_next: Play the next song

Depends: nothing
License of code: WTFPL
With this mod, I included the music from [ambience] along with some others.
“Eastern Feeling” is created by Jordach. It can be found in the BFD subgame. License is GPLv3 (license of BFD).

The other tracks are called “Avalon”, “Ethereal”, “Faraway” and “Strangely Beautiful”. Author is Amethystium <http://amethystium.com/>.

According to viewtopic.php?f=11&t=2807, all files from the ambience mod are WTPFL unless noted otherwise in sounds/SoundLicenses.txt. It is not noted otherwise in this file, so the licence must be WTFPL.
(this very good copyright summary here has been contributed by Wuzzy)
For the other song's copyrights, see readme.txt

Requires latest minetest 0.4.15-dev on the server side (requires commit ef6feca)
Github: https://github.com/orwell96/mpd
Last edited by orwell on Mon Jan 29, 2018 21:37, edited 6 times in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
GamingAssociation39
Member
Posts: 833
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Game background music [mpd]

by GamingAssociation39 » Post

It's giving me an error for the mod
Jesus Is Lord and Savior!!!

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

GamingAssociation39 wrote:It's giving me an error for the mod
mpd mod directory has to be named "mpd"?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Game background music [mpd]

by azekill_DIABLO » Post

looks nice. please get a better presentation on your first post :D

User avatar
GamingAssociation39
Member
Posts: 833
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Game background music [mpd]

by GamingAssociation39 » Post

orwell wrote:
GamingAssociation39 wrote:It's giving me an error for the mod
mpd mod directory has to be named "mpd"?
Attachments
Screenshot (14).jpg
(591.77 KiB) Not downloaded yet
Jesus Is Lord and Savior!!!

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Game background music [mpd]

by azekill_DIABLO » Post

GamingAssociation39 wrote:
orwell wrote:
GamingAssociation39 wrote:It's giving me an error for the mod
mpd mod directory has to be named "mpd"?
Image
MINECRAFT.

User avatar
DS-minetest
Member
Posts: 1137
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: DS-minetest
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Game background music [mpd]

by DS-minetest » Post

Why wasn't this mod made client-side?
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.

User avatar
TumeniNodes
Member
Posts: 2853
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Game background music [mpd]

by TumeniNodes » Post

Thank you orwell,
I have been planning on doing this at some point, but now I don't need to : D

I'll have to wait for the release coming to try it out though..., (I'm a boring "stable" kinda guy)
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

DS-minetest wrote:Why wasn't this mod made client-side?
There are 2 ways to understand your question
1.) "I want to listen to my own music while playing minetest"
Use a music player.
2.) "This mod is what I wanted, but why doesn't it involve any Client Side Modding"
Why should it? The most important point is that it synchronizes music across clients, but lets everyone keep his own volume, which works best server-side.

However, a mod that plays user-defined music in-game client-side would be an interesting thing...
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

hajo
Member
Posts: 602
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Game background music [mpd]

by hajo » Post

orwell wrote:background music mods:
- ambience .. it can't be controlled
- playmus, .. all players have the same volume and can't disable the music

I made a background music mod around a year ago. .. Songs are picked in random order,
with 30s pause between them (can be adjusted in init.lua)

For all players:
/mvolume <volume> Set your individual music volume or disable background music.
For me, the most important feature of such mods is the ablity to disable the music.

Because after hearing it a few times, it might get boring/annoying.
Also, waste of bandwidth / datatransfer-volume...

User avatar
Linuxdirk
Member
Posts: 2554
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] Game background music [mpd]

by Linuxdirk » Post

hajo wrote:For me, the most important feature of such mods is the ablity to disable the music.

Because after hearing it a few times, it might get boring/annoying.
Also, waste of bandwidth / datatransfer-volume...
Or when doing Let's play videos copyright owners may claim the content and advertise in/aside your video. (Happened twice to me due to copyrighted music in a background music mod).

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

Actually, no bandwith is wasted, since music is downloaded a single time (on first join) and then stored in your cache. Minetest just instructs the client to play that sound file.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Chibi ghost
Member
Posts: 845
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Game background music [mpd]

by Chibi ghost » Post

one way to over come the copyright issue is to create the music
but that is only a good solution if the 1, the music is good 1.5, not too obnoxious 2, and it has a decent loop

User avatar
azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Game background music [mpd]

by azekill_DIABLO » Post

i agree!

anrc
New member
Posts: 3
Joined: Thu Jul 20, 2017 11:19

Re: [Mod] Game background music [mpd]

by anrc » Post

Hey there, I'm getting the following errors when trying to use the mod on my server.

Code: Select all

2017-07-20 13:20:15: ERROR[Main]: ModError: Failed to load and run script from /home/<username>/.minetest/mods/mpd/init.lua:
2017-07-20 13:20:15: ERROR[Main]: /home/<username>/.minetest/mods/mpd/songs.lua: File or directory not found
2017-07-20 13:20:15: ERROR[Main]: stack traceback:
2017-07-20 13:20:15: ERROR[Main]:       [C]: in function 'dofile'
2017-07-20 13:20:15: ERROR[Main]:       /home/<username>/.minetest/mods/mpd/init.lua:13: in main chunk
I guess the file songs.lua is missing (it's not part of the git repo provided). Do I need to create it by myself and if yes, what is supposed to be in there?

Thanks in advance!

Parnikkapore
Member
Posts: 18
Joined: Tue Jun 27, 2017 04:15
In-game: Parnikkapore

Re: [Mod] Game background music [mpd]

by Parnikkapore » Post

I simply commented the line out. Everything is currently in init.lua .

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: [Mod] Game background music [mpd]

by Tmanyo » Post

Nobody ever recognizes Tmusic Player... :( lol
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

Parnikkapore wrote:I simply commented the line out. Everything is currently in init.lua .
Oops... alright, you can comment out the line.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

anrc
New member
Posts: 3
Joined: Thu Jul 20, 2017 11:19

Re: [Mod] Game background music [mpd]

by anrc » Post

Parnikkapore wrote:I simply commented the line out. Everything is currently in init.lua .
Nice, thank you!

Update: Works great :>

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

problem fixed by a github commit.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
Wuzzy
Member
Posts: 3981
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Game background music [mpd]

by Wuzzy » Post

This mod works great! Using it is easy as pie, also subgame integration is ultra-easy. Definitive recommend.

IMO it just needs some polishing, but otherwise it's good. Simple and good.

Bugs:
- You credited the dark_ambiance track although it does not exist in this mod. xD
- You used a gain greater than 1 in some tracks. I don't think values above 1 are allowed.
- Most or even all track names are wrong
- If you say “/mpd_what” while no track is playing, it says “Nothing playing. 0 sec. left until next song.” But after 0 seconds, there is still no song. xD
- No credit given for 5 tracks
- No license given for the Deemo collection tracks

Suggestions:
- If you type in “/mpd_play” without paramter, play a random track
- Improve the README and add more usage info
- Write complete developer documentation (API calls, songs.txt, etc.)
- Add the name of the authors into the songs metadata
- Add mod.conf with content “name = mpd”. With this the directory name of the mod doesn't matter anymore
- Add settingtypes.txt for the settings
- Give proper credit for ALL tracks

Credits info for your convenience:
eastern_feeling is actually called “Eastern Feeling” and created by Jordach. It can be found in the BFD subgame. License is GPLv3 (license of BFD).

The other tracks are called “Avalon”, “Ethereal”, “Faraway” and “Strangely Beautiful”. With spaces, but without the “Short” at the end. Author is Amethystium <http://amethystium.com/>.

According to viewtopic.php?f=11&t=2807, all files from the ambience mod are WTPFL unless noted otherwise in sounds/SoundLicenses.txt. It is not noted otherwise in this file, so the licence must be WTFPL.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

Wuzzy wrote:This mod works great! Using it is easy as pie, also subgame integration is ultra-easy. Definitive recommend.

IMO it just needs some polishing, but otherwise it's good. Simple and good.

Bugs:
- You credited the dark_ambiance track although it does not exist in this mod. xD
- You used a gain greater than 1 in some tracks. I don't think values above 1 are allowed.
- Most or even all track names are wrong
- If you say “/mpd_what” while no track is playing, it says “Nothing playing. 0 sec. left until next song.” But after 0 seconds, there is still no song. xD
- No credit given for 5 tracks
- No license given for the Deemo collection tracks

Suggestions:
- If you type in “/mpd_play” without paramter, play a random track
- Improve the README and add more usage info
- Write complete developer documentation (API calls, songs.txt, etc.)
- Add the name of the authors into the songs metadata
- Add mod.conf with content “name = mpd”. With this the directory name of the mod doesn't matter anymore
- Add settingtypes.txt for the settings
- Give proper credit for ALL tracks

Credits info for your convenience:
eastern_feeling is actually called “Eastern Feeling” and created by Jordach. It can be found in the BFD subgame. License is GPLv3 (license of BFD).

The other tracks are called “Avalon”, “Ethereal”, “Faraway” and “Strangely Beautiful”. With spaces, but without the “Short” at the end. Author is Amethystium <http://amethystium.com/>.

According to viewtopic.php?f=11&t=2807, all files from the ambience mod are WTPFL unless noted otherwise in sounds/SoundLicenses.txt. It is not noted otherwise in this file, so the licence must be WTFPL.
First, thanks for the copyright info. I allowed myself to include it 1:1 into the main topic.
Sadly I don't really know where the Deemo tracks came from or what their license is...
Regarding the song names, these are actually the file names and I just didn't rename the files.
Hm, dark_ambiance... as far as i remember it was one of the ambience sounds, but there was no real music in it, so i removed it...
The gain values were just copied over from ambience, because they are supposed to be balanced. And it works, so what...
I've implemented some of your suggestions.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
Sirmentio
Member
Posts: 21
Joined: Thu Apr 21, 2016 17:22
In-game: Sirmentio

Re: [Mod] Game background music [mpd]

by Sirmentio » Post

orwell wrote: - playmus, which basically does its job, but does not really good keep track of what's happening, and all players have the same volume and can't disable the music
Hey, I'm glad my mod took inspiration for you to do this, I'm glad and hoping this could be a better alternative to what I had made some time ago, and from the sound of it, it certainly looks like it. :)

User avatar
bosapara
Member
Posts: 593
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
Contact:

Re: [Mod] Game background music [mpd]

by bosapara » Post

i have warning when mod loading, how to fix it?

Code: Select all

2018-09-21 21:35:26: WARNING[Main]: [mpd] Misformatted song entry in songs.txt: #File Name           Time       Gain
Title

User avatar
orwell
Member
Posts: 830
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: [Mod] Game background music [mpd]

by orwell » Post

This warning does not cause any harm. If you want it to go away, please delete said line from songs.txt, it's a comment and should be ignored.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests