Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sega 500 Custom Music using Ogg Vorbis Jeff “Ezeikeil” Giles

Similar presentations


Presentation on theme: "Sega 500 Custom Music using Ogg Vorbis Jeff “Ezeikeil” Giles"— Presentation transcript:

1 Sega 500 Custom Music using Ogg Vorbis Jeff “Ezeikeil” Giles jgiles@artschool.com http://gamestudies.cdis.org/~jgiles

2 Audio to date We’ve imported our own noise files into UT. And cover so much audio theory in the last 2 days, it’s coming our of our ears.

3 Audio to Date All we’ve cover is small sound files we use as in game effects. But have done nothing with the music…

4 Music in UT2k3 This is one of those items that has radically changed. The previous version used to import from Digitally mixed music (.mod,.s3m,.it, etc). These are special music formats which include digitally recorded instruments as well as sequencing data.

5 Music in UT2k3 Games that use the earlier Unreal Engine builds (like Unreal, UT and Deus Ex) support Direct music (MID, MIDI and RMI) and (Music) Modules - usually shortened to "MOD“. Which were then converted into.umx files

6 Music in UT2k3 Basically, a umx file doesn't contain anything special except for the music track itself which was imported into it. (not entirely true, but will do for our purposes).

7 Music in UT2k3 Also, CD audio could be used as music in maps. However, CDA files don't need to be imported into a umx. You can just assign a track number to your map.

8 Music in UT2k3 Now, as we all know, music can be one of the most important factors in your map. Setting the right music can create an awesome atmosphere and improve game play.

9 Music in UT2k3 And the UT2003 uses an incredible, open source, licence free audio format known as Ogg Vorbis. http://www.vorbis.com

10 Music in UT2k3 This new system of using ogg file completely does away with the old MOD music and umx formats.

11 Music in UT2k3 Here’s an expert from an IRC chat log I found from an interview with the boys at epic (Mark Rein, Epic, VP ) [21:54] oh, and is module music stuff supported? [21:54] Usaa--> Good question. I don't think so. [21:56] USaa--> To mod music - I don't think it is supported with the new sound code [21:55] is the galaxy sound system totally out ? [21:56] Orpheus--> Galaxy is long gone. The new system won't cause so many support headaches.

12 Why Vorbis? Word used to be that U2 would use MP3s for its music. But to prohibit the notorious copyright infringements that are well-known with the use of MP3s.

13 Why Vorbis? Well, Ogg Vorbis is an open source encoding format and does NOT bring any licensing issues with it were MP3 does. And it brings lots of them too. Another pro about this format is its higher compression rate, which is even higher than the trusted MP3 format!

14 So what is Ogg Vorbis? Ogg Vorbis is a new audio compression format. It is roughly comparable to other formats used to store and play digital music, such as MP3, and other digital audio formats.

15 So what is Ogg Vorbis? It is different from these other formats because it is completely free, open, and unpatented.

16 More on Why Vorbis? Although not everyone realizes it, MP3 is a "lossy" format. Thus, much of the sound data is removed when MP3 files are created. Vorbis is also a "lossy" format, but uses superior acoustic models to reduce the damage. Thus, music released in Vorbis will sound better than a comparably sized MP3 file.

17 More on Why Vorbis? If you decide to sell your music in MP3 format, you are responsible for paying Fraunhofer a percentage of each sale because you are using their patents. Vorbis is patent and license-free, so you will never need to pay anyone in order to sell, give away, or stream your own music.

18 Using Vorbis OK, once again we’ve established that: free == good But how widely accepted is it?

19 Using Vorbis At this point quite…natively supported in Winamp 3 and a few other media players.

20 Using Vorbis Also, look at the frequency it’s running the audio. 44100hz! That’s CD quality!

21 Using Vorbis So sweet! Time to start ripping our own tunes into UT.

22 Using Vorbis Compression I’ve 2 tools to do this CDex and oggdropXPd. Both are free

23 Using Vorbis Compression CDex is a utility of extraction (ripping) any audio files from an audio CD. http://www.cdex.n3.net/ The files can be ripped in either the plain WAV format or to a compressed file format (CDex supports many encoders).

24 Using Vorbis Compression I used this to rip a track from CD into.wav or go directly into.ogg if I want Personally, I’d go wav first so I could edit the track in sound forge if need be.

25 Using Vorbis Compression But ripping straight to.ogg is real easy. Just hit the settings button and specify the compression format from the roll down.

26 Using Vorbis Compression If you like you can specify various bit rates for the compression. Here’s how I set mine up.

27 Using Vorbis Compression Now, as mentioned, You may want to edit your track some before compressing into an ogg. This means file to file…CDex won’t let you do this (at least not for the version available when I wrote this lesson). Straight CD ripping only.

28 Using Vorbis Compression So, I prefer to go from CD to wav, do my editing in soundforge and then convert to ogg via oggdropXPd.

29 Using Vorbis Compression Simply drag and drop your wav file. It’s default compression is really good! Get the OggDrop here. http://www.vorbis.com/software.psp?pid=2 http://www.vorbis.com/software.psp?pid=2

30 Using Vorbis Compression However, if it’s not enough, right click for options.

31 Using Vorbis Compression Just for giggles look at the differences in file size…wav, ogg and mp3 All at 44100hz.

32 Adding Your Music Once again, remarkably easy. Just move the new ogg file into the music directory.

33 Adding Your Music Now in your level properties, place the name of the song and your good to go… Simple…nes-pas?

34 Next track And that’s all it takes to get a custom music track into UT. Should you choose to, feel free to poke around the vorbis site. There are *lots* of tools and documentation.

35 Next track And it’s open source for all you code monkeys.

36 More for Code Monkeys Okay, we’ve covered lots on how to get some tunes into UT2003, but other than the level music, nothing so far on how to use them. …and yes, there is functionality for this.

37 More for Code Monkeys Lets start by looking at an item that we have already to play with. The MusicTrigger.

38 The MusicTrigger This little toy does exactly what it promises, toggles the music. We can turn it on, off or swap tunes if we so choose.

39 The MusicTrigger Now setting this up is not exactly what I would have expected being a trigger itself. The catch is that the music trigger is passive and that it doesn’t seem to handle triggering itself.

40 The MusicTrigger It sits waiting for a matching event to be broadcast by a trigger…much like the viewshaker. Regular trigger Tag: tunes Music trigger Event: tunes At which time it does it’s thing with the music.

41 The MusicTrigger Then the setup. Select your ogg file ( no post fix to the Name ).

42 The MusicTrigger How long you want the fade in our out to take.

43 The MusicTrigger And lastly specify if you want the songs to fade out or not. I recommend that you do, otherwise they’ll play at the same time.

44 More for Code Monkeys Ok, so for the code, how does this song get played. If you open up the actor class, you’ll find 3 handy functions:

45 More for Code Monkeys native final function int PlayMusic( string Song, float FadeInTime ); native final function StopMusic( int SongHandle, float FadeOutTime ); native final function StopAllMusic( float FadeOutTime ); And most of this is pretty straight forward. With one exception, PlayMusic returns an int.

46 More for Code Monkeys And, once again, the great gods of no documentation point and laugh in our general direction. But, in this case, it’s not that bad… actually… it’s kinda cool.

47 More for Code Monkeys Look at how it’s used in the MusicTrigger. SongHandle = PlayMusic( Song, FadeInTime ); …Thank you for good naming! We get a handle back which tells use which song is playing.

48 More for Code Monkeys Now, SongHandle is declared as transient, so the data does not presist: "objects belonging to this class should never be saved on disk". Only useful in conjunction with certain kinds of native classes which are non-persistent by nature, such as players or windows

49 More for Code Monkeys But as far as I can tell, there is no way to tell from the SongHandle what song is playing, just that one is. However, a handle can be passed into the StopMusic function to stop a specific song while it is playing.

50 More for Code Monkeys Yet, if you really need to know which some is playing, there is another way to find out. You can access it via the level. E.g. Somestring =level.song;

51 More for Code Monkeys And inside the levelinfo class, you’ll find a few oterh audio properties to play with: Not a lot, but I sure you can come with some interesting fun with these. var(Audio) stringSong;// Filename of the streaming song. var(Audio) floatPlayerDoppler;// Player doppler shift, 0=none, 1=full. var(Audio) floatMusicVolumeOverride;

52 Now that’s done, you can grove to your own funky beats in UT.


Download ppt "Sega 500 Custom Music using Ogg Vorbis Jeff “Ezeikeil” Giles"

Similar presentations


Ads by Google