Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: jorgealdo on July 10, 2012, 11:31:58 am
-
Maybe something like that :
http://www.soundhelix.com/
could add new atmosphere to the game ?
maybe control the music speed/pace in sync with current game actitivity, ie : during a fight music speed goes up and slows down when theres nothing happenning ?
-
FS2 already has a pretty solid dynamic music system, and it's possible to finetune it through mission scripting. What capabilities would this library have that is not present already?
-
I did not know FS2 had dynamic music (???) Is it trully procedural ?
http://www.soundhelix.com/audio-examples
All generated procedurally. The sound quality is amazing.
It can pass a "music" turing test.
-
please define "procedural". completely procedural, aka music generated on the fly, ala what the demomakers of old loved to do, or "procedural" as in plays stuff in regard to events happening. if its the latter, its built into FSO already. has been since FS1 if memory serves :p
and the former is just silly. the one thing the general FSO community hasnt been lacking much is music artists, and they will almost always produce better stuff than some automatic application :p
[edit] also, its in Java and GPL'd. Both are thoroughly uncompatible with FSO. Former cause FSO is C/C++ code, with lua for scripting, latter because FSO is not released under GPL, but rather a strict non-commercial license, due to Volition originally releasing the source code that way.
-
To be honest most procedurally generated music I hear sounds to me like someone has just got a new set of Samples on Acid Pro and must use absolutely every last one in each track until it sounds like Rolands entire range falling down a flight of stairs. These things tend to understand the importance of sound, but not the importance of silence.
Also, the problem of CPU time is a factor, I'd rather those cycles were used for things like AI or collision detection than music, because there is often more control by using pre-recorded tracks than generated ones, especially for themed Mods like B5, Shadows of Lylat, Diaspora, TAP or FoTG.
-
Even with good quality musicians, your music will be "repetitive"
Even if not used directly by the game engine, its like giving a Rifle to a Crossbowman : If the guy can do amazing things with a crossbow, he can only do better with a rifle.
This engine allows "remixing". Ie .: See example 8 in the page, the guy took an already existing music (spy vs spy soundtrack) and made the engine remix it.
You can take small pieces of music and remix then on the fly, selecting then based on game events, and you will have the best of both worlds. Human generated music plus a incredible range of remix effects that makes the music never sound the same but have the same "aura".
If the java/license is a problem, you could use SoundHelix as a kind of external application or via the JNI. The licence doesnt matter as long as its downloaded separate (I believe even if the files are in the same download, as long as you dont mix dlls/jar with freespace code, you can send both in the same tarball, provided you make it clear the difference in licenses).
Sorry for my bad english, sometimes i have a hard time trying to make myself understandable.
-
Well, feel free to code it in.
-
Thing is, Sound Helix doesn't generate 'music' as such, it generates MIDI impulses, which then need to be converted into audio using either a VST system or the built-in Midi processor on your computer. Most sound cards have extremely limited flexibility with regards to General MIDI sounds, and VST systems are so memory intensive that they would impact performance.
So you are left with either something that sounds very retro, which may work for some Mods, but not for most of them, or pre-recording using high quality VST systems and then playing them back on request, which is more or less where you started.
-
What we need is a reverse engineered version of iMuse system from DOS era X-Wing series. Starting with MIDI would be a good starting point, with some nice sound font, then expand to other music data file types and support for proper instrument sample libraries.
Then someone just needs to transcribe the original music scores into MIDI or other formats and we'll be all set!
(http://weknowmemes.com/wp-content/uploads/2011/05/insanity-wolf-template.jpg)
-
Heh, Dan Wentz could probably supply the original Midi impulse tracks for his stuff, but it would mean absolutely nothing to a standard soundcard because they are applied to a specific VST which itself has a specific sound-set loaded :)
For example, Kontakt can be a full String orchestra, a set of Taiko Drums, a weird background drone or even a sample of vocals depending on which library you are using at the time, and could also be all of the above separated into multiple MIDI channels (in fact, that is how Kontakt is most commonly used). Program '1' on General Midi is usually an upright Piano, whereas Program '1' on a VST setup could be absolutely anything, so you'd need to do an awful lot of re-linking tracks to audio in order to get something close to a recognizable track.
Worse still, if one of those tracks is using a sequencer, it'd just come out as a single droning note on any other instrument because the note-changes are being done by the VST itself, not the MIDI track.
-
Something that would be cool would be a dynamic music system like in subversion: (http://www.youtube.com/watch?v=0EEB_rV_URQ), where individual loops can be triggered by events. But that seems like a lot of effort.
-
did you ever even try FS2's music system? because, thats the gist of how the **** it works!
-
Of course I have. But, for example, I can't do things like overlay enemy arrive sounds into the soundtrack, nor can I tie a loop into a specific ship arriving, or asploding, for example.
Besides, I was just musing, I don't expect something like that to be implemented any time soon.
-
oh really? http://www.hard-light.net/forums/index.php?topic=78475
just tie that into whatever sexp you want.
-
Oh cool. Thanks!
Does that support the syncing measures thing that normal FS soundtracks do?
-
I have one question...
...Does your procedural software generate... metal?
-
Oh cool. Thanks!
Does that support the syncing measures thing that normal FS soundtracks do?
i dont think so unfortunately. i think it just plays the new track over the old one. need to check at some point.
-
I have one question...
...Does your procedural software generate... metal?
Its not mine. Its just the best opensource procedural music generator that i found around.
Yes it can generate metal, disco, trance whatever.
IIRC it struggles with classical music, but this is understandable.
-
Just fired this up. :yes:
/me likes
-
Theres a way to tie SoundHelix to FreeSpace state.
Just give us shared memory.
Contents of shared memory would include all objects in current gameplay and boolean saing if the game is in briefing/debriefing screen OR in mid of a mission
Objects should be described by faction, position x,y,z, speed vector, acceleration vector plus target.
This would help with :
Homebrew cockpits for FS2 AND indirectly would allow someone to tie SoundHelix to FS2 by using the exported state to predict if the gameplay is in an intense battle or in a calm state...
(the ammount of nearby enemies increases the sound kind etc)
Users wanting to activate the bridge between soundhelix and FS2 would disable game-internal music and download a third party application that takes data from the shared memmory to drive soundhelix (or any other sound generator).
What you think ?
-
Sounds a lot like what we've got with LUA already...
-
Indeed. If there is a lua module that can be imported into the scipting environment, then you're already most of the way there.
As for making allowances for other interfaces, it's not something we (as the SCP) have a lot of interest in. We like to keep code complexity to a minimum; adding dedicated hooks for external, optional libraries is only warranted when there's a clear benefit to doing so (as, for example, demonstrated by the TrackIR plugin). In this case, I think the preferred way to do it would be to prototype such an interface using the lua API, and turn it into a built-in interface if (and only if) there's a lot of demand for it and clear performance benefits to be achieved by it.
In other words, if you want it so much, why don't you start working on a lua-based interface solution to show this off?
-
How can i try the LUA interface ?
Wich version holds it ?
I am still mastering SoundHelix because the thing has like 10000 variable to setup a music...
Edit:
I believe i found a good solution :
All logic is handled by the LUA script.
LUA script needs to be able to communicate to soundhelix jar.
It can be done two ways (simple)
1 - Allowing LUA to call external applications (Something that is not permitted under most circunstances due to secutiry risk). LUA would talk to a custom soundhelix jar using the standard input/output of the spawned process
2 - Allowing LUA to communicate with another application via TCP/IP (Basically UDP packets via 127.0.0.1). This is preferred cause its much less risky. I prefer this way.
On the custom JAR side there will be 3 simple functions :
1 - Start a music XML with random seed. Each music XML will be premade with parameters corresponding to certain situations (Danger, Idleness etc).
2 - Fade out the current music (allowing transition from one state to the other).
3 - Stop current music.
LUA can then send commands to start, fade out, stop and start another music upon game state change. Thats not all that hard.
Later i will try to find a way to allow on-the-fly music transitions without the need to fade out.
From the SoundHelix page, this is a very simple SoundHelix player :
import java.net.URL;
import com.soundhelix.player.Player;
import com.soundhelix.util.SongUtils;
public class SoundHelixTest {
public static void main(String[] args) {
try {
Player player = SongUtils.generateSong(new URL("http://www.soundhelix.com/applet/examples/SoundHelix-Piano.xml"),
System.nanoTime());
player.open();
player.play();
player.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Not complicate in any way. All i need is to add capability to talk via UDP and find a simple way to change music volume as a fading measure from inside the JAR. Maybe its dependent on the MIDI device being used ? Do FS2 use MIDI ? If not, just fade out the MIDI volume slider would be pretty simple and would not interfere with anything else.
On the LUA side i need a way to scan current mission to detect enemy presence and a metric to weight enemy aggregate firepower vs friendly aggregate firepower. I think this is a good parameter to decide the music speed. At least would be a good easy start.
Sounds reasonable ?
-
On the LUA side i need a way to scan current mission to detect enemy presence and a metric to weight enemy aggregate firepower vs friendly aggregate firepower.
All information needed to do this is already provided in the lua API (the mn.Ships table holds a list of all ships in the mission).
Network access in lua can be handled by a lua library like this one: http://w3.impa.br/~diego/software/luasocket/
For general info on how to use lua scripts in FSO, read this page on the wiki: http://www.hard-light.net/wiki/index.php/Scripting.tbl
-
the other day i was reading about alien (http://alien.luaforge.net/), a module which apparently lets you can talk to any dll you want if you have the function prototypes. it handles the type conversions for you. the other option is to build a lua module proper that provides the neccisary api interfaces.