Sun Nov 07, 2021 5:43 pm
To put Some_3t22s' in a mathematical equation it would be RPM * port / 60. Most 2T22s do 3450 RPM so 3450*10/60 = 575 Hz and 3450*12/60 = 690 Hz.
For those that want to create a tone generator and take the digital route, I'd recommend an Arduino. I've implemented a full-fledge tone generator on an Arduino Mega and does pretty much every tone from most manufacturers' products along with a voice board. I ended up programming it in such a way that I could technically drop the board into a HyperSpike or Genasys (LRAD) system and turn them into actual sirens if I wanted. I've actually thought about proposing the idea to Sentry, but they dropped the VR series before I could actually make any kind of proposal to them. The language these boards use is similar to C, C++, Java, etc. To replicate dual tones in the code you can use the low side frequency as the base frequency (that is how Federal does it on their controls) and multiply it by the ratio. Swap the numbers to make an improper fraction and turn the number into a decimal. Multiply the base times the decimal and it creates the offset.
This is an example from my code. On the more technical side of things, I use the ToneAC library to generate the tones since it produces pretty smooth frequency sweeps as opposed to the built-in tone() function. I modified the library to take advantage of the larger chip on the Mega and create a second output since ToneAC only has one. When I do frequency sweeps I use a loop to control it. The code will increase the pitch by 1 and wait a certain amount of milliseconds before looping back around and doing it again. After each incrementation of the pitch, I invoke the toneAC() function along with my own toneAC4() function to update the frequency of the outputs. With my version of that library, the sound comes out of pins 6 and 7 (ToneAC4) and 11 and 12 (regular ToneAC on the Mega).
Let's say we've peaked in alert tone and we are mimicking a 500-SHTT. The pitch has been set to 575 Hz. For a 10/12 ratio I turn it into 12/10 and divide the fraction out to get 1.2. I have a float (decimal) variable declared in the header of the code called "offset" that holds this value, so if I want to change it to something else I can just change this and it changes everything in the code. This is the code that updates the frequency on each output:
toneAC(pitch);
toneAC4(pitch * offset);