Hacker News new | comments | show | ask | jobs | submit login
Show HN: How to Tune a Guitar (mathisonian.github.io)
338 points by mathisonian 5 months ago | hide | past | web | favorite | 119 comments



This is really cool.

If your main focus is to teach people how to tune a guitar, you should consider mentioning that you always want to tune a sharp guitar string to slightly below the correct pitch and then tune it up.

Any slack present in the string winding can cause the string to go out of tune easily if you loosen the string to the correct tension. Tightening to the correct tension doesn't have that problem.

If your guitar has locking tuners, this isn't necessary because there is no string winding and therefore no slack. For anyone who doesn't know, a locking tuner clamps down onto the string to hold it in place instead of having the string wound around it.

This picture is of a locking set of tuners. The person is about to press down the locking mechanism for the low E string to hold it in place. Note that the other strings have no winding around the peg.

http://www.prsguitars.com/csc/tuners/lock_4.jpg

Most guitars don't come with locking tuners but I would recommend that everyone use them because they make changing strings so much easier.

Anyways, I really like your web page. Cool stuff.


> Any slack present in the string winding can cause the string to go out of tune easily if you loosen the string to the correct tension.

You can get around that by using harmonics. Because you play harmonics without pushing all the way down, you can achieve a more precise tune.

The strongest harmonic is achieved when you gently place your finger on the string directly over the metal fret. A harmonic can only be achieved when you do not press the string all the way down into the fret.

The harmonic on the 7th fret of one string is the same note as the harmonic on the 5th fret on the next higher string. This is true for all consecutive string pairs other than (G, B).

You can tune using these pairs of harmonics to tune more precisely than pressing all the way down.

You will need to tune the (G, B) pair without harmonics.


You're correct but I think you are addressing a different problem. He was mentioning the issue specifically about differences in tension from turning the peg clockwise versus counter clockwise.

If you tune downard tonaly, so from an F# and you want an F, the string will more easily fall out of tune. I am not sure what causes this, some interplay between the friction of the peg and the final resting position of the string on the nut being different depending on the direction maybe. By tuning down perhaps you end up relying on some of the friction from the nut which goes away quickly as the string settles to an equal tension on either side of the nut.

I have noticed it's not as much of an issue on carbon nuts or well made nylon/bone nuts.


While the 7th fret harmonic / 5th fret harmonic will get you close, they are off by a little bit. Good explanation here: http://www.schrof.net/guitar/articles/harmonics.html


> You can get around that by using harmonics. Because you play harmonics without pushing all the way down, you can achieve a more precise tune.

The big problem with trying to tune a guitar that way is that you're tuning a guitar so it's in tune when you don't press the strings, but then when you actually play it you do press down the strings. Strings 5 and 6 should be tuned slightly flat relative to the first four, the exact amount depends on your play style, but if you don't tune them a bit flat then they'll sound sharp when you're playing. If you haven't tried this yourself you might guess that it's subtle effect, but depending on your play style it can be huge.

The other problem is that the harmonics are actually 2 cents off of an equal tempered fifth, and if you tune six strings that way you'll end up 10 cents off. Your octaves will sound wrong.


> The big problem with trying to tune a guitar that way is that you're tuning a guitar so it's in tune when you don't press the strings, but then when you actually play it you do press down the strings.

When you press the strings, they will all press equally, playing a correct relative tune.


I have never been able to consistently tune a guitar using harmonics. It was always a fun trick when I was first learning to play, but it was never quite right and now that I'm older it is far more difficult to hear subtle differences between harmonics.


It's been quite a while since I tuned a guitar this way, but isn't the trick with using harmonics that you listen for clearly audible "beats" when it gets in the ballpark? Once there are no more audible"beats" you're in tune.

Hearing loss has no impact on this - unless it's really, really bad, of course.


That would definitely get you close, but the range that the "beats" are not audible is a wide range and in my experience hearing loss had affected my ability to detect their absence.


Tune the B string with the harmonic over the 7th fret of the low E string.


An additional tip: tune all the strings to the A string, not to each other. If you tune the B to the high E and then the G to the B, and so on, then each small mistake throws the rest of the strings off by increasing amounts.

It's good to be aware of this if tuning by harmonics:

http://www.schrof.net/guitar/articles/harmonics.html


Very good point. In my experience, it's still worth doing even with good locking tuners. Slack around the post is only part of the equation, the string can also bind at the nut. Especially on guitars without straight string pull.

You can also achieve the same stability with regular tuners. You don't need more than a wrap or two around the post if you lock the string under itself.


I agree, and it's such a cheap upgrade that I'm surprised they're not standard on all guitars.

For a really decent set of el-chepo locking tuners, I highly recommend these:

https://www.guitarfetish.com/Gotoh-Style-Chrome-Locking-Tune...


Cheap locking tuners are inferior to quality non-locking tuners. I would pick a good set of non-locking over cheap locking tuners any day, unless I absolutely needed to do dive bomb tremolo swings.

Also, you can usually solve tuning problems by replacing the bridge and nut with something hard and smooth like Graphtech TUSQ (they call them "self-lubricating", whatever that means).

That's not to say locking tuners are bad, it's just that I don't have problems with tuning on any of my guitars that have decent nuts and decent tuners. I even used to play my Schecter (old 1990 California model Super Strat) without the Floyd Rose nut locks in place because I wanted to be able to switch back and forth between alternate tunings without the hex wrench. No problems with tuning, at all.


I agree with your comment about quality hardware. I don't have fancy locking tuners, I only have a vintage Fender Telecaster with old-school Kluson "split shaft" tuners where the end of the string is bent and inserted into the shaft. Once you get used to properly stringing the guitar (it helps if you change strings often), it's not hard to avoid string slippage or going out of tune. The trick is to have enough winds around the post and for the windings to wrap progressively lower on the post until the string leaves the post lower than the nut.

Here's a great video on stringing up Klusons: https://youtu.be/GqYrXh4D6wI


Split-shaft (safety post) Klusons are my favorite tuners, if they're maintained correctly. A little dab of sewing machine oil in the gears can quickly loosen up stiff Klusons.

I'm always stabbing myself on sharp string ends sticking out of tuners. Safety posts really reduce the bleeding in my life.


A self lubricating nut has a lower friction than other nut materials (usually plastic or bone). It'd be more accurate to call it a no-lubrication-needed nut but I guess that doesn't roll off the tongue as easily.

It's my experience that locking tuners do help with tuning stability but I've also seen plenty of guitars stable enough without them.

Even if they don't help a guitar with tuning stability, they definitely speed up the string changing process which is worth it for me.

edit: I've just noticed that the link in the parent comment is for "gotoh style" tuners, not tuners made by Gotoh, and I have to say I agree with you about the low quality of cheap tuners. That said, a good set of locking tuners should only cost you $50-$70. Not a bad price.


Yeah, the way Gotoh locking tuners work on string changes is great. And, Gotoh parts are top notch. Their high end bridges are beautiful chunky things (I have a G&L bass and guitar because I love a big ol' chunky bridge).

So, sure, it's nice to have more convenient string changes. But, I don't want cheap tuners, no matter what. It's one of the big things that tells me immediately whether the guitar I'm playing is cheap or expensive. I used to think Klusons looked cheap and old, when I was a kid, but I have grown fond of them after so long playing. It's what's on both of my really expensive guitars (came from the factory that way), and I've never felt the need to change them because they've worked great for decades.

That said, if you've got a cheap-ish guitar and want to improve it, tuners, nut, and bridge are where I'd start (after getting a proper setup, and getting the frets in shape, of course). Also, while I'm ranting about the onion on my belt...bone is a poor choice for nut/bridge material. It has wildly inconsistent density and hardness, and just plain isn't as good as modern materials (and we can note that many of the very best and most expensive guitars today, like PRS, do not use bone).


I am a huge fan of G&L basses. I recently sold a fretless L1000 that was one of the best basses I have ever played because I stopped playing bass and started focusing on guitar. Haven't gotten a chance to play a G&L guitar yet.

Depending on the specific guitar I'd also look into swapping the pickups. That usually gives the best sound improvement but does nothing for the playability. Luckily, the playability of a lot of cheap guitars today is very, very good.

I agree that bone is a terrible material. It's only still used for historic reasons, I think. Guitar players are a notoriously superstitious bunch and often times dont necessarily want the best when they can instead have what we thought was the best in the 70s.


Agreed. I've been amazed at how good cheap guitars have gotten in the past ~10 years or so. Fender is making incredibly great cheap guitars. Even their Chinese made stuff is good. Yamaha, too. Probably others, as well, but I've had hands on both of those in recent months and been really impressed.

The quality improvements that come from heavily automating the process are hard to overstate. CNC machines, and improved metal fabrication methods, have revolutionized guitar making. They're still putting cheap hardware and electronics on the low end stuff, and it shows in the longevity, tuning stability and some other areas, but as you note they mostly play really great right off of the rack.

They're still using cheap-ish wood that doesn't age very well, also. Fret sprout and various sorts of warping is, as I understand it, still much more common on cheap guitars. My 29 year old Schecter has never had a setup or adjustment, and still plays beautifully (frets are a little worn and could probably use a touch up, but still very little buzz). The G&L L2000 bass I have is 31 years old and has maybe had a couple of turns of its truss rod in the time I've owned it. I dunno about any other setup or adjustments in its life as I've only owned it for about half of its life. But, I get the impression that cheap guitars are needing attention within a year or two, mostly because the wood is fresher when they build them and so they aren't as stable.

My G&L ASAT guitar is actually a Tribute, so it's one of the cheapish ones made in Indonesia. It's in need of attention already (quite a bit of fret buzz even without really low action), and it's only a few years old, so it seems to bear out my theory. It's not a "cheap" guitar, and it's not poorly made, but it's not an expensive guitar, either, and I'm guessing the wood was aged/dried for a much shorter period than my American G&L or the Schecter. The only other American-made instrument I have is a Gibson J-45, and it's holding up very well, too, but it's much newer...a 2008, I think.


I'm a big fan of those Kluson tuning machines that were on the early Fenders. In terms of design it's a case of "they got it pretty much right the first time." It's superior design and simplicity (split shaft). They are easy to use once you get used to stringing them up, and I've found they don't go out of tune. They are small, light, streamlined, and the oval grips are aesthetically pleasing from an industrial design perspective, particularly when set off against the Telecaster or Stratocaster headstock.


Yep, the vintage stamped steel Kluson style tuners really are my favorites. I don't think you can improve on the simplicity of them or the neatness of having the string end tucked inside the tuner. And, yes, they're the right size...they don't look as fancy as a lot of other tuners, but I think they look right. They've also proven to be stupidly reliable. You can find 50 year old Klusons that still work well.

Even my Gibson J-45 has them; it hasn't always been common for Gibsons to use Klusons, and while the stuff Gibson usually uses is also fine, I prefer the Kluson style. They're aesthetically pleasing in a functional, not showy, way.


I wish they would, it's the first thing I do to new guitars along with installing strap locks and a slightly thicker set of strings.

I usually use the Fender branded ones because I'm usually putting them in Fender guitars. I've heard good things about Gotoh, Schaller, Planet Waves, Hipshot, and Grover. I'm pretty sure the Fenders are actually just rebrands of one of those manufacturers.

edit: For anyone curious, it seems that Fender American Deluxe's used to come with them and the new American Elite series that replaced the Deluxe's still come with them. I guess they want to keep it as a differentiating feature for their most expensive "modern" guitars. None of their reissue vintage styled guitars come with them, I suppose for authenticity.

You can even buy a $12,000 private stock PRS and it won't come with locking tuners.

edit 2: I've now noticed that the tuners you link to are "Gotoh style" tuners and not actually made by Gotoh. I don't think I would use any tuners made by a name brand I'm not familiar with, locking or not, because they tend to be noticeably lower quality than the bigger brands. There are exceptions, of course.


I believed this for the longest time, and honestly, I never ran into this problem once I had a guitar with decent tuners and started buying very good strings.

Grover tuners for the win though. I never used locking tuners, so no opinion on them. I'm good enough changing strings that one turn of the tuning peg is all I need.


The "tune slightly flat" technique gets people 90% of the way there, which is usually enough. The remaining 10% is really subtle, like most subjects.

This is like "the earth is a sphere", which is mostly right but if you want to be less wrong you have to dive deep.

So...

The instant after a string is plucked, it begins to lose energy. The loss of energy shows up in amplitude (obvious, because the note gradually gets quieter), but also frequency. This is less noticeable, but for heavy strings with low tension (think down-tuned sludge metal) it can be pronounced.

The reason for this is that a vibrating string is constantly bending back and forth. Tension pulls it toward its lowest-energy position in the center. A familiar demonstration of tension is bending a fretted note to increase its pitch. But the same thing happens to a lesser degree whenever the string vibrates. Displace the string left or right and its tension increases.

Strings you consider "better" might exhibit less of this effect. But that depends on both your playing style (how hard do you strike the strings?) and your idea of what a better string is.

"It depends on technique, tension, and string mass" gets you to 95%.

For conventional electric guitars with magnetic pickups, there's an additional force slowing down the string: the magnets in the pickup. These are weird. For one thing, unlike tension, it's not distributed throughout the length of the string, but focused at 1 or a few (for multiple pickups or humbuckers) points. If you imagine the vibrating string as a weight-on-a-string-pendulum, then the effect of the magnetic pickup is like a small mass attached partway up the string. It interferes with the pure sinusoidal motion and gives it a little wobble.

On most guitars, the effect is not noticeable. But some pickups have very strong magnets, or some guitars put them very close to the strings. Then it can be noticed, and guitarists call the effect "wolf tones" and generally they don't like it.

This gets you to 98%.

My point is there's a lot going on. And while a certain brand of strings and/or tuners may work for you, someone else may have an entirely different experience. I get kind of frustrated with the whole guitar "gear" marketing being heavy on hype and light on data, so sorry if I come across as lecturing. My frustration isn't with you, but the context.


>For conventional electric guitars with magnetic pickups, there's an additional force slowing down the string: the magnets in the pickup.

That's interesting, I never even thought about that. So theoretically, if you remove one of your pickups, you should get a slightly better tone, and longer sustain, right?

Personally, I never use the middle pickups on my guitar, and actually wonder what they're for. I only use the neck and bridge pickups. I've noticed a lot of newer guitars simply eliminate the middle pickups.


Technically: less magnetic force gives you more sustain, but practically speaking it's probably too small of a difference to notice.[0]

The middle pickup in a Strat-style guitar is often "reverse wound, reverse polarity" which, when combined with one of the other pickups, provides some hum cancellation.

If the neck+middle or bridge+middle combo is in parallel (most are) you'll get a slightly more hollow/nasal tone compared to the neck or bridge pickup alone. The jargon for this is "quack" as in "it has a lot of quack".

If the combo is in series, that's essentially a traditional humbucker (albeit with the 2 coils spaced farther apart than usual). It'll be louder and have more midrange. 2 single coils wired in series like a humbucker can often be too mid-heavy and start to sound "muddy" or "lacking in definition". Real humbuckers can get away with using smaller magnets (ballpark: half the size of single coil magnets) and their close physical spacing means the signals going into each coil are nearly identical, so adding them in series just makes it louder, without making it "muddy".

Often, players who don't use the middle pickup will keep it there but use the height adjustment screws to lower it deep into the pickguard, farther away from the strings. In my opinion, the most practical benefit of this is your pick doesn't bump into it, but there are probably very subtle tonal effects going on.

[0]: Whenever you have "electric guitar" and "subtle difference" together, I demand blind testing before believing anyone else's claims. I trust my own ears, but I know myself well enough that my eyes will fool them.


My intuition is that removing a pickup would not reduce sustain. The magnets are pulling slightly on the strings, which would increase sustain, but not enough to be noticeable.

It really comes down to the wood of your guitar. You can feel the vibration of the guitar when you play, and the difference between one with a lot of sustain vs one without is pretty noticeable.

The pickups and amp, and gain levels also make a difference. The pickups on my guitar are extremely sensitive, so any little touch is quite loud through my amp.


Right. I just think there's a lot of saw tales and, after some exploration, I'm not convinced.

Another odd one is over tune new strings to get stretch, which often gets turned to don't put new strings on a guitar the same day as a show.

Well, call me a rebel, but I don't stretch my strings and I will go one stage 30 minutes after putting on new strings.

These are fine rules of thumb, I suppose, but as you are saying, a lot of nuance is involved.

The only thing I'll flat out disagree on is that old strings sound better... No just no.


The effect of string stretching is pretty easy to verify. After putting on a new set, tune them to pitch and the stretch each one side to side and away from the fretboard a few inches. They will all be at least a quarter step flat afterwards, usually more. Tune them to pitch again and restretch and they will be less flat.

I'm not sure stretching matters for the long term tuning stability of the strings but definitely has an effect on the immediate tuning stability. Players who don't bend much and fret/strum lightly might not need the added stability but I like it.

Also, I've only ever heard the old strings sound better thing about flatwound strings, particularly on bass guitars, in which case it's true as long as "good sound" to you means a serious lack of treble.


"Well, call me a rebel, but I don't stretch my strings and I will go one stage 30 minutes after putting on new strings"

Which would probably work.

Back in the day I would break strings on stage. Yes, stretching strings helps a lot in that case.

Of course you can only do so much of it before the rest of the band has milked the specially rehearsed for just this occasion "intermission music”, but it really does help.


If the string is sharp, sometimes you can just pull on it and the strings tuning will become flatter, sometimes exactly what you want.


This is true. I usually stretch my strings after putting new ones on to try to minimize the effect of stretching, though. Helps stay in tune when you bend a lot. Remove old strings, put new strings on, tune new strings up to pitch, stretch them by pulling them a few inches off the fretboard and moving them side to side like you're doing a bend, marvel at how flat your just-tuned strings now are, and then retune to pitch.

For maximum tuning stability, I also put locking tuners on my guitars and lubricate all of the parts where the string touches. This includes the nut, the saddle, and any string trees.

I use a humorous product called Big Bends Nut Sauce but I've heard graphite from a pencil works as well.

https://www.amazon.com/Big-Bends-Nutsauce-Guitar-Lubricant/d...


Vaseline applied to the nut grooves in very, very small amounts with a toothpick also works well.


I prefer safety post tuners. You can get accurate ones for cheap and string changes are super fast and easy. Usually enough winding to make for stable tuning.

I’ve found slightly over-tightening most locking tuners will break the string. Not a frequent occurrence for me, but frequent enough to bug me. Usually happens when I’m in a rush.


That's cool, I didnt know they made this style tuner for guitars. They're pretty standard on basses and I've always preferred them to standard guitar tuners.


Thanks! That is a great tip about tuning a string slightly flat first.


Hi HN - I'm one of the authors of this post and I lead an open source software project called Idyll that tries to make it easier to write interactive posts like this for the web. This is part of a research project I'm doing while completing a phd at the university of washington.

If you like this one, check out other examples that have been made with the tool here: https://idyll-lang.org/gallery


I just logged in to say that I love you for creating both this specific application and for software you are creating to make things like this. I loved the explanation, I love the execution, and I love the spirit behind this. More power to you man.


Thank you for the mobile data warning. I wish more websites did it.


I suggest turning off the distortion by default for the 1st stage of tuning with the electric tuner. The distortion can mask being slightly (+/- 5 cents) out of tune, making it hard to hear even though the tuner says it's still wrong. Additionally, in all my years of playing, I have never fed a tuner with a distorted signal from the amplifier, but a clean one; the tuner pedal is the very first item in my effects chain before the amplifier. I suspect it is easier for a tuner to pick out a(n) (in)correctly tuned note from a clean tone, as there's simply less frequencies in the FFT to sort through. It may also make it easier for users to pick out the fundamental and it's natural harmonics in the FFT.

Another suggestion is to model how the tone will go slightly sharp on the attack. How much depends on how much tension the strings are under, and thus all the things that effect that (tuned note, string tension & scale length).


You should always tune to clean. If you have any sort of distortion (particularly digital) you start to introduce aliasing and will have the pitch detection algorithm locking on to frequencies that have wrapped around the nyquist.


> I suggest turning off the distortion by default for the 1st stage of tuning with the electric tuner.

Agreed.

Otherwise, great work!


Seems like a neat idea, but controlling the tuners with the mouse is really fussy and annoying. There seems to be some kind of delayed reaction and I frequently overshot the frequency I was targeting (a problem I don't have when tuning my actual guitars).


Agreed, this was not smooth at all, and using a touchpad seems to make it worse.


It seems like it's limited to one update every second.

Perhaps it's a limitation of Idyll[1], which was used to make this. Although I'd guess these parts are done in D3.

[1]: https://github.com/idyll-lang/idyll


It was painful on a touch screen too.


Doesn't work on Chrome 66 due to recent policy changes with regard to autoplay

https://developers.google.com/web/updates/2017/09/autoplay-p...

I checked it out in Firefox. Very neat :)


So crazy. I'd seen on HN that chrome was rolling out that feature, but it didn't seem like a big deal at the time. Chrome already blocks things like pop-ups and flash, but it tells me when it does so and offers me a way to load the pop-up / flash content if I want it.

This time, chrome just feels broken.


Oh man. Thank god they've added this. I've been using an extension to do this for a while now. I'm so glad they finally just implemented it!


I've just pushed a fix for this in case of errors due to the new policy. Not a huge fix but I wish it didn't need to be done.


Doesn't work for me in Chrome Beta or Canary I'm afraid, unless I reload the page which is probably not intuitive for many users.

What I've been doing is sending a pop-up to users on audio-critical pages (where audio is the entire point of the site) that says "hi, let's get started, you'll hear audio on this page so please adjust your headphones or speakers" and that seems to give the best result. It's also helpful on a page like yours where the sound is quite loud and I found it a bit loud for my headphones. You must also just provide a button that changes the sound volume which would have the same effect, of telling Chrome that the user has interacted with the page.


I can't even get this guitar tuning site to work by adding it to the whitelist...


The distortion sounds like it is applied to individual strings, if it were applied after summing, it would not only resemble more a real electric guitar, but also sum- and difference frequencies of detuned strings would be audible much nicer as beating.

Furthermore, the intervals E-A/A-D/D-G and B-E are not exactly perfect fourths, they should be equal tempered. Luckily the difference is almost negligible for the fourth, the perfect interval would be 4/3 = 1.3333 versus 2^(5/12) = 1.3348 for equal temperament. The interval G-B however is a major third, here the perfect interval is 5/4 = 1.25 while equal tempered is 2^(4/12) = 1.26 Those minor errors accumulate if one string is tuned based on the preceding one, the interval from lowest to highest strings can be calculated:

(4/3)^4 * 5/4 = 3.95 for perfect intervals, 2^(4 * 5/12) * 2^(4/12) = 4 for equal temperament.

The highest string should be exactly two octaves (= a factor of 4) above the lowest one, so the equal temperament should be preferred. A practical result is that tuning a guitar using only intervals of adjacent strings will never really converge to the ideal result, so tuning (fretted) octaves and flageolets should be used in addition.


The distortion sounds are being distorted on individual strings, as opposed to after summing. If you look at the credits, and follow the link to the sound sources, you can find the files used. If you listen, you'll be able to match them up. While I agree that the distortion should happen after summing, I suspect the playing and summing of individual already-distorted string sounds was done because that's what could be implemented simply and easily. Applying distortion after summing may well require more extensive coding, or stuff that's computationally intensive enough to slow down the browser (I don't know this for certain, I'm guessing).

I'm not faulting the author for this, I probably would have done the same.


Now that I type this out, I find myself curious just how much work it would take to implement a software-modelled distortion in the browser. I guess that's another entry for my list of "Hey, wouldn't it be neat if I could do $FOO" type projects.


Not actually that hard. You want a WaveShaperNode. Of course, tuning the curve and other parameters so it sounds _good_ is nontrivial.

[1]: https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperN...


Thanks for this great feedback. I hadn't considered the difference between distortion in each of the strings vs applied overall, but that makes sense.

[edit] as korethr described above, I chose to implement it this way because of the samples that I was working with


When tuning by making the open strings beatless, it's useful to know that tuning an interval until the beats disappear isn't the same as tuning to the equal tempered standard.

A just 4th (4:3 frequency ratio) is about 2 cents flat of an equal tempered 4th, and a just major third (5:4 frequency ratio) is about 14 cents flat of the equal tempered major third.


Nicely done. One correction: the sound(s) that arise from two different notes sounding together are sum and difference tones, not overtones. Each individual tone has a collection of overtones (i.e. the harmonic series), and those and the fundamentals can interact to produce an audible beat when they aren't in tune, which can be the sum or difference of two frequencies that are almost but not quite in sync with each other.


If you don't have perfect pitch and want to get a better understanding for what your guitar is doing, try using a spectrum analyzer app to visualize how the sound changes as you pluck a string.

The el-cheapo guitar I bought once just didn't hold the note very accurately over time (i.e. pluck string, then it would vibrate at the correct-ish frequency for ~0.5s, then quickly veer off).

Had to use a spectrum analyzer since the guitar was so out of tune that the electric tuner couldn't even pick up which string it was...

(wasn't my idea to use the spectrum analyzer, back in college a friend of mine tuned his dorm piano - which are much harder to tune - using that technique, worked quite well)


> back in college a friend of mine tuned his dorm piano - which are much harder to tune - using that technique

I feel as though "much harder" to tune understates the difference between tuning a piano and a guitar considerably :P

It's ~40x as many strings!


Um, I'm not so sure about that. Sure, there's a lot more strings on a piano, but they're all separate from each other, and once one is tuned, it's tuned and you can move on to the next one.

Try tuning a guitar that has a Floyd Rose locking tremelo system. The bridge is floating on a pivot with springs, so the tension of the strings is collectively working against the 2 or 3 large springs on the bridge. So every time you tighten or loosen one string, you're changing the tuning on the other 5! And adjusting intonation is a pain too, because if you finally get the strings all in tune, then when you adjust one string's intonation, it throws off everything again. (And worse, to adjust the intonation on a Floyd Rose, you have to completely loosen the string so you can get to the tiny little hex screw to unlock the intonation adjustment, and the way it's designed you don't really have an easy way of fine-tuning it.)


Pianos are like that too. There is a LOT of string tension, and the soundboard warps. Raising the pitch requires carefully balancing by tiny adjustments in several passes.


And you physically cannot get a piano tuned perfectly, since with different intervals, you'd need individual notes to be tuned slightly different.

With a guitar, you can at least still try to correct it by putting your finger down somewhat closer or farther away.


> With a guitar, you can at least still try to correct it by putting your finger down somewhat closer or farther away.

Does not work like that. It isn't a violin.

It is possible to pull notes sharp slightly (but it's done with pressure, not finger placement), but if the note is already sharp, there's nothing you can do.


Move one fret flat and pull very sharp? (no, this is not practical, but the inexperienced should give it a try...)


> The el-cheapo guitar I bought once just didn't hold the note very accurately over time

What do you think was moving on that guitar? Was the neck bending?


This is really neat and well crafted!

Constructive feedback:

After you tune the guitar and hit the 'play a lick', the notes ring on too long. I'm not sure how you've configured your sound generators, but you'll need to configure an envelope on the sound that cuts it off before the next note rings. This would come down to simply adjusting the 'release' parameter to be very small (though not zero) so that the sound decays quickly before the next note begins.

Also, after that, in the paragraph under "How does it work", the statement "Guitars generate noise through the vibration of their strings" is a little bothersome. While this is true, it would be more correct to say sound (or even pitches) instead of noise. The technical meaning of noise is a random distribution of frequencies across the sound spectrum, and actually sounds like the static you hear when you're radio is not tuned into a station. It's somewhat true because a guitar string will generate a quick burst of noise after being plucked, but after that the string settles into a resonating cycle that follows the harmonic series, which is definitely not noise.

Third nitpick... oh man, I'll try to be brief, but I would just take out the section on beats and 'overtones'. As elihu mentioned, its actually 'difference tones'. Overtones are a part of a single sound. I would take the part out because it's actually bad practice to eliminate beats when tuning a guitar using open strings (in other words, tuning by perfect fourths) because the frets of a guitar are tuned to 12 Tone Equal temperament. If you eliminate the beats in a perfect fourth it will be a Justly tuned perfect fourth, which is 498 cents. An equally tempered perfect fourth is 500 cents even. The result would be the A string will be 2 cents flat, and then the D string will be 4 cents flat, and the G string 6 cents.. etc. If you want to keep the part about beats and tune by ear, its better to play the A on the E string and tune using a unison. Then you can use the beats trick!

Disclosure: BA in Music with emphasis on Guitar and Sound Design. (See, BA's aren't completely useless!)


I kind of wish the "lick" would've been playable with the untuned guitar. It'd be fun to see the difference you make by tuning it.


not sure if I miss something, but I haven't figured out how to use the tuning knobs :( I tried mouseover, click, click+drag, in vertical and also in horizontal direction, but the tone didn't moved in any direction.


I agree that using the tuning knobs was not very intuitive. I guess that you're supposed to click on the knob, hold it down, and move up or down to tune -- but there was no feedback (except from the sound, which changed slowly.)


Slightly off topic, I love how I am seeing tone.js pop up in projects everywhere. MIDI and VST's have created an extraordinary universe of musical devices but I think a wave of little web-based generators and effects will allow some truly novel approaches to music and audio arts.


Very nice. In the spirit of constructive feedback: if you want to properly simulate a guitar that is out of tune because it has been stored for a long time (to better match your initial storyline) the high end should drop more than the low end.


This is good feedback—I thought the same thing. It would be a lot more realistic this way.


This needs some visual feedback when you try turning the knobs.


I've been a guitarist (off and on) for 30+ years, and I'm oddly fascinated by tuning methods and practices.

The best educated guitarist I've ever known (he was an LA studio guy who moved back to my home town to raise his family and was teaching at the high school for fine arts I attended...literally everyone here has heard songs he played on, and probably a few musicians he's taught) used a technique I haven't seen very often, but it's been my favorite method. It's based on chords and the naturally occurring "beating" when intervals in chords are "right". Basically, you're switching back and forth between perfect fourths and fifths across all the strings and finding the best balance between them; when the beating is minimized, your guitar's first position is about as well-tuned as it can possibly be, given the limitations and oddities of intonation on a fretted equal-tempered instrument and the different sizes of strings. This is how I tune, unless I'm going to be playing way up the neck, in which case I tune with an alternate further up the neck to accommodate that position better.

The interesting thing about this, and the thing that always confused people who see me tuning is that overdrive/distortion makes this method work better, not worse. It exacerbates the beating and makes it more clear when you're tuning it right.

James Taylor devised a system that accommodated the way lower strings tend to rise in pitch when strummed aggressively; he'd tune a tiny bit flat on the low strings, getting close to on-the-nose as you went up the strings until the high E was exactly right. You would adjust this method slightly based on gauge of strings and whether the G string is wound or not. In this way strumming hard wouldn't end up sounding sharp on the bottom and out of tune across the instrument. This seems like a pain in the ass, to me, since you need a tuner and to memorize the settings across the neck to get it exactly right, so I have only done it as an experiment. I couldn't hear a positive difference compared to my usual method of tuning with chords (which already accommodates the sharpening of low strings because we're tuning to chord shapes).

A common method I've seen maybe most often, especially among metal guitarists who tune down and bass players is the harmonics method (5th and 7th frets of strings next to each other). This has the benefit of bringing the tuning notes up into a higher register where our hearing is more accurate. Distortion doesn't hinder this method either, so rock guys can do it without changing their amp settings or whatever. But...and this is a big but. This isn't actually a great method for getting good tuning, because it will be the natural harmonics of the strings, which aren't exactly the same as the notes on an equal-tempered instrument. This was the method I used when I was a kid. The traditional fifth fret (and fourth fret) method, that is the first method most guitarists are taught, is still better than this one, because it accounts for equal temperament.


I only think I get what you mean by "beating", could you clarify for us/me? I'm thinking of the particularly sonorous pulsing you sometimes get when playing those intervals.

Having played guitar from a really early age I'm pretty lucky to able to get tuning pretty much bang-on from ear, plus some double-checking it still sounds okay further up the neck. The main downside is that the open G string never, ever sounds right.


Do you have a guitar or other stringed instrument handy? I can tell you how to produce beating: Play a perfect fifth (open B string, second fret high E string, for example), and listen as you turn the tuner slightly up and down.

When the fifth is in tune, it will sound uniform. When the interval diverges from a fifth you will begin to hear a pulse, a sort of wobble...slow at first (when very close to the right pitch) and faster as they get further apart (and then, eventually, if you go far enough in any direction the beating will get slow and stop again as you approach another perfect interval).

To visualize it, you can maybe think of sine waves at certain frequency ratios of each other (a fifth is a 3:2 ratio, fourth is 4:3, octave is 2:1; these are the "perfect" intervals that don't audibly beat when played together, and are not considered at all "dissonant"). The phase cancellation between this is regular enough and frequent enough and not complete so we don't perceive it as beating, but as a specific singular sound of its own. Most people aren't hearing two independent notes when hearing these intervals, though people with some training or with perfect/absolute pitch can recognize it for the combination of notes that it is.

But, as they drift out of tune, the phase cancellation happens in a shifting pattern up and down, so you end up with very clearly audible changes; this is called "beating" (at least, that's what I've always called it, and I believe it is the proper term in physics, audio research, and music...pretty much anywhere we talk about the phase of waves, I think?).

Here's a page with some diagrams of the basic idea of what is happening and what you're hearing, as well as audio samples of what it sounds like (it's more complex with the complexity of a guitar's timbre, but the principle is the same): http://www.animations.physics.unsw.edu.au/jw/beats.htm


It's interesting you mention "beating". I've heard of, but not actually seen in action, a method where a piece of paper is placed on the strings with the guitar on a flat surface. If the guitar is strummed and the paper falls off it is out of tune, if it stays on it is in tune. Now you also need to hold certain notes down whilst you do this. I don't know what they are. And this might be a myth.


I've never heard of this, but it might work on an acoustic guitar. Solid body electric guitars are sonically pretty much dead (maybe if you put the paper on top of the amp or a flat surface near the amp).

I just tested, and the results were inconclusive. Maybe I was doing it wrong, but there was nowhere I could put the paper that would result in movement when out of tune but not in tune. If I put the paper on the sound board with the guitar laying flat on its back, the paper didn't move much in either case; just a little bit of vibration/rattle. If I put it across the strings, it would fall off whether in tune or out (as I would expect, but I figured I'd try all the obvious options).

Perhaps I just don't know the proper chordal incantation, but I assume some combination of fourths and/or fifths or octaves, since those are the ones that will be very consonant/smooth/non-beaty when in tune and will beat very clearly when out of tune even a little bit.


For the low B on my 7 string, I get better intonation and tuning results by using power chords up and down the neck with distortion on rather than relying on a tuner. Fretting tension and picking intensity becomes a huge factor with low tension and high string gauges.


Yeah, tuning in fifths makes sense because you're playing in fifths. It also lets you bring it up into a register you can hear clearly (and the beating will be audible even in the lower registers, especially with distortion). The short scale of a guitar makes going really low challenging, and you'll have more of the sharpening due to heavy picking.

When I played metal and tuned the whole guitar down to D or C# (this was before 7 strings were really a thing), I still used the stacked fourths and fifths method of tuning and it worked for that, too. Since you can strum at normal playing intensity when tuning this way, you can accommodate whatever you're normal playing style is.


I'm intrigued. Any video of this method?


There is video of the James Taylor tuning method on YouTube, by James Taylor himself. His way depends on using precise digital tuners for repeatability. I came to similar conclusions years ago, by ear, before discovering his video, and I still do it by ear, because every guitar is a little different. Modern Peterson strobe tuners and some others have "sweetening" modes that produce a similar outcome.

The end result is that the strings get increasingly flat as you go down, with the low E quite flat (like 18 cents or something). I like doing this by ear, because it varies by guitar, and also by tuning - I often use non-standard tunings, and modal tunings want a different sort of sweetening due to the octave and fifth relationships.


I just tried to find a video of it, and couldn't...but, it's hard to search for "tuning guitar with fourths and fifths" because it brings back information about various kinds of tunings for guitar rather than using it as a method for tuning.

It's kinda weird; I assumed it was something common, but now that I think of it, I don't think I've ever seen anyone use it that didn't learn it from that same teacher or from me. The professor who taught it to me was a teacher at University of Miami during the Jaco/Metheny era in the early 70s, toured with Bruce Hornsby for a few years, and then worked in LA as a session musician for a couple of decades (he was never famous, but traveled in famous circles), so I assumed he got it from one of those places and that it would be kinda common knowledge.

I should dig into this more, and if it's not common knowledge somewhere I should make a video (and a cult) about it, because it's really the bee's knees, IMHO. It's super fast to use, once you've got good ears for it, and it results in any guitar, even those with poor intonation, being at least playable for basic chords and such in the first position.

It isn't really complicated. You can derive it from first principles of just knowing that fourths and fifths and octaves are perfect intervals, and then just make chord shapes that are all fourths and fifths and octaves of any other note being played and walk them up and down across the strings until you've got no beating (or as little beating as is achievable, if the intonation is poor). By the time you've gone up and down a couple of times, you're pretty well locked in and it sounds great. Even if you don't have an ear for fourths and fifths, you can still use this to "tighten up" the tuning on a guitar by doing the usual fifth fret/fourth fret tuning that every beginner book or class teaches first and following up with this method to come to a reasonable compromise with the intonation of the guitar and the oddities of wound vs unwound strings (the fourth/third or third/second string changeover is always a bit tricky even with a compensated bridge).

Anyway, I'll keep poking at the google to see if I can find this method documented somewhere, and if not, I'll write it up and make a video. It really should be more commonly known/used now that I think of it.

Edit: This Stack Exchange thread includes people who do either fourths or fifths tuning, which is close to what I'm talking about, but they never quite get to stacking up fourths, fifths and octaves in a few chord shapes (which is where, I think, the magic for compensating for intonation problems comes from). https://music.stackexchange.com/questions/3078/what-are-the-...


If you post a video, please let me know, thank you!


Guitar pedant: Shouldn't the up/down on the tuning keys be opposite directions on opposite sides of the headstock?


Yes, although I think this application/audience warrants visual consistency over realism.


Knowing how to tune a guitar (bass, etc) is one of the first thing any player should learn, but next to it are recognizing that your guitar is out of tune and how to make sure you don't have to retune it every 5 minutes. The first comes with practice and musical training and the second requires a good knowledge on how to mount strings. A string fixed the wrong way will force the player to tune at every song or more often, so learning how to put strings in place is vital. There is a self-locking technique well explained in youtube videos; look for it because it will come very handy.


Really cool. Audio didn't work for me on chrome though


Sorry to hear about the audio issues! I tested on chrome and macOS, and didn't encounter anything like that. I'm curious what OS you're using, or maybe its just Google's new 'smart' autoplay policy.


It absolutely is that. I experienced the problem, captured

    options.context = new window.AudioContext();
from index.js at line 224, and then just bound a user-action (I went with document.body.addEventListener('click')) and used that to call options.context.resume().

After which point, it was cool. =)


Looks like Google Chrome 66, and on windows 7. I'd wager it's the new auto play being funky.

Went to firefox instead and was able to go through it. Again, very cool. =)


Not OP, but chiming in to say that on Waterfox on Windows 10, the initial guitar that is supposed to be out of tune is perfectly in tune (I'm a guitarist and it was obvious). I scrolled down to the tuning part anyway, and moving the knobs changed the frequency display but never changed the sound of the string being tuned.


The "Play notes with a 5.00 Hz difference" section seems like a massive leap from the section before, without the same level of explanation that preceded it. I can't perceive/work out what they are talking about - I'm not sure what I'm listening for. Could be because of my freaky Asperger's brain wiring tho.

I learning to play electric guitar, and have wanted to learn to tune by ear for ages. It's frustrating that I was able to follow along with ease up to this point, but now feel I've been pushed in at the deep end. It's just so close but not quite there.


I still have a tuning fork for tuning by ear. When I started playing, electric tuners were somewhat new and relatively expensive. At this point I've used the fork enough I almost don't need it.


This is fun and educational. Good work. I think you should take 5m to line up the tops of the strings and fix the string spacing in the zoomed-in headstock image. It looks sloppy at the moment.


Very cool indeed! Doesn't work in Chrome 66 anymore, due to blocked audio: https://www.dailydot.com/debug/chrome-autoplay-block-games/


I get errors on Safari (latest public version as of a few days ago):

First an alert: "It looks like Chrome audio autoplay is giving us troubles. Close this and tap the loading bar to continue loading audio."

Then "undefined is not an object (evaluating 'new Tone.FFT')" where I'm guessing some kind of media is supposed to go.


fun page. i tune my guitar differently, but same principle. i put ON distortion, and then pluck harmonics on different strings. if they are out of tune its really obvious due to the phasing, and you can adjust it untill it sounds like a clean note. same principe but much much easier / clearer to hear if it's exactly in tune with another string.

also if you tune, always tighten last. if you release tension then it might shift a little and be in shitty tuning again. if you tighten the last then it;s less chance of this de tuning suddenly while playing.

you can tune all strings using harmonics on the 5th/7th frets, where g/b set will need 4th / 5th fret or so. al the notes you need across the strings are around those frets anyway and it;s really easy to hear if you have the right ones.


Hmm... I get no sound on chrome for some reason. Works fine on FF.

_edit_

See kmm's comment, chrome seems to be intentionally blocking it.


well. while using some dsp to get the frequencies right makes sense from an analytical point of view, from a more mood oriented standpoint which seems more aligned with the nature of music and its associations with mood it makes more sense to tune a guitar without any measurements using instruments other than your ears in other words tuning by ear while this is an inexact science and in theory, each tume you tune your guitar it will by definition be alightly out of tune the true test would be whether you like the sound or not given this as a goal, how you tune your guitar, would depend on what you were planning to play. you would probably tune your chord progressions


Reminded me of my high school physics project on tuning a guitar using beats on harmonics: https://en.m.wikipedia.org/wiki/Beat_(acoustics)


Somehow this isn‘t working properly for me on my iPhone. It‘s not always clear what parts are touchable, and hitting the right spot is sometimes difficult (eg hitting strings is difficult with my fat fingers)

I like the idea, but the UX on mobile is a bit frustrating.


Recently learned that many digital recorders have a tuner feature while looking for a cheap one for field recordings. Might be worth a shot.


Thanks for asking before downloading 30mb on my mobile connection. Seems this site is well thought out


very cool /aol

add: i'm using seamonkey 2.49.2 and the zooming of the guitar in and out doesn't quite work once in awhile obscuring the text. don't take it as your fault, i'm actually impressed this worked at all.


pretty good, nice execution, and im sure this is not targeted at people like me. but i figure i would add, just for those that are curious: there is more to tuning than just this. how hard you play the strings, where on the neck you play, the relative gauges, what the weathers going to do, the sound you like- all things that make it more complicated. there is also what your bandmates are doing. there are also mechanical factors that make for difficulty in getting the string to make the pitch you want, as other posters noted. i say all this to celebrate the wonderful endless complexity that "simple" things have when they exist in the real, corporeal world. its something i think can be forgotten by people who hang out on a computer mostly.


This looks great.

What technologies are you using for sound and for visualization?


Thanks Mike.

The sound is using tone.js [0] (with a slight modification to make the tuning work).

The rest is built with - idyll (for the overall structure of the post) [1] - d3 with svg and canvas (for the tuner and visualizations) [2] - sketchapp and a plugin [3] to design the guitar

[0] https://tonejs.github.io/ [1] https://idyll-lang.org/ [2] https://d3js.org/ [3] https://github.com/mathisonian/sketch-interactive-export


Good example for chromes autoplay policy breaking the web


I figured chrome would show something saying it blocked yet nothing. That's really the annoying part for me.


Yeah ultimately the feature itself, blocking autoplay, is fantastic. I got so sick of spam bullshit playing videos when I loaded sites. However, it definitely should warn!


I wish more people knew how to tune their beat by ear.


Chrome's new audio settings ruined this for me


<Pedantry>Doesn't take into account neck deformation when string tension changes.</Pedantry>


I usually just play this chord, and then adjust any notes that are off:

E--0--

B--0--

G--9--

D--9--

A--7--

E--0--


super cool. Nice work




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: