||Ardcore w/ Expander sketch:(primitive) Audio to CV converter
| br>This is the first version of a sketch that I've played around with over the last couple of days. It's a primitive monophonic audio / frequency to CV converter for the Ardcore with the expander.
The Ardcore really doesn't have the power to implement really fancy, accurate pitch detection with any sort of speed. It *does* however have the power to implement the simplest method ("zero-crossing"). To help with the inevitable glitching, this routine includes a pattern matching / averaging routine to help smooth out the glitches.
Don't expect perfect results with this or blazing tracking speed at the moment, but even so, imperfect results can be fun too.
Plug the audio into A4.
A0: Threshold (0 left-100% right)
A1: Left side = do not quantize Right side = semitone quantize
A2: Match percentage for matching algorithm (0 left-100% right).
A3: Packets to analyze. Left = less packets, faster algorithm, glitchier. Right = more packets, slower algorithm, not *quite* as glitchy.
(Note that setting A3 all the way to the left turns off the pattern matching algorithm for maximum glitchiness.)
D0: Gate. Will hold high with audio over the threshold.
D1: Trigger, will output on note change
DAC: CV output, converted from frequency.
Frequency and CV range correlation: 0V = C1 (32.703Hz), 5V = C6 (1046.5 Hz)
Due to 8 bit resolution the Ardcore always is "quantized" to a degree (even "unquantized" is really "quarter tone quantized"). This results in things sounding "jumpy" even when the routine has latched on to the wave (if there's vibrato for instance). I personally like to run the DAC output CV through a slew to smooth out any small glitches.
The algorithm behaves pretty good with signals that emit *very* periodic, predictable waves. A sine or square wave from a Dixie tracked quite well for instance, and I'm sure other external electronic instruments might be just as nice.
It is less stable with things like vocals and guitars, although the smoothing helps quite a bit. For some cases it probably is possible to either use analog filters to narrow the harmonics down. Or, for some cases it probably is possible take the opposite approach and overdrive the signal into a square wave, which is more "periodic" and can be handled better by this routine. (Humming into a mic that was overdriven with the E440 tracked pretty well for instance.)
Of course, glitchiness has applications too -- for instance, noise fed into the program with A2 and A3 all the way to the left might produce random quantized notes.
I recorded two examples of a guitar driving a Metropolis patch. D0 drives the gate and the DAC out drives the CV. (A foot pedal drives the Metropolis filter.) The guitar is on the left channel, the Metropolis is on the right.
In the first example, the CV output from the DAC goes through a slew first. A2 and A3 are set around 75%-80% right. You can see that the routine tracks okay for a while, and then on occasion has a mind of its own .
In this second example, A2 and A3 are set at 0%, and the slew is off. As you can see, the glitching is considerable. Some people will like that. br> br>
| br>CoolÃƒÂ¢Ã¢â€šÂ¬Ã‚Â¦ have to test itÃƒÂ¢Ã¢â€šÂ¬Ã‚Â¦
Thanxs for sharing new ideas and stuff! br> br>
At first, thanks for your effort. I was trying google "frequency to cv ardcore" by chance, and wasnt expecting any results.
i was able to load it to the ardcore. (yes, since osx update this has to be mentioned as a win
connected a well preamped single-note guitar signal to the analog in (the left input above the usb-connector) and the analog out (the right jack above the usb-connector) to a vco. but nothing happened. tried a lot options, obviously the parametersettings, cranked up the input. but really nothing was changing at the cv, not even jittering.
tried it with an squarewave from an other oscillator as driver then, no pitchtracking or even jittering... br> br>
| br>ha. advantage for the one who is able to read. u need the expander with your program. and i missunderstood the function of the two ports above the usb-port. i thougt one is adc the other dac.
ok, but i was able to modify your program to make it work without expander.
i turned quantization to permanantly on. then dispatched A3 to A1. so the A3 input is free to read the analog input from there.
now it works and it is really fun. thank you for the good base. br> br>
| br>Very interesting!!
Any chance of sharing the non-expander version as well, disio (if that's okay with soundwave, of course) br> br>
| br>sweet! gonna give it a whirl tomorrow, thanks for sharing! br> br>
Powered by phpBB © phpBB Group