Kaizo's Web site

Resonite Custom Audio Looper

Page contents

About this

Most game engines allow you to set “loop points” on audio clips. This lets you have a piece of music where an intro section seamlessly leads into a looping main melody. However, Resonite doesn't have this feature, so I had to figure out a workaround.

Since it took a nonzero amount of effort, I decided to publish this system for anyone to use, under the usual CC BY-NC-SA license.

Downloads

Setting it up

First, you'll need to create two separate audio files. One will contain the song's opening segment, plus a few extra seconds, and the other will just be the looping segment on its own. Make a note of exactly where the loop starts, down to the millisecond.

Tip: I recommend using Audacity for this. Once you've found the looping region, you can just select it, then go to File → Export Audio..., and choose Export Range: Current Selection. (Make sure to export both clips with the same encoding settings!)

Next, import those clips into Resonite, and spawn in the Custom Audio Looper object. Open it in the inspector, and find the slot named Intro playback. Drop the intro clip into its AudioClipPlayer's Clip field. Then do the same for Loop playback. Finally, go to the var LoopStart slot, and set its value to the loop point you found earlier.

Test your settings using the demo UI. If it works, great! You can now grab the Kaizo's Custom Audio Looper slot from the inspector and drop it into whatever you're making.

Controlling playback

The Custom Audio Looper is controlled through dynamic impulses:

Additionally, these slots contain useful fields (“var” denotes a writable value, “out” denotes a read-only value):

To pause, store the current value of Position somewhere before calling Stop, then use PlayFromPosition to resume.

Tutorial: Creating loop clips in Audacity

Caution: Section currently under construction.

I'll write this later, probably. For now, here are some pointers: