Guitar to V/Oct
Hi, I'm trying to connect my guitar to my modular system via 1V/Oct. The idea is to detect the fondamental frequency of the note played, then convert it into volts. I'd like my scale to begin at E2 = 1V.
I'm looking for a mathematical expression to do this in real time. Everytime a note is played, it would be converted to a scale from 1V to xV, with 1/12V step.
To send this values to my modular, I was going to use Arduino UNO (using firmata and analog outs, from 0 to 5V) but maybe there's a better solution.
I don't know if I'm clear...
Thanks
What are You using for pitch detection ?
Some arduino library ?
Or pitch detection in max ?
Here is some math to do what You asked for:
If You want to do Pitch detection in Max,
I would low pass the signal with a good filter,
and maybe limiter for good sustain...
There are some other options if You want to go analog ...
LM2907 or LM2917 freq to voltage ICs
Thank you for your quick answer.
I'd like to do the pitch detection in Max. To do this, I thought about the fzero~ object to get the fondamental frequency. I'll try to use a limiter of hard compression before pitch detection, and thanks for the ICs I'll have a look as soon as I can :)
I just opened your Max patch and there's something I don't understand: the source is analog, so you think I should convert the notes to midi first? And why did you subtract the midi note number before the mathematical expression?
To output the result voltage, I was going to send the values to a live.dial, midi mapped to an analog output of the Arduino extension (M4L connection kit).
Thanks a lot for your time,
Thomas
I did the top part so that You can see what the result will be just by sliding notes by hand.
Did You not read the comments ?
And -52 is there so that the lowest note of interest = 52 or E2 is 1.
if middle C = C3.
If You are using C4 as middle C than this will be 40 instead.
Anyway lowest note has freq of 82.4 Hz
I thought You would just send float to arduino, float being voltage.
Yes sorry I didn't understood it that way at first read. The idea seems to work now, thanks a lot. I'll try to send the values to Arduino to see the result!
That's fine.
What voltage range do You need ?
More than 5 volts ?
From 0 to 5V is fine
Are You doing voltage via pwm output on Arduino ?
With some rc filter ?
I did once a similar project, ended using
digital potentiometer as voltage regulator.
It was dual Pot DS1267, I had to link both pots
to form single 512 steps pot.
256 steps was not enough resolution.
5v / 256 = 0.01953125v per step
5v / 512 = 0.009765625v per step
But a better choice wouold be real DAC like MCP4725 or MCP4921.
12 bit dac would have enough resolution.