6 Replies Latest reply on Mar 31, 2017 9:15 AM by Dave LaRonde

    Adding a sound for every Particular 'birth'


      I am doing a video for a midwife conference on overpopulation, and hilariously enough, I need to add a POP sound every time a baby appears.

      I'm using Particular to generate mass amounts of babies on the screen, and adding a pop for each one is a no go.


      I can't find any information either saying it is or isn't possible. Anyone have any experience with this?

      (If not, any suggestions on how best to do it?)


      Thanks in advance

        • 1. Re: Adding a sound for every Particular 'birth'
          A.I.1 Level 3

          My guess for where to look would be to check in the scripts section to see if you can use scripts to do that.


          To do it outside After Effects, I would think it could be done in any programming language that can read and write data files (eg. for simplicity, mono, reading and writing with the word length the audio file has for each numerical value). Have one file for the short sound effect, have another file for writing to (the duration of the audio file you are writing to should be approx the same as your composition), and make the file you are writing to have the same sample rate as the other file. For simplicity have the audio files as RAW audio, or use WAV - ie. signed 16 bit PCM, which is RAW with a particular size header. Any time there's no sound, write '0' (ie. zero numerical value) to the output file, every time there's a particle birth (however many times per second you have it set up), copy the values from the short sound effect to the output file. Really, to allow for multiple sound effects in the output file simultaneously, you can add the values from the short sound effect to the output file instead of just copying them (so if there are 2 sound effects being played simultaneously, with the audio sample value from one being "5" and the other being "100", at that point in the output file, you'd write "105" as the audio sample value. Make sure the total doesn't add up to a value that is too high (or too low, since audio sample values normally are negative to positive, with 0 in the middle) - if it does you could just set it to the maximum (or min for negative values) value allowed. For efficiency, you're probably best storing some or all of the file(s)/audio samples in memory (having a buffer to speed it up). After you've finished writing, load the output file into AE or a video editor and use for the audio (or if you've saved it as RAW, convert it to WAV first).


          A very simplified version of the above:

          1) If the short sound effect file (say it's a RAW file) contains just the following audio sample values "1, 2, 3" (ie. 3 numeric values).

          2) The output file could contain (depending on the particle birth rate and required audio duration) the following audio sample values "1, 2, 3, 0, 0, 1, 2, 3, 0, 0" etc. (where the zeroes indicate points where it will be silent).

          1 person found this helpful
          • 2. Re: Adding a sound for every Particular 'birth'
            Mylenium Most Valuable Participant

            Aside from the fact that it's impossible to access the internal particle data, the whole affair probably doesn't make much sense to begin with.Such stuff is done in an audio sequencing program and even then you wouldn't add a sound to every event. When they overlap or there's too many, it all ends up being an unbearable noise.



            1 person found this helpful
            • 3. Re: Adding a sound for every Particular 'birth'
              A.I.1 Level 3

              You could always limit the number of simultaneous sounds so it doesn't get too loud/unbearable (you could have it a max of 1 sound at a time). One issue is, if it's for a particular particle birth rate, eg. 2 particles per second, the sounds would keep repeating with the same silent gap between each. Basically it probably wouldn't sound as interesting (may sound too repetitive?) as it would if the time between each new particle (and their sound) varied a bit (though I'm guessing you can't do that with the particles themselves, since they would have just 1 birth rate, of x times per second - edit: or I suppose you could keyframe the birth rate to vary it a bit over time. Though that would make the audio side more complex.).


              Another option would be to have a totally separate program (that could be written) to do the drawing of the particles as well as creating the audio output (using the short sound effect file(s)). That way you could easily add short (eg. random) delays to the particles etc. (and their sounds) to make the audio of it sound less repetitive. Also, having 2 or 3 sound effect files instead of just 1, and randomly using 1 of those each time, could also make it sound less repetitive.

              1 person found this helpful
              • 4. Re: Adding a sound for every Particular 'birth'
                DigitalVagrancy Level 1

                Thanks so much everyone, great answers all around - there are some clever people on this forum, gee...

                To summarise: It isn't easy or in-built, but with some braininess and time application it is possible.


                Cheers, will have to look further into it

                • 5. Re: Adding a sound for every Particular 'birth'
                  Gutter-Fish Level 4

                  Unless you're talking about 1000s of babies it seems like overly complicate approach.  Create one baby popping on screen with audio & Pre comp it.  Then write  asimple expression to randomize the position (maybe scale too) & duplicate the comp 100 times or whatever.  Finally download a free script called Rift and use that to randomize the start points of the 100 or however many comps.

                  One image, one sound, one super simple expression.  Sometimes trying to use a shortcut like particular turns out to be not such a shortcut at all.

                  The time you've spent trying to figure how to do it you could have done it 20 times or more.

                  • 6. Re: Adding a sound for every Particular 'birth'
                    Dave LaRonde Level 6

                    I have to agree with Mylenium: when you consider that 10 particles created PER FRAME is a really low number for a particle effect, your proposal could get very annoying to the listener very quickly.


                    I think you'd be much better off to add the sound effect in a video editor where it's a lot easier to control the rate at which they happen.  When you're talking about sound effects on a whole lot of changes to the image, they don't always have to sync up.  You can fake it.  No one will know. 


                    Or you can do it the way you want, and just end up doing it by hand anyway.