nicholaschan.net :D

27May/101

The Facility Answers:

Office of Mr. Shnell: 414668
____ as 3.141592 : easy
High Security Laboratory : 753421
Lab Room ID7 : 040168
Lab Room ID8 : 040168
Medium Security Cells Six-Digit ComboCode required : 336581
It is in the middle of nowhere : h
It has no beginning, end, or middle. Delicious. : bagel
It has holes but still holds water : sponge
It controls your computer and runs from cats : mouse
Low Security Cells : 568385
I know a word of letters three. Add two, and fewer there will be : few
J, F, M, A, M, J, J, A, S, O, N, _ : D (for december)
"Secure Area, please enter static keycode : 985632
Primary Sewer Lock : 975311
Secondary Sewer Lock : 452113
It is so fragile even saying its name can break it : silence
I hope you kept looking. : buzz
An Elephant and a shrimp can both be this : jumbo
It dries as it gets wetter : towel

24Jun/090

project eyght

My game codenamed: "project eyght" is so far going along nicely. The big problem at the moment is trying to use the least amount of windows exclusive libraries as possible, rather, trying to use the most cross platform libraries available. The iPhone is still a relatively new platform, so there is still work going on at the moment with porting libraries (such as the SDL). For now, I have Opengl + GLUT + FMOD, only GLUT isn't compatible with the iPhone. The reason why I haven't used SDL is that I've been taught and have more experience with GLUT so I know how to get things up and running much quicker. I've also couldn't get a simple SDL Opengl window working, which makes me a lame coder. Anyways even if I got SDL working on my PC, I'll still have to rewrite the touch screen controls for the iPhone, so it doesn't matter much to me at the moment.

Since my game will have some sort of "synaesthesia", I got an audio beat detection working. Well it's not really beat detection, it's really just rhythm function. I took an audio track and imported to ableton live for sample correcting. There I took the amount of samples a track has and divided it to beats. For example, I have a track by Josh Gabriel called "Azora" which has about 18668160 samples with 896 beats. Dividing those two numbers give 20835 which means every beat has that many samples. Now if you want to figure out how long is each beat in seconds, assuming you have a .wav with a sample rate of 44.1khz, all you need to do is divide 20835 / 44100 and you'll get around 0.4724 seconds.

As I mentioned, I'm currently using FMOD audio library. To get a sort of a rhythm action in the game, all you need to do is create FMOD::Channel *channel, link it to a sound object, and use the channel->getPosition with timeunits FMOD_TIMEUNIT_PCM to get the current sample position of the audio track(remember to -1 since the sound starts at sample 0). Now all you need to do is check the sample position against a multiple of the beat length (multiple meaning as to which beat you are on. Here's a sample of my code:

FMOD::Channel *channel;
system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
//begin some sort of game loop

unsigned int pos = 0;
channel->getPosition(&pos, FMOD_TIMEUNIT_PCM);
if(pos >= (unsigned)20835*beatCount-1)
{
//do beat stuff here...
}

Next, I'm going to try and get some visual stuff up.

Tagged as: , , , No Comments

My Sites

Nick’s Tweets

Posts