BROO's Recent Forum Activity

  • AFAIR applying effects isn't possible in runtime. I'm afraid we should be careful not to put too much conditions/expressions, because even now Sprite's condition list is large. If something can be handled with single PV - why not work this way?

  • That's another flame attack ^^.

    <img src="http://i177.photobucket.com/albums/w226/emorock09/rage.jpg">

  • I don't have that much theorethical knowledge, but I know that negative frequencies don't have representation in real world, althought they're part of it. If you think about electrical stuff alternating current: it has its Real and Imaginary part. Only te Real part is useful, but they both are vital to describe the current.

    Similar situation is with FFT. Normally FFT algorithms does output array of Complex Numbers (this conversion I shown in 3 posts above is shortcut: Real->Complex conversion and Complex.Abs() conversion put together). You can do IFFT (Inverted FFT) only when giving output array of Complex Numbers containing both positive and negative frequencies.

    To put it simply: negative frequencies aren't useful for you, but when trying to get FFT^-1 function, you need them.

    [quote:30aw7lup]I just began to wonder if it is possible to combine the frequencies afterwards and input them back to XAudio2 . I was thinking some kind of controllable equalizer...

    IFFT would theorethically do that (available in FFTW as well). Anyway I haven't seen anybody implementing such functionality.

    Edit:

    ...Well actually Winamp's Eqaualizer does something like this ^^.

  • Aiosf Raamao Hungjblun!

    Sorry for Nuboadi ^^.

  • Method for making FFT

    FFTW has functions to which you have to pass:

    input buffer

    output buffer

    number of samples

    (and some other flags for optimalization and stuff).

    If you happen to retrieve pointer to XAudio2 buffer, you'll have to create your Output memory buffer. FFTW operation will populate the Output buffer with calculated Fourier Transformation.

    There are some ways (AFAIR in FFTW it's called kinds) of getting output data buffer. I'll explain it on example later in this post.

    Accessible frequencies depend on amount of probes you pass in Input Buffer. If you pass 8192-element Input Buffer, you'll get frequencies from -4095Hz to 4096 Hz. Then in order to get 20kHz spectrum you'd probably want to pass 40000 elements buffer. Since processing 2^N sized arrays is better, I recommend 65536 elements sized arrays to get -32767Hz to 32768Hz.

    Don't worry about working with transfering data, retrieving and stuff, it'll be done within 10msec for sure.

    And how to know which table indexes are the positive and negative frequencies? Well it depends on KIND of getting output data.

    Sample of usage:

    Let's say you want frequencies 1..8Hz. You have then to pass Input Buffer array of 16 float numbers. Then, you have to prepare memory for Output Buffer: it'll be array of 16 float numbers. FFTW works like this:

    retrieve/malloc Input/Output buffers

    select PLAN you want to do (as for us it'll be fftw_plan fftw_plan_r2r_1d(int n, double *in, double *out, fftw_r2r_kind kind, unsigned flags);

    execute PLAN

    free memory

    When you execute plan, your Output array will be probably populated with such points ( x(n) = amplitude at n Hz freq):

    x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7), x(8), x(-7), x(-6), x(-5), x(-4), x(-3), x(-2), x(-1). So get rid if last 7 elements and you get what you're interested in.

    If XAudio2 would have "get pointer to buffer" expression, then everything should be all right. And if you're going to make 0..20kHz in few bars like in Winamp, you'll have to sum/average parts of array.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Fourier transformation is needed, that's for sure. How to achieve it and make it fast at once? "Normal" Fourier Transformation algorithm uses O^2, and Fast Fourier Transformation uses n*log2(n). I can recommend getting FFTW:

    one of the fastest FFT algorithms - see benchmark results (and one sample to let you know which one to check)

    deals with non 2^N arrays of probes (but takes more time then)

    open source, free for noncommercial use

    AFAIR written in ANSI C

    support for optimalization of FFT-ing signal (but I don't think this would be useful in non-industrial use)

    AFAIR applications like Winamp uses FFTW to make spectrum analysis.

    The only problem is how to access XAudio2's pointer to actually played buffer. And I don't know how many samples are taken to analysis every "frame" (maybe 1k?). Anyways, FFTW deals with 2^19 samples in about 100ms.

  • I've the same problem. And copying sprites between applications doesn't copy everything (frames' pictures).

  • Writing "4-1" provides information about "why this is 3?". You can say it's a calculation that documents code. When performance isn't vital in algorithms, I'd rather try to make code easier to understand.

    It'd be the best if you created some sprite called "Conf" and put PV like "ElementsCount" and then done events like:

    -> "UP" pressed: set value to (value + Conf('ElementsCount') - 1) % Conf('ElementsCount')
    -> "DOWN" presset: set value to (value + 1) % Conf('ElementsCount')[/code:1cjhwone]
    This'd be more flexible and useful for next appliactions.
  • (Don't have Cons now, can't see CAP)

    When making menu (for example with 4 options: 0, 1, 2, 3), you'd probably have something like this:

    -> "UP" pressed: set value to (value - 1) % 4
    -> "DOWN" presset: set value to (value + 1) % 4[/code:emvn93xm]
    Since I didn't know how program deals with modulo of negative number, I did tend to do it this way:
    [code:emvn93xm]-> "UP" pressed: set value to (value + 4 - 1) % 4
    -> "DOWN" presset: set value to (value + 1) % 4[/code:emvn93xm]
    Maybe I'm oversensitive on this stuff, but I don't want have surprising results ^^.
  • You can use condition "Else" from "System" - just put this condition as event below event you want have else-d. I don't have Cons right now so can't see CAP.

    Event Key "K" pressed : set Value to (Value + 1) % 2

    -> SubEvent "Value = 1" : some actions

    -> SubEvent "Else" : action if Value NOT = 1

    Something like this should solve toggling.

  • If you used to make games with fixed framerate = 60FPS, then yes.

  • I have a couple of ideas for his scenario.

    Michael (he's the main protagonist, right?) and his girl were childhood friends.

    It appears that girl is a robot sent from future and serves Michael as a maid. They met when she saved him from bullies.

    When Michael gets emotional, he transforms into a tentacle monster

    Girl has a very sexy body, like an adult, and every alien want to have fun with her (for example playing HOMM)

    The most important part is that they met in previous lifes and promised they will be always together but they got separated because of car accident

    It should sell well. By the way what's Fallen Angle? I couldn't find out.

BROO's avatar

BROO

Member since 30 Aug, 2007

None one is following BROO yet!

Trophy Case

  • Email Verified

Progress

17/44
How to earn trophies