4 Replies Latest reply on Nov 28, 2006 5:52 AM by duckets

    extras

    ian_fooks
      hi

      hit a bit of a block in my college work regarding applying extras to director. Creating a live sound recognition package, I have downloaded an extra called the fast fourier transform from a programmer named antoine schmitt {see http://www.as-ci.net/asFFTXtra/index.html}. This allows represenation of sound to patterns. Being a bit of a novice into lingo and application of extras was wondering if anybody had any useful advice to point me the right direction.

      any help would be great!

      ian
        • 1. Re: extras
          Level 7
          Are you needing help with installing the xtra or using it once installed?
          • 2. Re: extras
            ian_fooks Level 1
            all aspects really, just getting to grips with program so anything to get me on track really!
            • 3. Re: extras
              Level 7
              Installing an xtra is a matter of placing it in the correct
              sub-directory of the folder you installed Director into. The "root"
              xtras folder is at %Director MX2004%\Configuration\Xtras\
              There are 4 different types of xtra: asset, scripting, tool and
              transition. How an xtra is used is partly dependent on what type it is.
              Tool xtras provide extensions to the authoring environment only and
              usually add an entry under the Xtras menu of Director's titlebar
              ('Convert WAV to SWA...' is an example of a tool xtra)
              Transition xtras add extra transitions to the existing set.
              Scripting xtras add methods to the core Lingo/JavaScript
              Asset xtras allow Director to display (and control) additional media
              types, like MPEG video.
              There is sometimes a little crossover between asset xtras and scripting
              xtras in that an asset xtra often contains methods specific to the media
              type and sometimes more "global" methods.

              The xtra you are wanting to use is a scripting xtra. Once you drop it
              into the correct folder and restart Director its methods should be
              available. If you open a script window (Ctrl + Shift + U) you'll see a
              menu bar with the same icon as an xtra (with a script overlay) - if you
              pull down this menu you can see all the scripting xtras installed and
              all their methods, and if you select a method it will be added to the
              current script at the insertion point along with any required parameters.

              Hope that helps to get you started. You should read the docs (F1) about
              xtras and familiarise yourself with DOUG: < http://www.director-online.com>
              • 4. Re: extras
                duckets Level 1

                Following on from Sean's post, once installed, you can use the asFFT xtra like this:

                Create an instance of the xtra by using the 'new' function, and put it into a variable (a property, or a global). In this example, it gets put into a variable called 'fft':

                fft = xtra("asFFT").new()

                Then, you can call handlers on that instance. For example, to get the current volume of the sound input, use:

                currentVolume = fft.getVolume()

                To get a list of the current FFT values from the sound input, use:

                fftList = fft.getFFT()

                To get a list (an array) of the most recent 1024 sample values from the sound input, use:

                sampleList = fft.getSamples(1024,ampRange)

                (where 'ampRange' is the max value to scale the readings to. Eg, if you put 100 there, your values will range between -100 and 100).

                hope this helps,

                - Ben