Saturday, November 27, 2010

Your Japanese Name for iOS, part 4

Today I probably won't have much time to work on this, but let's see if I can suitable fail / success / complete sounds on iStockPhoto.

...

Finding sounds is a lot of work!

Character drawn correctly -sound


As background, one of the "koto loop" melodies from iStockPhoto. Update: this one

Maybe this one mixed in after all the characters have been drawn correctly and the final result is displayed in gold.

But what about failure sound? Or "finger touched down" sound. Actually what I'd really want for that is for wind chimes to be played while the finger is progressing on the character. But when the finger is lifted up, the sound shouldn't abruptly stop. Instead it should fade out, maybe even echo a bit. This seems to call for some sound library. What was that famous one? Oh yeah, fmod. They were porting like crazy, let's see if they have an iOS version... Seems they do. But it's $500 per product, out of my budget. I'd rather use a few days to make a simple mixer, I think there was some source code in some Apple example. Yes.

Whoa, feel a bit overwhelmed. Let's see what I really want to do here.

Channel 1: Looping soundtrack, always full volume.
Channel 2: Wind chimes, starts full, doesn't loop, fades out at any point.
Channel 3: Buddha bell / gong / wrong. Never overlap, full volume, no loop.

If I had the API of my dreams, what would it look like? First it would start like
SoundSystem *sounds = [SoundSystem soundSystemWithLoop:@"koto.mp3"]; // start with koto ambience on channel 0
[sounds play:@"chimes.mp3" channel:1 looping:YES volume:0.0];

Then when the user puts their finger down, I'd like to
[sounds fadeTo:1.0 channel:1 delay:0.05];

And when they release their finger
[sounds fadeTo:0 channel:1 delay:0.3];

For the other sounds I could
[sounds play:@"buddha_bell.png" channel:2];

Basically just play looping or not, caching known sounds and controlling the volume of each channel.