When the Operate property is 1, the oTone Object cycles the I/O line specified by the IOLine property at a rate specified by the Tone property thereby producing a tone output that can drive a speaker. The Tone property specifies the frequency of the tone. The frequency is derived from a 1,132kHz clock divided by 128 minus the value of the Tone property. [1132/(128-Value)] For example, a value of 120 will produce a 141.5Hz Tone. [(1132/(128-120)) = 141.5] If 0 is given as the Tone, then the output is shut off. This is useful for some rudimentary low frequency tones. If you need a higher frequency, see the oSpeaker object. if you want music, see the oSoundgin object. The lowest frequency that can be generated is 8.913Hz [(1132/(128-1)) = 8.913] The highest frequency that can be generated is 1132Hz [(1132/(128-127)) = 1132] Note that the frequencies are not linear. This will be most noticeable at the higher frequencies. (1132/1=1132Hz, 1132/2=566hz). Two or more oTone Objects can be set to use the same I/O line. When this is done, the cycles of the multiple tones are combined.The oTone Object's output shares its timing with the rest of the ooPIC's multitasking objects. A large number of Objects running concurrently with the oTone Object can result in distortions on the higher frequency tones. The Freq property is an instance of the oFreqL Object which is created when the oTone object is. The oTone Object uses the oFreqL Object to create the actual tone output. Attributes of the tone can be adjusted by directly manipulating the oFreqL Object. (see oFreqL Object for more detail) |