News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[Project proposal] Optional music and podcast integration

Started by victor_18993, Yesterday at 01:00:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

victor_18993

I am considering adding optional external audio support to Simutrans, but I would only implement it if there is real interest from the community.

The idea is to integrate it into the existing Music options, so players could keep the normal Simutrans soundtrack, use local music, or connect a supported streaming provider. From inside Simutrans they could browse their own playlists and control playback without leaving the game.

For podcasts, the same interface could allow players to search subscriptions/episodes and listen while playing, using open podcast feeds where possible.

Simutrans would not download, copy or redistribute music or podcast files. Playback would come directly from the provider or podcast feed.
Possible music providers include:

  • Apple Music
  • Audius
  • Jamendo
  • Deezer — subject to final API/usage confirmation
  • Qobuz — likely requires API/partner approval

Spotify cannot currently be integrated, because Spotify's Developer Policy explicitly prohibits using the Spotify Platform inside games.
For podcasts, possible sources include:
  • Podcast Index
  • RSS feeds directly
  • Listen Notes / similar podcast directories

The goal is simply to make long Simutrans sessions more comfortable and immersive: players could stay inside their Simutrans world while listening to their own music or podcasts.

This is only a proposal for now. I would implement it only if the community considers it useful.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Isaac Eiland-Hall

If it gets implemented, I can see hosting a site for music. A worry would be allowing others to upload, but I might open it to Devotees contributing. Might be worth figuring out how to make it so that when simutrans send the request to the site, it has to provide some sort of key - imho, it'd be fine to be a single key for all of Simutrans - the idea being make it just difficult enough to discourage random passersby while keeping it simple for Simutrans.

It would be really awesome to be able to create music for Simutrans. We had some really great compositions a few years ago, and MIDI isn't.... well, okay, it is terrible. heh. But being able to create stuff to share as like mp3 or whatever actual audio format would be nice.

prissi

Support for sample playback is absolutely easy. Actually, the windows version can play mp3 inside wav files since forever.
Turning the midi to mp3 would also allow to get rid of the huge and hard to include midi lab with its huge soundfonts. MIDI indeed is a fossil from DOS.
But Simutrans is not excluding normal player running beside it. Also, the midi player interface is rather rudimentary. Hence, player use the favourite software parallel to Simutrans seems like a better option.
Finally, I am uncomfortable to bind commercial links to Simutrans, feeling like an endorsement of streaming services with their questionable impact on niche music. (Even though that ship has long sailed.) For me, streaming music is a personal choice but nothing Simutrans should endorse.
Maybe I am too old though.
So I am all for turning music support to mp3, but that's about it.

makie

I fully agree with Prissi.

Another point is the Android Play Store. We currently state that we do not pass on any data to third-party services. That would then have to be changed to a complex privacy policy requiring user consent, etc.

Support for MP3 audio in the simutrans/music folder or the pak???/sound would be nice.
Maybe there are free music oder sounds that we could provide.

victor_18993

Thanks for the feedback. I think I should clarify the idea a little better.

The intention is not to link Simutrans to, endorse, or depend on any commercial music platform. Apple Music, Audius, Jamendo, etc. were simply examples of services that expose APIs that could technically be used by an optional audio-provider interface.

The design I have in mind would be provider-neutral. If there is an open-source or community-oriented service that fits Simutrans better, please suggest it and I will gladly investigate its API.

Isaac's idea of hosting music for Simutrans is also very interesting. We could support a community-hosted catalogue alongside local music, podcasts/RSS and any optional external providers, all through the same player interface.

Regarding privacy, Simutrans would not collect user credentials, account passwords or personal information, nor send Simutrans user data to third parties. For services such as Apple Music, the user explicitly authorizes their existing account and the client communicates directly with that provider using an authorization token. Simutrans would only request the minimum information required for playback, such as playlists and tracks.

There would be no hidden telemetry or automatic connection to any external service. Nothing would happen unless the player explicitly enables and authorizes a provider.

So the goal is really broader than integrating a particular commercial service: to create an optional, neutral audio layer that lets the player choose how they want to experience Simutrans.
En la vida todo son vivencias y cada una de ellas nos hace mas grandes,¿Como de grande eres tu? :)

Isaac Eiland-Hall

Also notably, if people want to stream music from an existing provider, they can probably typically do that while playing Simutrans. I'm not sure about Android offhand, I've not tried to stream in the background while playing a game. But for desktop users at least, they can surely stream music in the background seamlessly.

But being able to provide curated channels of music like The Sims does would be nice.

While thinking about how I'd like something like this to work - just throwing this out here, not the suggestion on how I think it shoudl work:

- Multiple channels available to sort out possible styles of music - if we enough enough tracks to warrant it. I could envision old-time public domain music, with some Railroad Tycoon style stuff, some big band style. Maybe jazz, maybe stuff that feels like a city, maybe upbeat stuff, maybe laid-back stuff. A single track appearing in applicable categories
- Just occurrred to me, a special channel that plays music from the decade you're in - or rather, each track has a year associated, and every time the year changes, the playlist updates to play stuff mostly from the past 5 years or decade, weighted toward the new stuff but set so it doesn't repeat too often, allowing some older stuff up to the past 20 years, weighted less as the time goes back.
- Ability like The Sims to uncheck tracks so they don't play so ones people hate won't play
- In an ideal world, we'd have music from multiple places - at least the countries from which we have enough uers to contribute music.

So ideally you could choose one or more styles of music, one or more regions of music, one or more eras of music.

And maybe allow for curated lists - someone can create a playlist that they like or think others would.

That's very very complex on options. Too much to start. But a slew of ideas means others can refine and improve and come up with better ideas.

To start, having a single "channel" means replicating the music options we have now, just mp3/etc instead of MIDI. heh.

So per-pak music would already be an improvement and another wy for paks to differentiate themselves :)

But I'd definitely love to find some music like Railroad Tycoon that we could bring in.

makie

It would be useful for adding a bit more atmosphere to the game if buildings like the CUR could have a sound effect—similar to the factories when the cursor is nearby.

Nazalassa

#7
If the music is unrelated to the state of the game itself, then I think anyone can use their favourite audio player to listen to whatever they want. No need for the game to do this itself.
If it depends on the state of the game (e.g season, year, pax transported, etc.) then there are endless possibilities, so they cannot all be implemented in the program itself. People may want widely different things, so implementing only some will likely not have everyone covered.

Maybe add "music-scripts"? i.e use a script to change the music, perhaps by providing an "on_music_change" callback so each time the music changes the script decides which goes next. The game gets the music name etc. form the file, unless the script says otherwise. The scripts would be within the music/ directory and could be selected from the sound settings. The game does nothing more.

This allows payers to write their own music-scripts.

An example:
 - installation instructions: drop file openttd-music.nut and directory openttd in the music/ directory
 - script looks like: (pseudo-code, I cannot squirrel yet)
path = "openttd/"
function on_music_change do
   file = random_file_under(path)
   return file
end

More advanced scripts could conceivably e.g access the internet, find a music published in they current game-year, download it, and play it. Although maybe not from the squirrel scripts...

(This however does not work for reading audio streams, without downloading a file. Maybe another callback, to supply audio data directly?)
Making paks since October 2023  |  pak48.bitlit | pak32.box | MLM for pak64 | Empire F7 cars | Pneumatic tubes | More pak64 vehicles and industries

Life is like a multi-tasking OS: you know you'll eventually get back to everything, but you don't know when.