I'm hoping someone can direct me to a solution...
I want to accurately detect the frequency of an external VCO source (using something like Freq Measure library) and track some Teensy synth Waveform objects to it.
In theory (my theory at least), it should be easy to take the frequency output of FreqMeasure and simply feed to to the Waveform object. It seems from my limited knowledge however, that the two processes are competing for CPU time and BOTH have critical time requirements.
From what I've read, the T4 CPU only has one core, so I couldn't even wish for a CPU hardware level solution.
One thought, was to use one of Teensy's (32 bit?) timer / counters as a phase accumulator to measure the period of the external frequency source, thus starting to count on an input zero crossing, and then stopping it again on the next. This "gating" could be handled by simple external circuitry. What I'd be left with is reading the counter / phase accumulator into a variable, passing that number to the Waveform frequency parameter, then resetting the counter. Yet, I'm not sure if that's possible with the Teensy.
An alternative might be to have an external hardware CMOS counter / phase accumulator circuit, and then read it in parallel into the Teensy - but this seems wasteful of pins and external hardware - if I can do it in the CPU.
FWIW, I'm NOT trying to track pitch of complex waveforms - just a simple square wave input.
Guys - I'm open to ideas here.
Thanks
I want to accurately detect the frequency of an external VCO source (using something like Freq Measure library) and track some Teensy synth Waveform objects to it.
In theory (my theory at least), it should be easy to take the frequency output of FreqMeasure and simply feed to to the Waveform object. It seems from my limited knowledge however, that the two processes are competing for CPU time and BOTH have critical time requirements.
From what I've read, the T4 CPU only has one core, so I couldn't even wish for a CPU hardware level solution.
One thought, was to use one of Teensy's (32 bit?) timer / counters as a phase accumulator to measure the period of the external frequency source, thus starting to count on an input zero crossing, and then stopping it again on the next. This "gating" could be handled by simple external circuitry. What I'd be left with is reading the counter / phase accumulator into a variable, passing that number to the Waveform frequency parameter, then resetting the counter. Yet, I'm not sure if that's possible with the Teensy.
An alternative might be to have an external hardware CMOS counter / phase accumulator circuit, and then read it in parallel into the Teensy - but this seems wasteful of pins and external hardware - if I can do it in the CPU.
FWIW, I'm NOT trying to track pitch of complex waveforms - just a simple square wave input.
Guys - I'm open to ideas here.
Thanks