UniversalBeat

From Whirled

Jump to: navigation, search
UniversalBeat
Hear the music

Toy Discussion & Bug Reporting

Other Info

Current version: 20080217
Test version available here
Development Team: Pacifist

The Universal Beat is a simple API for creating instruments that all play to the same beat. The looping music they create sounds the same to everyone listening and everyone can change the music together.

Play with some instruments here: Pacifist's Room

Also, just to be clear. I have no problem with anyone downloading the source, making music balls or any other kind of instrument. I also encourage putting anything you make in the catalogue so we can all enjoy them.

Contents

Creating Your Own Instrument

Making your own musical ball is an easy process.

There's a fair amount of setup to do but I'll give you step by step instructions. In no time you'll have your own shiney, bouncy, musical ball to show off to your friends.

Whirled SDK

You're going to have to compile your new creation so you will need the Whirled SDK and a programming environment.

Fortunately Three Rings has provided good instructions for setting that up.

Setting_up_your_programming_environment

Setting up the SDK will let you do all kinds of cool things in Whirled!

Universal Beat Source Code

Next you need the Universal Beat source code. This will let you build your own musical ball.

you can download it here: Universal Beat Source

Included is the source for the first four Musical Balls released into the catalogue. If you finish the turorial you can compile them and have them for free!

Once you download the source unzip it into the whirled/ directory you created when you set up the SDK.

You should have the following structure: whirled/pacifist/universalBeat

(C:/development/whirled/pacifist/universalBeat if you put it in the same place as I did)

A Sound & An Image

Your ball needs two things to make it yours. A sound and an image.

The sound has to be .mp3 and should be a second or less long. The image has to be a .png and should be around 50x50 pixels.

(you can use .wav files if you have the FAT. see source for examples) (you can use any image type you want if you're willing to make a small change to the tutorial source file)

When you have your sound and image navigate to your whirled/pacifist/ directory.

Replace yourBallGraphic.png with the .png you want to use.

Replace yourBallSound.mp3 with the .mp3 you want to use.

You might get this error when you try to build your ball: unsupported sampling rate (48000hz) If you do you will have to reduce the sampling rate of your sound (flash cannot play sound with this sampling rate). You can do this with Audacity. Load your sound in Audacity and then select Edit->Preferences->Quality and change the Default Sample Rate to 22050Hz. Then export your sound as an mp3.

Optional: Setup Your Sound

This step is not strictly required. But it is highly recomended. In order for your sound to play properly you have to add .05 seconds of silence to the beginning. If you don't do this your sound will be choppy and not sound as good.

It's a pretty easy process. Download Audacity, the open source sound editor:

Audacity

And use it to open your .mp3.

Then from the top menu select 'Generate' then select 'Silence'. This will bring up a window titled 'Silence Generator'. Use the dropdown on the far right to select 'hh:mm:ss + milliseconds'.

Set the readout to '00h00m00.050s' and hit ok.

This should add 1/2 second to the beginning of your .mp3 file.

Next select 'File'->'Export' and save over yourBallSound.mp3. When you do this you will be prompted to download an mp3 encoder. Follow the instructions and save your sound.

Now your sound will play flawlessly in the Whirled.

Compile

Last step! Navigate back to whirled/pacifist/. Double click on the 'build.bat' file. This will compile your new ball with your sound and image!

A window should pop up and whirr away for 3 or 4 seconds before announcing 'BUILD SUCCESSFULL'.

If it doesn't then something has gone wrong. Likely in the setup of the Whirled SDK. Try to figure out what's wrong yourself. But if you can't feel free to drop me a line: Pacifist.

If it does work; then yay! yourBall.swf now contains your image and sound. You can upload it to your room and dance the night away!

Advanced

Feel free to explore the source. Building a ball with a .gif or .jpg image should be well within your reach.

If you're a coder or a budding coder then build beyond the limits of the ball! The API handles all the beat and server synching.

Source

Universal Beat Source

Feel free to do anything you like with it!

Personal tools