tone (freq, amp, dur)
short, freq, amp, range;
toneon(freq, amp, range)
short freq, amp, range;
The tone generation routines generate auditory stimuli of the frequency, amplitute, range and (optionally) duration specified by their parameters.
freq specifies the frequency of the tone in Hertz. The range of legal values for freq depends on the value of range such that:
range <=freq <= range*10
An additional constraint is that:
range corresponds to the frequency range setting on the tone generation hardware. The hardware currently in use in Department 11221 and PennPsych requires that the user select a base frequency range by setting the appropriate knob on the generator. The value of range should correspond to the setting on this knob.
amp is a number between 1 and 1023 specifiying the relative amplitude of the tone. This number is doubled and passed to D/A converter that outputs a corresponding voltage to a Voltage Controlled Amplifier (VCA). The VCA adjusts the amplitude of the tone produced by the tone generation hardware (see below). While the relationship between amp and the final amplitude of the tone is linear, amp does not represent a particular amplitude scale (e.g. dB). It is the user's responsibilty to calibrate the effective amplitudes produced.
dur specifies the duration of the tone in milliseconds. tone expects the clock to be `ticking' in milliseconds (see clock(3U) ). If the clock is not running when tone is called, tone sets the clock to tick to time a dur millisecond interval. If the clock is running at a speed other than milliseconds or in the wrong mode, tone does not produce a tone and returns -1. The tone routine expects uninterrupted processing. If interrupts that take a long time to process occur while a tone is being generated, the tone may be longer than desired.
toneon initiates the tone specified by freq, amp, and range. The tone is sustained until toneoff is called.
Tone generation hardware provides a 6 millisecond amplitude ramp for tone onset and offset.
The tone-producing routines use D/A channels 1, 2, and 3 as follows:
Channel: Interfaced to: 1 Wavetek frequency selector 2 Wavetek on/off trigger 3 Voltage Controlled Amplifier