DIY Guitar Tuner/Note Counter

Hi Guitar Folks

I’ve started making a Guitar Tuner - just for fun - and then thought of other things I could do with - Notes Per Second counter, Scrolling note score e.t.c. Then realized it could be useful for the folk on this forum.

I’m currently coding it in c# Unity first - then plan to embed it in hardware later - a Arduino nano.

No idea if any of it is possible, just wondered if anyone would be interested in making one and or any other functions it could have?

Shabby

2 Likes

Why arduino, when everyone has a smartphone with all the sensors you need for such an app at their disposal?

Hiya Guitarman

I’m learning embedded coding, thought folk here might find something like a tuner/note counter useful. Even tho I am coding a android app with unity - it’s more to test the algorithm than a commercial venture. I’m learning embedded coding because I want to a make a Guitar FX unit - using a PI Zero + Sound card, I want the FX to work how I’d like them to work, and I want valhalla shimmer reverb in a box :slight_smile: This arduino thing is my first step into embedded coding.

for anyone interested - the cost is super cheap:

Arduino nano - £1.99
0.96" Oled Screen - £1.92
Electret Mic - £3.50
3.7v 400mah lipo - £2.00
or
3.7v 1200mah lion with charge circuit - £1.00

Here’s my research so far:

This uses the Auto-correlation method - it’s ok but runs into the octave issue - esp with acoustic guitar the low E string will fluctuate between 80hz and 160hz. It’s also pretty slow :slight_smile:

Here’s one of the bestest current methods - as above but with extra magic to avoid all various issues

http://audition.ens.fr/adc/pdf/2002_JASA_YIN.pdf

If I manage to get it working well - I’ll post the instructions here on how to make one.

Shabby

2 Likes

I thought that all of the effects boxes used DSP chips (and not uC or phone SoC chips)? Do you know what they use? Why aren’t you using that?

What do all of the nearly free clip-on tuners use for processing?

Why are you using C#/Unity vs. C?

Why do you need a sound card, don’t the common audio DSP chips come with A/D and D/A?

So many questions but I like your project, very cool!

Oh, and what algorithm does a TC PolyTune use?

1 Like

Hiya kgk

I thought that all of the effects boxes used DSP chips (and not uC or phone SoC chips)? Do you know what they use? Why aren’t you using that?

I don’t know about DSP chips - I’ve read some chip names in the past Sharc,Sharc2,Blackfin) but never paid any attention - they are more for bulk purchase and assmembly than diy home brew stuff - but I guess they have high speed floating point multiple and add and maybe some trancendentals (sin,cos,atan.tanh,pow e.t.c). But my initial tests with the PI Zero puts it’s 64bit floating point performance around 160million instructions per second. Which is bags of power for a £4.50 device - I suspect nothing else could compete with that power at that price point.

What do all of the nearly free clip-on tuners use for processing?

No idea! - I don’t have one, I do have a Zoom G1on - which has a tuner - which is terribly slow, a few seconds to lock onto the pitch. I suspect the cheap tuners use the naive approach - boost the signal and clip into a square wave then count the zero crossings and average over time to get rid of any harmonics e.t.c Probably using a simple PIC and Distortion circuit.

Why are you using C#/Unity vs. C?

C# for testing algos - It took me 1hr to knock up a simple unity app to test that arduino code. I can port to C/C++ very quickly (these algos are tiny so it’s a matter of a min or two). The turn around time from editing code to running it is super quick - about 2 secs. The turnaround time for a PI Zero is compile,copy to sd card - sd card in device - power it up (you can setup the pi to use a usb uart - but I’ve not done that yet). Turnaround time for arduino- I don’t know because mine has not arrived yet - it’s in the post - but it looks like - compile code - flash arduino chip with usb cable and power it up.

Why do you need a sound card, don’t the common audio DSP chips come with A/D and D/A?

Pi Zero only has HDMI audio output and no ADC’s. I’m bare metal coding using the awesome Circle libs (https://github.com/rsta2/circle) and not using HDMI, just I2C and SPI for oled/lcd display. So I found a simple audio board that does 96khz audio out and in for £16.50.

So many questions but I like your project, very cool!

I’m having serious fun developing it all :slight_smile:

Oh, and what algorithm does a TC PolyTune use?

No idea - I did see a youtube vid with one of the developers/marketing guys at TC saying the Polytune had the longest R&D cycle in the history of TC products :slight_smile: I do plan to do polyphonic tracking later - for various things(EHX Mel9 !!!). But honestly I don’t know how to do it robustly. My Guess would be FFT->Spectrogram->Auto-correlation to find the harmonic matches! I will research that at a later date.

1 Like

Very cool, sounds like a fun project and a great way to learn a lot more about how all this stuff works. Definitely feel free to add on further updates here as you go!

1 Like

Hi Brendan

As you can probably tell I’m super excited about it - more so the note counter than anything else. I’ll post updates here as if I think it’s worthy of a update - I’d like to stress this isn’t a commercial product I’m not selling anything at all and don’t have any plans for that - it’s just a possible super cool DIY tool for the shredders :stuck_out_tongue:

Current status is:

Waiting for Arduino Nano + Screen + Mic to arrive in the post.
Android Test app - going really well - I would rate it 95% accurate - have to tweak the algo’ for many different cases (picking position, guitar type, clean, distorted e.t.c ) ( Android app is for testing only - I have no desire to release it for public use - too much work handling all the different combinations of phone models and droids version out there.)

Since it’s a part time thing - it’ll be a few weeks at least before I get something stable.

Shabby

1 Like