It's a standard fact that to calculate integrals of the form $$\int_{0}^{2\pi}\mathcal{R}(\cos(\theta),\sin(\theta)) \ d\theta$$ with $\mathcal{R(x,y)}$ a rational function in two variables without poles in $\{x^2+y^2=1 \}$ one can use the method of residues thinking this integral as $$\int_{\partial D} \frac{1}{iz}\mathcal{R}(\frac{z + \bar{z}}{2},\frac{z - \bar{z}}{2i}) \ dz$$ where $D$ is the unit disk. Also, obvious modifications can be made to calculate integrals where the arguments of the trigonometric functions are not $\theta$ but $k \ \theta$, $k \in \mathbb{Z}$.
The question is, what happens if the arguments are things like $\pi \theta$? For a concrete example let's think about $$\int_{0}^{2\pi}\frac{1}{2 + \sin(\pi\theta)} \ d\theta$$ In this case, the integrand is a continuous function of $\theta$ on the bounded and closed interval $[0;2\pi]$ and so the Riemann integral exists. But if we try to do the trick as before, putting $$\sin(\pi \theta) = \frac{z^\pi - z^{-\pi}}{2i} $$ when $z=e^{i\theta}$, we are then prompted to consider a branch of the logarithm. Say we took the principal branch. The problem now is that we cannot use the residue theorem because of the infinite number of singularities that $$\frac{1}{iz}\mathcal{R}(\frac{z^\pi + z^{-\pi}}{2},\frac{z^\pi - z^{-\pi}}{2i})$$ has in $D$.
So my question is, what can be done to compute integrals like $$\int_{0}^{2\pi}\frac{1}{2 + \sin(\pi\theta)} \ d\theta\mbox{ or }\int_{0}^{2\pi}\frac{\cos(\sqrt{2} \theta)}{4 - {\sin^3(\pi\theta)}} \ d\theta$$