One way to achieve this is to use Fourier state loading, that is by utilizing the fact that QFTs map from the frequency domain to the space domain.
As you've already shown in your example the state
(in the below maths I drop all normalization constants)
$$|\psi\rangle = \sum_i^N \sin(2\pi i k/N) |i\rangle$$
is dual to
$$QFT | \psi \rangle = |k\rangle + |N-k\rangle$$
In the same vein,
$$|\psi\rangle = \sum_i^N 1-\cos(2\pi i k/N) |i\rangle$$
is dual to,
$$QFT | \psi \rangle = |0\rangle -|k\rangle - |N-k\rangle$$
The problem then reduces to finding any circuit that loads a superposition like this a good solution is given here
quirk link
It’s worth noting that FSL algorithms are always at least $\mathcal{O}(log(N)^2)$ because of the QFT, so in principle it should be ok for most stuff, hope this answers your question :-)