diff org/ear.org @ 20:e8ae40c9848c

fixed 1,000,000 spelling errors
author Robert McIntyre <rlm@mit.edu>
date Thu, 03 Nov 2011 15:02:18 -0700
parents 22ac5a0367cd
children 0ee04505a37f
line wrap: on
line diff
     1.1 --- a/org/ear.org	Thu Nov 03 14:54:45 2011 -0700
     1.2 +++ b/org/ear.org	Thu Nov 03 15:02:18 2011 -0700
     1.3 @@ -7,14 +7,11 @@
     1.4  #+INCLUDE: ../../aurellem/org/level-0.org
     1.5  #+BABEL: :exports both :noweb yes :cache no :mkdirp yes
     1.6  
     1.7 -
     1.8 -
     1.9 -
    1.10  * Hearing
    1.11  
    1.12 -I want to be able to place ears in a similiar manner to how I place
    1.13 +I want to be able to place ears in a similar manner to how I place
    1.14  the eyes.  I want to be able to place ears in a unique spatial
    1.15 -position, and recieve as output at every tick the FFT of whatever
    1.16 +position, and receive as output at every tick the F.F.T. of whatever
    1.17  signals are happening at that point.
    1.18  
    1.19  Hearing is one of the more difficult senses to simulate, because there
    1.20 @@ -23,13 +20,13 @@
    1.21  
    1.22  jMonkeyEngine's sound system works as follows:
    1.23  
    1.24 - - jMonkeyEngine uese the =AppSettings= for the particular application
    1.25 + - jMonkeyEngine uses the =AppSettings= for the particular application
    1.26     to determine what sort of =AudioRenderer= should be used.
    1.27   - although some support is provided for multiple AudioRendering
    1.28     backends, jMonkeyEngine at the time of this writing will either
    1.29 -   pick no AudioRender at all, or the =LwjglAudioRenderer=
    1.30 +   pick no AudioRenderer at all, or the =LwjglAudioRenderer=
    1.31   - jMonkeyEngine tries to figure out what sort of system you're
    1.32 -   running and extracts the appropiate native libraries.
    1.33 +   running and extracts the appropriate native libraries.
    1.34   - the =LwjglAudioRenderer= uses the [[http://lwjgl.org/][=LWJGL=]] (LightWeight Java Game
    1.35     Library) bindings to interface with a C library called [[http://kcat.strangesoft.net/openal.html][=OpenAL=]]
    1.36   - =OpenAL= calculates the 3D sound localization and feeds a stream of
    1.37 @@ -37,7 +34,7 @@
    1.38     how to communicate.
    1.39  
    1.40  A consequence of this is that there's no way to access the actual
    1.41 -sound data produced by =OpenAL=.  Even worse, =OpanAL= only supports
    1.42 +sound data produced by =OpenAL=.  Even worse, =OpenAL= only supports
    1.43  one /listener/, which normally isn't a problem for games, but becomes
    1.44  a problem when trying to make multiple AI creatures that can each hear
    1.45  the world from a different perspective.
    1.46 @@ -50,21 +47,21 @@
    1.47  ** =OpenAL= Devices
    1.48     
    1.49  =OpenAL= goes to great lengths to support many different systems, all
    1.50 -with different sound capabilities and interfaces.  It acomplishes this
    1.51 +with different sound capabilities and interfaces.  It accomplishes this
    1.52  difficult task by providing code for many different sound backends in
    1.53  pseudo-objects called /Devices/.  There's a device for the Linux Open
    1.54 -Sound System and the Advanced Linxu Sound Architechture, there's one
    1.55 +Sound System and the Advanced Linux Sound Architecture, there's one
    1.56  for Direct Sound on Windows, there's even one for Solaris. =OpenAL=
    1.57  solves the problem of platform independence by providing all these
    1.58  Devices.
    1.59  
    1.60  Wrapper libraries such as LWJGL are free to examine the system on
    1.61 -which they are running and then select an appropiate device for that
    1.62 +which they are running and then select an appropriate device for that
    1.63  system. 
    1.64  
    1.65  There are also a few "special" devices that don't interface with any
    1.66  particular system.  These include the Null Device, which doesn't do
    1.67 -anything, and the Wave Device, which writes whatever sound it recieves
    1.68 +anything, and the Wave Device, which writes whatever sound it receives
    1.69  to a file, if everything has been set up correctly when configuring
    1.70  =OpenAL=.
    1.71  
    1.72 @@ -131,7 +128,7 @@
    1.73  #define UNUSED(x)  (void)(x)
    1.74  #+end_src
    1.75  
    1.76 -The main idea behing the Send device is to take advantage of the fact
    1.77 +The main idea behind the Send device is to take advantage of the fact
    1.78  that LWJGL only manages one /context/ when using OpenAL.  A /context/
    1.79  is like a container that holds samples and keeps track of where the
    1.80  listener is.  In order to support multiple listeners, the Send device
    1.81 @@ -146,7 +143,7 @@
    1.82   - Set the LWJGL context as "master" in the =init()= method.
    1.83   - Create any number of additional contexts via =addContext()=
    1.84   - At every call to =renderData()= sync the master context with the
    1.85 -   slave contexts vit =syncContexts()=
    1.86 +   slave contexts with =syncContexts()=
    1.87   - =syncContexts()= calls =syncSources()= to sync all the sources
    1.88     which are in the master context.
    1.89   - =limitContext()= and =unLimitContext()= make it possible to render
    1.90 @@ -216,11 +213,11 @@
    1.91    
    1.92  #+end_src
    1.93  
    1.94 -Setting the state of an =OpenAl= source is done with the =alSourcei=,
    1.95 +Setting the state of an =OpenAL= source is done with the =alSourcei=,
    1.96  =alSourcef=, =alSource3i=, and =alSource3f= functions.  In order to
    1.97 -complely synchronize two sources, it is necessary to use all of
    1.98 +completely synchronize two sources, it is necessary to use all of
    1.99  them. These macros help to condense the otherwise repetitive
   1.100 -synchronization code involving these simillar low-level =OpenAL= functions.
   1.101 +synchronization code involving these similar low-level =OpenAL= functions.
   1.102  
   1.103  ** Source Synchronization
   1.104  #+begin_src C
   1.105 @@ -288,7 +285,7 @@
   1.106    alcMakeContextCurrent(current);
   1.107  }
   1.108  #+end_src
   1.109 -This function is long because it has to exaustively go through all the
   1.110 +This function is long because it has to exhaustively go through all the
   1.111  possible state that a source can have and make sure that it is the
   1.112  same between the master and slave sources.  I'd like to take this
   1.113  moment to salute the [[http://connect.creativelabs.com/openal/Documentation/Forms/AllItems.aspx][=OpenAL= Reference Manual]], which provides a very
   1.114 @@ -313,7 +310,7 @@
   1.115      alGenSources(numMissingSources, newSources);
   1.116    }
   1.117  
   1.118 -  /* Now, slave is gauranteed to have at least as many sources
   1.119 +  /* Now, slave is guaranteed to have at least as many sources
   1.120       as master.  Sync each source from master to the corresponding
   1.121       source in slave. */
   1.122    int i;
   1.123 @@ -328,7 +325,7 @@
   1.124  
   1.125  Most of the hard work in Context Synchronization is done in
   1.126  =syncSources()=. The only thing that =syncContexts()= has to worry
   1.127 -about is automoatically creating new sources whenever a slave context
   1.128 +about is automatically creating new sources whenever a slave context
   1.129  does not have the same number of sources as the master context.
   1.130  
   1.131  ** Context Creation
   1.132 @@ -380,7 +377,7 @@
   1.133  static ALuint currentNumContext;
   1.134  
   1.135  /* By default, all contexts are rendered at once for each call to aluMixData.
   1.136 - * This function uses the internals of the ALCdecice struct to temporarly 
   1.137 + * This function uses the internals of the ALCdevice struct to temporally 
   1.138   * cause aluMixData to only render the chosen context.
   1.139   */
   1.140  static void limitContext(ALCdevice *Device, ALCcontext *ctx){
   1.141 @@ -396,10 +393,10 @@
   1.142  }
   1.143  #+end_src
   1.144  
   1.145 -=OpenAL= normally reneders all Contexts in parallel, outputting the
   1.146 +=OpenAL= normally renders all Contexts in parallel, outputting the
   1.147  whole result to the buffer.  It does this by iterating over the
   1.148  Device->Contexts array and rendering each context to the buffer in
   1.149 -turn.  By temporarly setting Device->NumContexts to 1 and adjusting
   1.150 +turn.  By temporally setting Device->NumContexts to 1 and adjusting
   1.151  the Device's context list to put the desired context-to-be-rendered
   1.152  into position 0, we can get trick =OpenAL= into rendering each slave
   1.153  context separate from all the others.
   1.154 @@ -576,12 +573,12 @@
   1.155  }
   1.156  #+end_src
   1.157  
   1.158 -*** Initilazation
   1.159 +*** Initialization
   1.160  =initDevice= is called from the Java side after LWJGL has created its
   1.161  context, and before any calls to =addListener=. It establishes the
   1.162  LWJGL context as the master context.
   1.163  
   1.164 -=getAudioFormat= is a convienence function that uses JNI to build up a
   1.165 +=getAudioFormat= is a convenience function that uses JNI to build up a
   1.166  =javax.sound.sampled.AudioFormat= object from data in the Device. This
   1.167  way, there is no ambiguity about what the bits created by =step= and
   1.168  returned by =getSamples= mean.
   1.169 @@ -640,7 +637,7 @@
   1.170  backends. It's the basis for =OpenAL='s primitive object system.
   1.171  
   1.172  #+begin_src C
   1.173 -////////////////////   Device Initilization / Management
   1.174 +////////////////////   Device Initialization / Management
   1.175  
   1.176  static const ALCchar sendDevice[] = "Multiple Audio Send";
   1.177  
   1.178 @@ -649,7 +646,7 @@
   1.179  {
   1.180    send_data *data;
   1.181    // stop any buffering for stdout, so that I can 
   1.182 -  // see the printf statements in my terminal immediatley
   1.183 +  // see the printf statements in my terminal immediately
   1.184    setbuf(stdout, NULL);
   1.185  
   1.186    if(!deviceName)
   1.187 @@ -730,14 +727,14 @@
   1.188  The Java interface to the Send Device follows naturally from the JNI
   1.189  definitions. It is included here for completeness. The only thing here
   1.190  of note is the =deviceID=. This is available from LWJGL, but to only
   1.191 -way to get it is reflection. Unfornatuently, there is no other way to
   1.192 +way to get it is reflection. Unfortunately, there is no other way to
   1.193  control the Send device than to obtain a pointer to it.
   1.194  
   1.195  #+include: "../java/src/com/aurellem/send/AudioSend.java" src java :exports code
   1.196  
   1.197  * Finally, Ears in clojure! 
   1.198  
   1.199 -Now that the infastructure is complete (modulo a few patches to
   1.200 +Now that the infrastructure is complete (modulo a few patches to
   1.201  jMonkeyEngine3 to support accessing this modified version of =OpenAL=
   1.202  that are not worth discussing), the clojure ear abstraction is rather
   1.203  simple.  Just as there were =SceneProcessors= for vision, there are
   1.204 @@ -750,7 +747,7 @@
   1.205  (ns cortex.hearing
   1.206    "Simulate the sense of hearing in jMonkeyEngine3. Enables multiple
   1.207    listeners at different positions in the same world. Passes vectors
   1.208 -  of floats in the range [-1.0 -- 1.0] in PCM format to any arbitray
   1.209 +  of floats in the range [-1.0 -- 1.0] in PCM format to any arbitrary
   1.210    function."
   1.211    {:author "Robert McIntyre"}
   1.212    (:use (cortex world util))