Source Code Description (Main Programs)

Proportional Mode Code

proportional.c

Establishes serial communications with the Laser Range Finder (LRF). Continuously obtains a range measurement from the LRF, maps it (inversely), to frequency (and optionally amplitude), converts it to a MIDI note   and outputs the note for a specified duration and velocity on one of the 135 Midi instruments available with the QTMA software synthesizer.

The presence of a Depth Discontinuity (a change in distance greater than a pre-defined amount between the current and last valid  reading), causes the output of one of two different signals depending on whether the current reading is closer to the user (change between current and  previous readings is negative) or farther away from the user (change is positive).

referenceProportional.c
 
Establishes serial communications with the Laser Range Finder (LRF). Continuously obtains a range measurement from the LRF and determines whether the range measurement is within the "No Change region".  If it does, then there is no output generated however it does not, the range measuremnt will be mapped to the audio domain, the corresponding audio signal is output and a new "region" is defined. To generate the output, the range measurement is mapped inversely to frequency (and optionally amplitude), converted to a MIDI note and output for a specified duration and velocity on one of the 135 Midi instruments available with the QTMA software synthesizer.

The presence of a Depth Discontinuity (a change in distance greater than a pre-defined amount between the current and last valid  reading), causes the output of one of two different signals depending on whether the current reading is closer to the user (change between current and  previous readings is negative) or farther away from the user (change is positive).

Derivative Mode

Absolute

regularAbsolute.c

 In this version, the distance (derivative) of the current and previous distance readings is mapped to sound.  Once a reading is obtained, the difference between it and the previous distance reading is  determined.  When there is no change between the two distance readings (which occurs when they are within 'MIN_DISTANCE' to each other), the tone associated with this is output.  When the difference between the two tones is greater than 'MIN_DISTANCE' then one of two different tones may be output depending on whether the current reading is greater than the previous reading ("moving away"), or less than the previous reading ("moving closer").  In addition the amplitude of the last two tones may also be altered with the change in distance (e.g. a larger change in distance will result in a greater amplitude tone).

Non-Absolute

peiceWiseConstFreq.c

In this version, the distance (derivative) of the current and previous distance readings is mapped to sound.  Once a reading is obtained, the difference between it and the previous distance reading is determined.  When there is no change between the two distance readings (which occurs when they are within 'MIN_DISTANCE' to each other), the tone associated with this is output.  When the difference between the two tones is greater than 'MIN_DISTANCE' then one of two different tones  may be output depending on whether the current reading is greater than the previous reading ("moving away"), or less than the previous reading ("moving closer").  In addition the amplitude of the last two tones may also be altered with the change in distance (e.g. a larger change in distance will result in a greater amplitude tone).

differentInstrumnet.c
 
In this version, the difference in distance (derivative) of the current and previous distance readings is sonified.  All output is generated using one of the many instruments available with the Quick Time Music Architecture's (QTMA) General MIDI software synthesizer.

Range measurements are obtained at a rate of 8 per second.  Once a measurement is obtained, the difference between it and the previous measurement is determined.  When there is no change between the two, (which occurs when they are within 'MIN_DISTANCE' to each other), a pre-defined Midi note value is output.  When the difference between the two tones is greater than 'MIN_DISTANCE' then the difference is mapped linearly to a midi note.  Although the mapping is linear, corresponding midi notes are separated logarithmically (e.g. adjacent midi notes differ by 1.05).

The difference between measurements may be positive or negative.  A positive difference indicates the current measurement is farther than the previous one ("moved away"), whereas a negative change indicates the current measurement is closer than the previous one ("moved closer").  Two instruments are used to generate the Midi note depending on whether the measurement is "moving away" or "moving closer".  To allow for the perception of the above cases, three regions have been defined.  The first region (low frequencies) is is used for "moving away", the second for "no change" and the third (higher frequencies), for moving farther.
 
NOTE

In all versions, a reading containing more than 12.5% "drop-outs" (as indicated by a ')'), is treated as a valid reading.  When an "out-of-range reading is encountered (as indicated by '))))'),  the tone corresponding to the last valid reading is output.

In addition, prior to program execution, the LRF must be turned ON and in the "READY" mode.  Should the LRF be turned OFF, the program will terminate (actually, this is the way to terminate the program properly).