Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 12 posts ] 
Yeyinde
  Sun May 04, 2008 3:29 am
Rubber Shark
User avatar
Sponsor


Location: Beautiful British Columbia
How to Make Looping Oggs

Introduction

The Ogg Vorbis sound format is a perfect format for BGMs in VX.  Why?  Unlike XP, VX supports the streamed playback of Ogg files as well as looping Oggs.  What does this mean?  It means you can start playing a large song and loop back to a specific point in the song, much like the MIDI event b06f.  So why would you want to go through the trouble of making Oggs loop?  Simple: A much smaller project size, great quality, and your songs can loop.
This tutorial is on how to edit your Ogg files to be loop-able in VX.

What You Need

For this tutorial, I will be using four programs: Calculator, Notepad, Audacity, and WinVorbis.  Calculator and Notepad are standard applications, so you just need to download Audacity and WinVorbis.
Calculator will be used for calculating the values for the looping comments.
Notepad will be used to store the calculated values for when they're needed.
Audacity will be used for finding the exact section of the song that will loop.  You may download Audacity here:  http://audacity.sourceforge.net/
WinVorbis will be used to add the looping comments to the Ogg.  You may download WinVorbis here:  http://www.stationplaylist.com/winvorbis/

Step 1: Importing Your Ogg

Right click the Ogg file you want to loop and open it with Audacity.  If Audacity is not in the open with list, select "Choose Program" and find it.
Image
Once Audacity has imported your ogg, feel free to remove any white noise or blank at the beginning.  Just select the section you want to delete and press the "Delete" key.

Step 2: Finding Your Loop

This is quite possibly the most tedious step.  First, you'll want to get a general idea of where your loop is.  Once you have the idea, try to select the portion of the song that you want to loop.
Image
Don't worry about being exact right here.  A later phase of this step if to get it correct.

Now check to see how close your loop is.  Hold down SHIFT and press the PLAY button.  If the loop sounds near perfect, great! Else, you're going to have to try resizing the selection to make it closer.  Remember: You need to hit STOP before changing your selection!

Now it is time to get your loop to be exact! Zoom into the LEFT side of your loop and move the selection to something that can be easily matched.  It should be very close to your original selection.
Image

Next, do the same to the right hand side, making sure that if the left side was next to it, they'd meet up.
Image

Keep on adjusting the size of your selection until the loop is seamless.  Just remember to hit STOP before changing the selection.

Step 3: Calculating Your Values

Now that you have your loop perfectly looping, it's time to figure out the values to be used by the looping comments.

The first, and possibly the most important value is the "Sample Rate".  This tells the Ogg how many "samples" there are per second.  The Sample Rate can be figured out just by looking the the lower-left hand corner of Audacity.
Image
Record down this value in Notepad if you have trouble remembering it.

The second value is when your loop starts.  The thing to note is that Oggs don't use hours:minutes:seconds like we do.  Instead, they use sample positions.  To find the sample position of the loop's starting point, look once again to the lower-left corner of Audacity.
Image
Here, you'll find the time the loop starts, the time the loop ends, and how long the loop is.  These are all in minutes:seconds, so we'll need to convert them to sample positions.  How, you ask?  Remember the "Sample Rate" you recorded down in notepad?  Simply multiply the times in seconds by it, and you get your sample positions.  Keep the decimal places of your converted answer.  One wrong digit, and you're loop won't work properly!

Start of Loop: 11.870332 * 44100 = 523481.6412
End of Loop: 46.780623 * 44100 = 2063025.4743
Length of Loop: 34.910291 * 44100 = 1539543.8331

Since we don't need the end of loop value, we can toss it away.  The only two sample positions we need are the start of loop, and the length of loop.  Record these into Notepad.

Step 4: Exporting Your (Smaller) Ogg

Congradulations!  You know what values to use for your looping comments!  Now you need to export your Ogg to be only the size it needs to be.  Why?  Some people have issues with material after the loop which causes the loop to malfunctions.  Also, it reduces your Ogg by 30-50%!

Back in Audacity, make your loop selection cover the beginning of the song.  What good does a looping song do without a beginning?
Image

Now just go to the File Menu and select "Export Selection As Ogg Vorbis...".  Save it under a different name or folder, just incase you somehow messed up your loop.

Step 5: Adding The Loop

Now it finally comes time to add the looping comments to your Ogg!  Right click the Ogg you edited and open it with WinVorbis.
Image

Click on the "Other Tags" tab then click on the "Add" button.
Image

A dialog will pop up with two text fields: "Name" and "Value".  It is here, that we'll add our comments.

The two comments that we will add are: LOOPSTART, and LOOPLENGTH.  Enter the name of one of the comments in the "Name" box, and the corresponding value in the "Value" box.  If you look back to your Notepad notes, you'll see that LOOPSTART should be 523481.6412, and LOOPLENGTH should be 1539543.8331.
Image Image
Once you've entered in both values (One at a time!), hit CTRL+S to save.  Exit WinVorbis.

Step 6: Profit

Congradulations, you now have an Ogg Vorbis file that loops when played in RPG Maker VX!  Please note that Ogg files will not loop if played as an ME, so play them as BGMs!



I hope you have enjoyed this tutorial, and have learned something about looping Oggs!

_________________
Squeak!


Top Top
   Profile  
 

Ciel-chan
  Sun May 04, 2008 5:00 am
User avatar
Member

Hmm .. this is nice. I didn't know you can make an OGG loop like that. I used Goldwave (Oh well, different apps) but I was wondering how I could patch up the odd intro on the loop. Thanks for the tutorial! :)

_________________
http://img525.imageshack.us/img525/5673 ... urefo7.jpg[/img]


Top Top
   Profile  
 

Skyla Doragono
  Sun May 04, 2008 5:49 am
Pursuing my True Self
User avatar
Retired Staff


Location: Ohio
Excellent work, Yeyinde.  Maybe next time I won't need to pester you for help.  ;P


Top Top
   Profile  
 

Ciel-chan
  Sun May 04, 2008 3:13 pm
User avatar
Member

Hey, just to clear it up, if I have my quality as 22050 (Saving space) instead of 44100, I multiply by 22050 right? I haven't tried this method yet, but I'd like to make sure first.

_________________
http://img525.imageshack.us/img525/5673 ... urefo7.jpg[/img]


Top Top
   Profile  
 

Yeyinde
  Sun May 04, 2008 5:57 pm
Rubber Shark
User avatar
Sponsor


Location: Beautiful British Columbia
Yes, you multiply by your sample rate.

_________________
Squeak!


Top Top
   Profile  
 

Ciel-chan
  Wed May 07, 2008 3:10 am
User avatar
Member

Eh, this really works. :) Saves alot of time and space too. Thanks!
Is it possible to "add" an ending when possible or so? As in when finished with a battle, the song goes to the end of the loop?

_________________
http://img525.imageshack.us/img525/5673 ... urefo7.jpg[/img]


Top Top
   Profile  
 

Cruelty
  Wed May 07, 2008 3:17 pm
User avatar
Sponsor


Location: cleveland, ohio, USA
this is so awesome. in the unlikely event that i decide to pursue another project, this shit is bookmarked.

_________________
Modernism, and urbanization are the steam-press of spiritual retardation onto the human ego.


Top Top
   Profile  
 

Vorpal 86
  Wed May 14, 2008 3:06 am
User avatar
Member

Seems nice' a tut. This is something I've done for a while but I use GoldWave. You must make sure that the loop isn't too noticeable and annoying. It can get that way if your ogg song is too short.

So, any idea on how to create an ogg that starts at the beginning which includes and intro, and then looping at the loop section, and play for a certain amount of loops, or time, and then start playing the ending to finish the song? Very useful for game ending or intro mucis that will stop on it's own.

Perhaps you can do this with MiDi files? Also, not sure if anyone knows this but OGG bgm's already lop in VX, and also XP. Unless this tutorial is explaining mostly on how to get a smaller filesize, good quality and making it sound like a good loop.

_________________
Never let your spirits die. If you do, they'll be dead!

Official Resource Creation forums Now supporting RMVX and Game Maker
http://vorpal86.snesorama.us/forum/index.php


Top Top
   Profile  
 

Yeyinde
  Fri May 16, 2008 2:23 am
Rubber Shark
User avatar
Sponsor


Location: Beautiful British Columbia
Vorpal 86 wrote:
Seems nice' a tut. This is something I've done for a while but I use GoldWave. You must make sure that the loop isn't too noticeable and annoying. It can get that way if your ogg song is too short.


a

Vorpal 86 wrote:
So, any idea on how to create an ogg that starts at the beginning which includes and intro, and then looping at the loop section, and play for a certain amount of loops, or time, and then start playing the ending to finish the song? Very useful for game ending or intro mucis that will stop on it's own.


That is impossible without rewriting RGSS2's Audio module.

Vorpal 86 wrote:
Perhaps you can do this with MiDi files? Also, not sure if anyone knows this but OGG bgm's already lop in VX, and also XP. Unless this tutorial is explaining mostly on how to get a smaller filesize, good quality and making it sound like a good loop.


Yes, you can have a defined loop point in MIDI files: Event b0f6 value 111.  Also, OGG BGMs do NOT loop by default in VX, and especially not in XP.  XP can't even handle OGGs too well.  Finally, this tutorial is HOW to make a DEFINED loop point in an OGG, not how to make smaller filesizes and etc.  That just happens to be a side-effect of the looping process.  Perhaps a picture will explain loop points better?

SONG: [---------------|-----------------------------------------]
      ^               ^                                         ^
    START         LOOP POINT                                   END
Start playing the song from START.  When END is reached, return to LOOP POINT, repeat.  If there is no LOOP POINT defined, return to START.

_________________
Squeak!


Top Top
   Profile  
 

Vorpal 86
  Fri May 16, 2008 7:15 pm
User avatar
Member

Yeyinde wrote:
That is impossible without rewriting RGSS2's Audio module.


I wouldn't even think of that. :)

Yeyinde wrote:
Yes, you can have a defined loop point in MIDI files: Event b0f6 value 111...


Where is event b0f6 value 111 locatd in midi files? I assume you have to alter this in the actual midi file, and not RMxxx? I'm not too familiar with MiDi, but a lot of others probably because most midi files don't sound very good since they sound different on different machines. I like OGG because they are compact and easy to save into for me. Nevertheless, RM XP and VX composers have done well to make the rtp musc sound pretty good.

Yeyinde wrote:
Also, OGG BGMs do NOT loop by default in VX, and especially not in XP...


I tested an OGG in VX as a BGM before I posted, and it looped pretty well to me. You must be talking about how they were not DESIGNED (composed..) to loop? Unless telling vx/xp to loop them, they won't, I agree. Considering the only OGG's that come default with XP and VX were sound effects and bg sounds, and no BGM's,they won't loop by default, no. This is also the case with XP. My ogg file looped fine in it as well.

If you were to load in one of the OGG bg sounds as a BGM, then, they would loop. As you said, BGM's will loop, even by default, but they need to be set in the BGM folder. You don't even have to set the OGG Tag. I didn't in my OGG file and it looped fine.

This is good info, no? :)

_________________
Never let your spirits die. If you do, they'll be dead!

Official Resource Creation forums Now supporting RMVX and Game Maker
http://vorpal86.snesorama.us/forum/index.php


Top Top
   Profile  
 

Mikepjr
  Fri Jan 09, 2009 3:51 pm
Guy who knows less, than he thought he knew.
User avatar
Member


Location: North Carolina USA
Okay, can you please repost all the pics for this tutorial?
Im totaly lost without the pics to help explain..
Also, can i repost this tutorial on another forum?


Top Top
   Profile  
 

negiman4
  Sat Mar 26, 2011 3:01 am
Member

sorry to say this on SUCH a dead topic but this didn't work out for me T_T. Followed directions to the letter. Probably just cuz I'm dumb when it comes to actually editing files ^^;

_________________
THIS IS SPARTAAAAA!!!!!!!

Image

Dell Vostro 3500 Laptop
Core i5 DUO @ 2.67 GHz (3.33 GHz Turbo)
HDD: 283 GB
4 GB RAM
NVidia GeForce 310 w/ 2 GB vRAM
OS: Windows 7 Professional x64


Top Top
   Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


Who is online

Users browsing this forum: No users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Hosted By: