A way to implement sound

  • SopaXorzTaker
    21st Dec 2014 Member 0 Permalink

    Hi, developers!

     

    I have an idea how to make sound in game.

     

    For every frame, we have an array of samples.

    If a particle appears, add, say, 4 samples of white noise.

    If it disappears, then add 4 samples of sine wave.

     

    If the sample array overflows, then new value = old XOR new

     

    When the frame gets rendered, samples are played.

     

    Possible trouble: Syncing with framerate.

  • NF
    21st Dec 2014 Member 0 Permalink

    Theres tons of threads that suggested sound. And all of them have been rejected. I highly, doubt this one will be accepted. Sorry. Also someone made a NOTE element.

    Edited once by NUCLEAR_FOX. Last: 21st Dec 2014
  • SopaXorzTaker
    22nd Dec 2014 Member 0 Permalink

    @NUCLEAR_FOX (View Post)

    Sorry, but this is an idea on how to implement sound, not a suggestion to just 'add it'.

    Edited 2 times by SopaXorzTaker. Last: 22nd Dec 2014
  • NF
    22nd Dec 2014 Member 0 Permalink

    @SopaXorzTaker (View Post)

     I misunderstood you!

  • jenn4
    22nd Dec 2014 Member 0 Permalink
    @SopaXorzTaker (View Post)
    But how would you play a sound during a frame? You would at first need to plot out the next frame, then start a new thread for playing the sound, and then draw the frame. Have you seen hoe out of sync newtonian gravity is? That is caused by it being threaded, and hence the sound would also probably not be in sync very well, with the rest of the simulation.
  • greymatter
    23rd Dec 2014 Member 0 Permalink
    Also, everything having the same sound is boring. Everything having different sounds is too complicated.
  • Klus
    26th Dec 2014 Member 0 Permalink

    Why does TPT need sound? I think it's enough if you press 1 or 2  and look at the shockwaves. But what would be the uses of sound? 

  • zBuilder
    26th Dec 2014 Member 0 Permalink

    Lagnadium41:

    Why does TPT need sound? I think it's enough if you press 1 or 2  and look at the shockwaves. But what would be the uses of sound? 

     

    asside, that sounds like it would be an interesting source of noise, when I think about using vmap for that. but I guess,the nature of the sim, eventually anything that could make noise would start getting annoying quickly(both generated and repeated sounds)

  • jenn4
    27th Dec 2014 Member 0 Permalink
    @zBuilder (View Post)
    And TPT air does not really form waves, which sound actually is. In TPT air just flows constantly, and does not pulse, as it does in real life.
  • zBuilder
    27th Dec 2014 Member 0 Permalink

    jenn4:

    @zBuilder (View Post)
    And TPT air does not really form waves, which sound actually is. In TPT air just flows constantly, and does not pulse, as it does in real life.

     

    I know,AFAIK it's a 2d set of values. obviously, if you tried to calculate it based on the way it is on the screen you'd never hear it unless there's some sort of microphone element,since the "air preasure" does not move in "your" direction.