Video Game Audio System (concept)

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
Retro Banana
Established Member
Posts: 41
Joined: Thu Feb 07, 2013 5:39 pm

Video Game Audio System (concept)

Post by Retro Banana »

I have an idea for video game music that might sound neat. The game is split up into two processes -- the game process (GP) and the audio process (AP). The GP can be any game that needs music. The AP is a finite state machine that dynamically plays and layers audio loops as well as runs them through, say Nyquist effects (they are very cross-platorm), to create unique music based on what variables are in its control variables.

The GP and the AP run independently, and the AP usually will try to stick to the rule of fours (4 beats, 4 measures) when changing loops. The AP might also play MIDI files, or even compose them itself based on key, tempo, genre, etc. playing through Fluidsynth or Timidity.

Example 1: Space dubstep boss fight
Let's say you're in the same general area as the boss. The GP would set the "genre" variable, causing the AP to merge between the old genre and the new one. The GP sets the "suspense" variable as you get closer to the boss. When the fight begins, the GP sets the "danger" variable, and the AP adds harder hitting drums, changes some Nyquist effects, and so on. When you have the boss at a critical level, the GP sets the "danger" variable even HIGHER, and when you win, it sets "danger" to a rather low level. Then the "genre" is set to something calmer.

Example 2: Dialog trees
You meet your friend Bob. He asks you how you are doing. You say fine. The "happy" goes up a bit. You say something mean? The "danger" goes up and the "happy" goes down. You say sorry. The "sad" goes up a bit, but "happy" goes up too, and "danger" goes down.

This is just a rough idea. Please improve on it.

-- Retro Banana
ssj71
Established Member
Posts: 1294
Joined: Tue Sep 25, 2012 6:36 pm
Has thanked: 1 time

Re: Video Game Audio System (concept)

Post by ssj71 »

[lsd] made a game behave a bit like this. See his blog: http://wootangent.net/2013/02/creating- ... -civilian/
_ssj71

music: https://soundcloud.com/ssj71
My plugins are Infamous! http://ssj71.github.io/infamousPlugins
I just want to get back to making music!
Retro Banana
Established Member
Posts: 41
Joined: Thu Feb 07, 2013 5:39 pm

Re: Video Game Audio System (concept)

Post by Retro Banana »

That's an interesting concept he had. I was thinking less that the game just sequences and layers loops, and more that the game makes incidental music, cueing appropriate loops and adding effects based on what you are doing.

If you draw, say, a magic sword, the music gets a more airy, aural feel. A sword that drains your life will add danger and power.

Could a tag-based system work? Say, have all of the audio loops in one folder with a text file that holds meta for each of them?
tnovelli
Established Member
Posts: 277
Joined: Wed Apr 20, 2011 4:52 pm

Re: Video Game Audio System (concept)

Post by tnovelli »

Cool. I remember lots of games with 'dynamic music' back in the chiptune days (~1985-95) and it was nice! Variable tempo FTW :)

Sometime I want to try this in HTML5 games. Realtime synthesis is *probably* possible with the newer WebAudio API, in Chrome and Safari anyway, not Firefox yet unfortunately. Hmm.. I get 5-10% cpu usage running the Drum Machine and Wavetable Synth demos here (https://chromium.googlecode.com/svn/tru ... index.html) so that's promising.
Post Reply