MiSTer BGM - Background Music for the MiSTer Menu

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 199 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by lamarax »

I think we should commission an original MiSTer theme :)

Anyone up for the takes?
User avatar
Wave
Posts: 129
Joined: Tue Jan 04, 2022 6:57 pm
Has thanked: 85 times
Been thanked: 40 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Wave »

An "official" MiSTer boot sound would also be neat. :)
Or sound pack if menus ever got sound fx capability.
she/her
TwinFami
Posts: 9
Joined: Sun May 24, 2020 8:51 pm
Has thanked: 1 time
Been thanked: 1 time

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by TwinFami »

Doesn't work for me.

Tried starting up the script and it tells me

IndexError: Replacement index 1 out of range for positional args tuple
User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 97 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Moondandy »

Just heard about this feature in Luu's weekly MiSTer video, is a really fun feature!

Some thoughts:
Could uncompressed .wav files be played or are there issues loading larger files, similar to loading large background images?
Could you have a sister script that turns the music off when run?
Could update all, or downloader, grab the latest version of your script when run so it doesn't need to be manually updated?
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Thanks for the feedback everyone. Appreciate it. I'm working on a bigger update at the moment with all the features requested so far in the thread. Almost done but need to do a fair bit of testing
TwinFami wrote: Mon Apr 18, 2022 4:56 pm IndexError: Replacement index 1 out of range for positional args tuple
Thanks for reporting. Can you please take a photo of the error for me? There's not quite enough information here for me to go on, the error should also have a line number showing and maybe some other context. Thanks
AntialiasedPixel wrote: Sat Apr 16, 2022 4:50 pm One thing I notice is when launching a core, the volume seems to jump up a bit before it stops playing. I assume because of per-core volume settings, but overall a great new addition to the Mister toolbelt!
Glad it's working for you now. I will keep it in mind but I'm not sure I can change this. I'll check into how this works though, I'm guessing this is the OS setting the volume to the "core volume" level.
Moondandy wrote: Mon Apr 18, 2022 8:10 pm Could uncompressed .wav files be played or are there issues loading larger files, similar to loading large background images?
Could you have a sister script that turns the music off when run?
Could update all, or downloader, grab the latest version of your script when run so it doesn't need to be manually updated?
I just watched the video that's so cool!
  • Yes, you should be able to already. It was a feature I added but didn't announce. If you have the latest version from github .wav files will work like any other file. I am also adding support for vgm files and internet radio playlists
  • When you run the script the first time it creates some extra script in the Scripts menu for stop, play and skip. I think the stop one is what you want. In the next version you can also disable anything playing even on core change and disable starting on boot
  • That would certainly be cool but not something I have any control of. I suspect the maintainers of those scripts won't be interested until this script is in a stable and proven state
User avatar
Sigismond0
Posts: 339
Joined: Mon May 25, 2020 2:21 am
Has thanked: 1 time
Been thanked: 66 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Sigismond0 »

wizzo wrote: Tue Apr 19, 2022 1:49 am
  • That would certainly be cool but not something I have any control of. I suspect the maintainers of those scripts won't be interested until this script is in a stable and proven state
If you want downloader support, you just need to set up BGM with a downloader-friendly repository format. See below. Once you have the zip made, anyone can add BGM to their updater ini, and it'll update along with everything else.

https://github.com/MiSTer-devel/Downloa ... tabases.md
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Sigismond0 wrote: Tue Apr 19, 2022 1:13 pm If you want downloader support, you just need to set up BGM with a downloader-friendly repository format. See below. Once you have the zip made, anyone can add BGM to their updater ini, and it'll update along with everything else.

https://github.com/MiSTer-devel/Downloa ... tabases.md
Ahh I see. That makes sense. Thank you! I will add this soon
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

The new update is now live on github. I've added these new features:
  • .vgm file support (can be .vgz and .vgm.gz files too)
  • Ability to create separate playlists by making subfolders in the music folder
  • New playback type to disable all music except boot sounds
  • New control GUI for playback control and config settings
  • Internet radio support (see the docs on github for how to do this)
  • Per track looping, configure individual tracks to loop a certain number of times
  • Disable service from starting on boot from config
  • Allow music to play during cores if configured
The update will probably work fine just by copying over the new script, but you should do the following: delete your existing bgm.ini file, delete the bgm_stop/play/skip scripts (or don't if you like them, they'll always works, but have been replaced by the new GUI) and delete the BGM startup lines from your linux/user-startup.sh file (or don't, it'll still work but the new entry is much better integrated with the mister OS)

Once you've done that, just re-run the bgm script and let it set itself up again. I'll try not to require manual update steps from now on

Make sure to read the docs on github before you try a new feature so you know how it works. I expect I've introduced a lot of bugs so I'd appreciate if people can report any they find. Thanks!
Stupid Dufus
Posts: 152
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 87 times
Been thanked: 46 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Stupid Dufus »

Finally trying this for the first time. Ran the script, it created /fat/music. I copied over five mp3s starting with _ in front for random startup music. After subsequent reboots it plays a random track as expected. =)

But running the script again doesn't give any type of gui (says to add files to /music and run the script again) and music continues to play in cores.

my bgm.ini is as follows, and I haven't changed it at all:

Code: Select all

[bgm]
playback = random
playlist = none
startup = yes
playincore = no
debug = no
Any suggestions on what I can try to get it working properly?
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Stupid Dufus wrote: Wed Apr 20, 2022 12:10 pm Finally trying this for the first time. Ran the script, it created /fat/music. I coped five mp3s starting with _ in front for random startup music. After subsequent reboots it plays a random track as expected. =)

But running the script again doesn't give any type of gui and music continues to play in cores.

my bgm.ini is as follows, and I haven't changed it at all:

Code: Select all

[bgm]
playback = random
playlist = none
startup = yes
playincore = no
debug = no
Any suggestions on what I can try to get it working properly?
Thanks for giving it a shot. That's really strange. When you run bgm from the scripts menu again it just does nothing? Or is there some output at all? Errors? The behaviour at the moment isn't super intuitive, the first time you run it will start the service, then it quits. The second time you run it will start the GUI. But that's just on first set up, it should always start the GUI if music is playing at the time.

Would you mind changing the debug line in your ini file to "yes", reboot, try to start a core and have it keep playing music in the core, then paste the contents of the file "/tmp/bgm.log" here? The log file disappears when you reboot so you'll have to copy it over with FTP or SSH.
Stupid Dufus
Posts: 152
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 87 times
Been thanked: 46 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Stupid Dufus »

Sorry, just edited my post to add a bit.

When I run the script again, I get:

Code: Select all

/root# cd /media/fat/Scripts
/media/fat/Scripts# ./bgm.sh
Add music files to /media/fat/music and re-run this script to start.
/media/fat/Scripts#
Turned on debug, rebooted and music started. Loaded up a core, and here's the log (with music playing on top of the core):

Code: Select all

[2022-04-20T12:51:28.174480] Starting service...
[2022-04-20T12:51:28.175222] Playlist folder: /media/fat/music
[2022-04-20T12:51:28.176041] Starting remote...
[2022-04-20T12:51:28.178756] Selected boot track: /media/fat/music/_Sega Genesis Mini - Menu Music.mp3
[2022-04-20T12:51:28.182555] Now playing: /media/fat/music/_Sega Genesis Mini - Menu Music.mp3
[2022-04-20T12:51:28.184894] Loop #1
[2022-04-20T12:51:28.239747] High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
[2022-04-20T12:51:28.241377] 	version 1.25.15; written and copyright by Michael Hipp and others
[2022-04-20T12:51:28.242214] 	free software (LGPL) without any warranty but with best wishes
[2022-04-20T12:51:28.320223] Directory: /media/fat/music/
[2022-04-20T12:51:28.321071] Playing MPEG stream 1 of 1: _Sega Genesis Mini - Menu Music.mp3 ...
[2022-04-20T12:51:28.331832] MPEG 1.0 L III cbr192 48000 stereo
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Stupid Dufus wrote: Wed Apr 20, 2022 12:54 pm Sorry, just edited my post to add a bit.

When I run the script again, I get:
Thanks mate. So I think I've almost got this worked out. I hadn't really tested a setup with *only* boot sounds. The control script thinks you have no music files available so is refusing to start, because it doesn't count start up sounds as regular files. It doesn't fix your problem but you can bring up the GUI by popping a regular music file, without a _ in front, in the music folder and launching it again. You can change the playback setting to disabled in the GUI top stop stuff playing.

I will put a bug fix in the next day or so to make the experience better when you're only using boot sounds.

I'm a bit confused about when you say it's playing into cores though. Are you saying that the startup sound plays, and then you start a core and it starts playing more music sounds that you've marked as boot sounds? Or are you saying that if you launch a core while a boot sound is playing, the sound continues playing until it finishes (but it's playing over the top of a launched core) and then stops?

If it's the second one, that's a known issue. But if it's bothering people I will bump it up higher to be fixed
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Actually I've just noticed you're using menu music as a boot up sounds. Have you tried simply getting rid of the _ before all your file names and seeing that that works for you? The intention for the boot up sounds thing is for very short (like 3 second) sounds to play before the real stuff happens
User avatar
Sigismond0
Posts: 339
Joined: Mon May 25, 2020 2:21 am
Has thanked: 1 time
Been thanked: 66 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Sigismond0 »

GUI update is working great for me. Haven't tested all features, but seems good from what I've seen so far.
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 199 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by lamarax »

wizzo wrote: Wed Apr 20, 2022 3:34 am
  • Internet radio support (see the docs on github for how to do this)
Hello wizzo,

I can't seem to get this feature working. Here's an example .pls I tried with (among others):

Code: Select all

[playlist]
numberofentries=1
File1=http://allstream.rainwave.cc:8000/all.mp3
Title1=Rainwave.cc All Stream
Length1=-1
version=2
I placed it alone inside its dedicated subfolder, as per instructions. To be sure, I tested with MP Classic as well and it played fine. Any ideas?

PS: I also made a file with only the bare url in it; still no go
Stupid Dufus
Posts: 152
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 87 times
Been thanked: 46 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Stupid Dufus »

wizzo wrote: Wed Apr 20, 2022 1:16 pm Thanks mate. So I think I've almost got this worked out. I hadn't really tested a setup with *only* boot sounds. The control script thinks you have no music files available so is refusing to start, because it doesn't count start up sounds as regular files. It doesn't fix your problem but you can bring up the GUI by popping a regular music file, without a _ in front, in the music folder and launching it again. You can change the playback setting to disabled in the GUI top stop stuff playing.

I will put a bug fix in the next day or so to make the experience better when you're only using boot sounds.

I'm a bit confused about when you say it's playing into cores though. Are you saying that the startup sound plays, and then you start a core and it starts playing more music sounds that you've marked as boot sounds? Or are you saying that if you launch a core while a boot sound is playing, the sound continues playing until it finishes (but it's playing over the top of a launched core) and then stops?

If it's the second one, that's a known issue. But if it's bothering people I will bump it up higher to be fixed
Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.

Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
RxMxG
Posts: 3
Joined: Wed Feb 16, 2022 11:13 am
Has thanked: 9 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by RxMxG »

This is exactly what I need! After using mpg123 to play music but won't stop when I choose any core, I gave up lol
Thank you so much Wizzo, cheers!
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

Sigismond0 wrote: Wed Apr 20, 2022 1:50 pm GUI update is working great for me. Haven't tested all features, but seems good from what I've seen so far.
Awesome! Thanks for testing
lamarax wrote: Wed Apr 20, 2022 6:55 pm
wizzo wrote: Wed Apr 20, 2022 3:34 am
  • Internet radio support (see the docs on github for how to do this)
I placed it alone inside its dedicated subfolder, as per instructions. To be sure, I tested with MP Classic as well and it played fine. Any ideas?

PS: I also made a file with only the bare url in it; still no go
I will do some testing on this. The radio thing is pretty basic at the moment, I should improve it to support actual playlist files to get that url. I'm surprised the url by itself didn't work though. It seems to play just fine directly with mpg123
Stupid Dufus wrote: Thu Apr 21, 2022 1:38 am Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.

Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
Try removing the underscore from all your files and see how it works for you. I'm still thinking you're better off not having anything set as a boot sound
RxMxG wrote: Thu Apr 21, 2022 8:55 am This is exactly what I need! After using mpg123 to play music but won't stop when I choose any core, I gave up lol
Thank you so much Wizzo, cheers!
You're welcome!
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 199 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by lamarax »

wizzo wrote: Thu Apr 21, 2022 1:23 pm I'm surprised the url by itself didn't work though. It seems to play just fine directly with mpg123
Hey, whaddayaknow! Tried again today to verify and indeed non-secure, bare urls do work! Yesterday I was attempting with a https url (different than the rainwave one above; in fact it was from arcaderadio.com), which obviously couldn't get resolved.

Sorry for sounding a false alarm :oops:

Here are a couple of stations to get anyone started, besides rainwave and its dedicated channels:
internet-radio.zip
Ready for use with bgm.sh
(2.74 KiB) Downloaded 212 times
Thanks wizzo!
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 199 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by lamarax »

Great job in making automatic updates compatible with the downloader script! However, the correct entry inside downloader.ini should look like this:

Code: Select all

[bgm]
db_url = https://raw.githubusercontent.com/wizzomafizzo/MiSTer_BGM/main/bgm.json
I don't have a github account, so I can't post an issue about this there, sorry :)
Stupid Dufus
Posts: 152
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 87 times
Been thanked: 46 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Stupid Dufus »

wizzo wrote: Thu Apr 21, 2022 1:23 pm
Stupid Dufus wrote: Thu Apr 21, 2022 1:38 am Ah, yeah. I only had files with a _ in front. I threw an extra file in there without a _, and now I get the GUI. But none of the _ files are playable from the GUI.

Regarding audio continuing to play, yes, the same mp3 keeps playing on top of anything loaded in a core (though with a brief pause while the core is loading), so it becomes quite noisy ^^
Try removing the underscore from all your files and see how it works for you. I'm still thinking you're better off not having anything set as a boot sound
Removed _ from all the files, and now it seems to be working. Will still pick a track at random on a hard reboot or power cycle and no longer plays on top of a core. Thanks!
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

New version is available on downloader. This is mostly bug fixes but I have added an "all" meta playlist which combines all the playlists together, and playlists can now contain subfolders (any level deep) so you can keep your files better organised if you want. I also made the radio playlist file support a little smarter so you should be able to use any .pls files now.

I'm still open to suggestions but otherwise I'd say this thing is almost feature complete. I'll be working on the web remote thing next.
User avatar
Sigismond0
Posts: 339
Joined: Mon May 25, 2020 2:21 am
Has thanked: 1 time
Been thanked: 66 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Sigismond0 »

Loving the internet radio support. Just need a medium length boot sound to let WiFi come online, then Rainwave chiptune is perfect!
User avatar
PistolsAtDawn
Posts: 336
Joined: Fri Feb 18, 2022 7:29 pm
Has thanked: 232 times
Been thanked: 90 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by PistolsAtDawn »

This is really great! Thank you for this!

I've got my MiSTer loaded up with EarthBound tracks to start off. Many of those make really chill bg music.
iso70x
Posts: 4
Joined: Tue May 25, 2021 9:09 am
Has thanked: 1 time
Been thanked: 1 time

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by iso70x »

Thanks for this great feature, really cool. :)
User avatar
lamarax
Top Contributor
Posts: 472
Joined: Wed Nov 11, 2020 6:28 pm
Has thanked: 33 times
Been thanked: 199 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by lamarax »

User avatar
Captain FPGA
Posts: 371
Joined: Sun Apr 11, 2021 9:19 pm
Has thanked: 194 times
Been thanked: 25 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by Captain FPGA »

So I tried this, the install went through except, I can't get music to come on at start. What am I missing here?

EDIT: NM I'm an idiot. Got it working on startup after downloading the latest bgm script. Great job boss! 👍
Dreams don't die!
Image
djvj
Posts: 3
Joined: Mon May 25, 2020 5:45 pm

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by djvj »

Can't get the boot sounds to play. I put them in music starting with an _.

Are these working for anyone?
User avatar
wizzo
Scripting Wizard
Posts: 183
Joined: Sat Mar 12, 2022 11:32 am
Has thanked: 15 times
Been thanked: 240 times

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by wizzo »

djvj wrote: Fri Apr 29, 2022 11:19 pm Can't get the boot sounds to play. I put them in music starting with an _.

Are these working for anyone?
I haven't had any reports of them not working. Are you using a playlist? It will only pick up boot sounds from the current playlist. And what's the full filename of one of them?
djvj
Posts: 3
Joined: Mon May 25, 2020 5:45 pm

Re: MiSTer BGM - Background Music for the MiSTer Menu

Unread post by djvj »

They are named like this:
/media/fat/music/_Sega Dreamcast - Boot.mp3
/media/fat/music/_Sony PS1 - Boot.mp3

My playlists are in subfolders with a pls file. Everything else works great. The boot sounds need to be in a playlist as well? I thought they just need to be prefixed with an underscore.
Post Reply