the bridge.
on modern stick bridges you'll notice that the saddles (the parts that receive the strings) can move back and forth thereby lengthening/shortening the string as needed.
since the frets are fixed position, what we do is alter the length of the string to match up with the frets.
OK, if you get flat going up (in pitch) a string -- it would mean that the frets aren't "eating up" enough string (making it short enough) or - in other words, the string is too long for the frets.
so we need to shorten it.
but by how much?
well, the old trick is to use a point of physics - the "harmonic". a harmonic in this case is where we touch the string (without fretting) to create a node (a stop point) not with the fret, but just relying on natural resonances. This is fixed by the physics of the string - so we can use it as a reference point for the frets.
here's a guitary explanation
https://www.youtube.com/watch?v=8dXhFWmooHwhere's sort of a physics explanation
https://www.youtube.com/watch?v=RUpjYDteYcgnow the one we are interested in is the 2nd harmonic (the 12th fret harmonic) which happens at the half way point -- since an octave is
a doubling of frequency, that the octave
so basically what we want to do is match the 12th FRET note (which we can change by moving the bridge saddle, changing how much %-wise the frets eat up the string) to the fixed 2nd (12th fret) harmonic
now these are very fine adjustments,so I'd strongly suggest using an electronic tuner.
You can see Greg Howard walking through this
https://www.youtube.com/watch?v=v1ZLQG4_A3c&t=285sthe intonation adjustments start about 15:00