it's not "modern", but if done right, correlation methods are quite robust. i personally like Average Squared Difference Function (ASDF)
$$ Q_x[n_0,k] = \frac{1}{2L+1} \sum\limits_{n=n_0 - \lfloor k/2 \rfloor - L}^{n_0 - \lfloor k/2 \rfloor + L} \left( x[n]-x[n+k] \right)^2 $$
but the more familiar Average Magnitude Difference Function (AMDF)
$$ Q_x[n_0,k] = \frac{1}{2L+1} \sum\limits_{n=n_0 - \lfloor k/2 \rfloor - L}^{n_0 - \lfloor k/2 \rfloor + L} \Big| x[n]-x[n+k] \Big| $$
might be more to your liking.
$x[n_0]$ is the middle of the neighborhood of samples where you are determining the pitch. $2L+1$ is the number of terms being averaged. you probably do not need to divide by $2L+1$ if you don't want to, since the values of $Q_x[n_0,k]$ are relative to each other. $\lfloor k/2 \rfloor = k/2$ for even $k$ and $\lfloor k/2 \rfloor = (k-1)/2$ for odd $k$.
look for a value of $k$ that minimizes $Q_x[n_0,k]$. you will likely want to interpolate around that integer value of $k$ to find a fractional value that is the "true" minimum. i usually just use simple quadratic interpolation. if $Q_x[n_0,k_m]<Q_x[n_0,k_m-1]$ and $Q_x[n_0,k_m] \le Q_x[n_0,k_m+1]$ then the interpolated minimum (and a candidate for the period) is
$$ P_m = k_m + \frac{1}{2} \frac{Q_x[n_0,k_m+1] - Q_x[n_0,k_m-1]}{2Q_x[n_0,k_m] - Q_x[n_0,k_m+1] - Q_x[n_0,k_m-1]} $$
if the input $x[n]$ is extremely periodic, there might be many values of $k$ that locally minimize $Q_x[n_0,k]$ because
if $x[n+P]=x[n] \quad \forall n$
then $x[n+2P]=x[n]$ or $x[n+3P]=x[n]$
and $Q_x[n_0,P]$ or $Q_x[n_0,2P]$ or $Q_x[n_0,3P]$ are all equally minimum (and close to zero). so then usually you want to pick the minimum that has the smallest $k$.