Page 2 of 4

Re: [WIP] Contextual Jukebox OXP

Posted: Sat Dec 11, 2021 10:01 pm
by Cholmondely
Thank you for this. It works just fine!

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 2:20 am
by Cholmondely
arquebus wrote: Fri Dec 10, 2021 10:19 pm
I don't know what I'm going to actually call it... maybe I'll keep it Contextual Jukebox? No idea.
If you have decided on a name for this .oxp, then I can put up a Wiki page for you! And then you can get user rights for the wiki. And then you can edit your page and pulverise it into oblivion!

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 3:15 am
by arquebus
Cholmondely wrote: Sun Dec 12, 2021 2:20 am
If you have decided on a name for this .oxp, then I can put up a Wiki page for you! And then you can get user rights for the wiki. And then you can edit your page and pulverise it into oblivion!
I'm going to tinker with it a bit more (probably just make it smaller... nobody needs that many "whoosh" ambient sounds) and then decide on a real name, and then I'll let you know!

I need to come up with a name that is less interesting, if I'm honest. I'd rather reserve "jukebox" for something that the player could control, and mine doesn't (and never will) do that.

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 3:22 am
by arquebus
Ok so it turns out the oxz doesn't work, at least not in Windows, because I zipped it on my Mac and it created a special folder.

I zip it on Windows but there's a .zip extension I can't figure out how to get rid of. It's hidden.

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 6:40 am
by hiran
arquebus wrote: Sun Dec 12, 2021 3:22 am
Ok so it turns out the oxz doesn't work, at least not in Windows, because I zipped it on my Mac and it created a special folder.

I zip it on Windows but there's a .zip extension I can't figure out how to get rid of. It's hidden.
ZIP extenion is hidden? That must be one of the 'features' of Windows Explorer.

In the ribbon, go to 'View'. In the 'show/hide' group, select 'File name extensions'.

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 7:55 am
by arquebus
hiran wrote: Sun Dec 12, 2021 6:40 am
arquebus wrote: Sun Dec 12, 2021 3:22 am
Ok so it turns out the oxz doesn't work, at least not in Windows, because I zipped it on my Mac and it created a special folder.

I zip it on Windows but there's a .zip extension I can't figure out how to get rid of. It's hidden.
ZIP extenion is hidden? That must be one of the 'features' of Windows Explorer.

In the ribbon, go to 'View'. In the 'show/hide' group, select 'File name extensions'.
Aha! Thanks, I'll see if I can get the oxz working correctly tomorrow.

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 3:45 pm
by hiran
arquebus wrote: Sun Dec 12, 2021 7:55 am
hiran wrote: Sun Dec 12, 2021 6:40 am
arquebus wrote: Sun Dec 12, 2021 3:22 am
Ok so it turns out the oxz doesn't work, at least not in Windows, because I zipped it on my Mac and it created a special folder.

I zip it on Windows but there's a .zip extension I can't figure out how to get rid of. It's hidden.
ZIP extenion is hidden? That must be one of the 'features' of Windows Explorer.

In the ribbon, go to 'View'. In the 'show/hide' group, select 'File name extensions'.
Aha! Thanks, I'll see if I can get the oxz working correctly tomorrow.
On top of that I could have a look at your zip file as well and tell you if I see any anomalies.

But what really caught my attention on this thread was that meanwhile I started enjoying the walz docking music. And thought it might be nice if we had more music background for other situations as well. Situations? Maybe silence or a slight whisper in empty space, something picking up when other ships are near, spiking up in alarm mode and climaxing during a dogfight when your health is just above the attacker's health...

Would that match the phrase 'Contextual Jukebox'? Then we have the same thing on mind. And Slartibartfast tried to add more variety to docking sequences, so he might know how to bring more music into Oolite. Probably we should try to work together.

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 4:35 pm
by arquebus
hiran wrote: Sun Dec 12, 2021 3:45 pm
And thought it might be nice if we had more music background for other situations as well. Situations? Maybe silence or a slight whisper in empty space, something picking up when other ships are near, spiking up in alarm mode and climaxing during a dogfight when your health is just above the attacker's health...
There are some events that I didn't use, mainly because it seems like they were more meant for "sound effects" than for music strictly so called.

But it would be great to have even more fine-grained contextual triggers, just as you say: so that the "soundtrack" to your game would be highly context dependent, and it could soften or crescendo as needed, in a much more granular, smooth fashion.

All of which is way above my skill set. :)

Re: [WIP] Contextual Jukebox OXP

Posted: Sun Dec 12, 2021 7:09 pm
by Cholmondely
arquebus wrote: Sun Dec 12, 2021 4:35 pm
hiran wrote: Sun Dec 12, 2021 3:45 pm
And thought it might be nice if we had more music background for other situations as well. Situations? Maybe silence or a slight whisper in empty space, something picking up when other ships are near, spiking up in alarm mode and climaxing during a dogfight when your health is just above the attacker's health...
There are some events that I didn't use, mainly because it seems like they were more meant for "sound effects" than for music strictly so called.

But it would be great to have even more fine-grained contextual triggers, just as you say: so that the "soundtrack" to your game would be highly context dependent, and it could soften or crescendo as needed, in a much more granular, smooth fashion.

All of which is way above my skill set. :)
I agree with both of you. But! Isn't it just super that we have what we have?

Re: [WIP] Contextual Jukebox OXP

Posted: Mon Dec 13, 2021 9:33 am
by hiran
Cholmondely wrote: Sun Dec 12, 2021 7:09 pm
arquebus wrote: Sun Dec 12, 2021 4:35 pm
hiran wrote: Sun Dec 12, 2021 3:45 pm
And thought it might be nice if we had more music background for other situations as well. Situations? Maybe silence or a slight whisper in empty space, something picking up when other ships are near, spiking up in alarm mode and climaxing during a dogfight when your health is just above the attacker's health...
There are some events that I didn't use, mainly because it seems like they were more meant for "sound effects" than for music strictly so called.

But it would be great to have even more fine-grained contextual triggers, just as you say: so that the "soundtrack" to your game would be highly context dependent, and it could soften or crescendo as needed, in a much more granular, smooth fashion.

All of which is way above my skill set. :)
I agree with both of you. But! Isn't it just super that we have what we have?
What we have is super. But if there are ideas to push on, why stay where we are?

Re: [WIP] Contextual Jukebox OXP

Posted: Mon Dec 13, 2021 9:47 am
by hiran
arquebus wrote: Sun Dec 12, 2021 4:35 pm
hiran wrote: Sun Dec 12, 2021 3:45 pm
And thought it might be nice if we had more music background for other situations as well. Situations? Maybe silence or a slight whisper in empty space, something picking up when other ships are near, spiking up in alarm mode and climaxing during a dogfight when your health is just above the attacker's health...
There are some events that I didn't use, mainly because it seems like they were more meant for "sound effects" than for music strictly so called.

But it would be great to have even more fine-grained contextual triggers, just as you say: so that the "soundtrack" to your game would be highly context dependent, and it could soften or crescendo as needed, in a much more granular, smooth fashion.

All of which is way above my skill set. :)
Happy to see you on the same track.

I would not give up just because that is beyond my skill set. Somehow my gut feeling is we need to properly dissect the problem to find digestable chunks.

For a programming model I think one metric could be sufficient: The tension factor - I will just call it tension.
The tension would usually degrade towards relaxation, and we could model that as a number slowly going down to zero. But on distinct events the tension would raise. That could be a witchspace misjump, getting attached/shot by another ship etc, etc. So those events would raise the tension by some value.

Now that we have this tension value and maybe the duration since when we have that value we could decide which music to play. From here the art is to have the right soundtrack for all kinds of situations. But when you look at movie soundtracks like https://www.youtube.com/watch?v=_oR0som ... 6A96CB74B1 it seems they compose music for all the different scenes that may occur, and after that the film team chooses the chunks of what to play when.

So we could - as a start - take some classic opera that is free to use, cut some chunks and try to have them playing in a loop - as long as the tension stays on the same threshold. When we find some other tension should be played introduce a transition chunk, then play the target chunk until tension changes again.

Would that be something we could try out?

Edit: To be on the safe side regarding copyright, let's choose music provided by the FMA.
https://freemusicarchive.org/FAQ_For_Videos/

Re: [WIP] Contextual Jukebox OXP

Posted: Mon Dec 13, 2021 4:12 pm
by arquebus
I think we would also need to have some kind of volume control for the music only. Both for the tension effects but also so that we can pick tracks that have different volume levels and then even them out when they play. I was able to get away with using the soundimage.org music because it all has the same sound level, more or less.

Re: [WIP] Contextual Jukebox OXP

Posted: Mon Dec 13, 2021 4:15 pm
by arquebus
The job would also be easier if, with volume control, we could fade in/out on the fly. That way we could use looping tracks without worrying about them cutting off.

Re: [WIP] Contextual Jukebox OXP

Posted: Tue Dec 14, 2021 12:32 am
by tsoj
arquebus wrote: Mon Dec 13, 2021 4:15 pm
The job would also be easier if, with volume control, we could fade in/out on the fly. That way we could use looping tracks without worrying about them cutting off.
While adding volume control to the JavaScript interface seems quite doable (if I understand correctly how OpenAL is used), we will have to see if the minimal update time of 0.25 seconds for the JavaScript timers is enough to produce a smooth fade out. I have no experience whatsoever in audio programming, so that might turn out fine or not at all. If it doesn't work, this probably has to be done in the core game loop and will involve much more new code.

Re: [WIP] Contextual Jukebox OXP

Posted: Wed Dec 15, 2021 3:47 pm
by hiran
tsoj wrote: Tue Dec 14, 2021 12:32 am
arquebus wrote: Mon Dec 13, 2021 4:15 pm
The job would also be easier if, with volume control, we could fade in/out on the fly. That way we could use looping tracks without worrying about them cutting off.
While adding volume control to the JavaScript interface seems quite doable (if I understand correctly how OpenAL is used), we will have to see if the minimal update time of 0.25 seconds for the JavaScript timers is enough to produce a smooth fade out. I have no experience whatsoever in audio programming, so that might turn out fine or not at all. If it doesn't work, this probably has to be done in the core game loop and will involve much more new code.
For now we should have chunks of music. One of the chunk is the repetitive section in the middle. Not too long. Then another one fading in and another one fading out. Plus all the chunks run through a compressor so they should have the same volume. This does nto have to be done on the fly in the game.

Maybe the effects can still be finetuned later - but we could run our first experiments to see if that enhances gameplay at all.