It has nothing to do with Hz (which is the meassurement for frequency) because a waveform has no frequency as long as you don’t know at which speed it’s sampled and/or played.
A cutoff at 512 Hz would be only suitable if you assume a tone frequency of 1 Hz (not very realistic), sampled with 4096 samples per second.
This brings us nearer to the problem!
If you want to sample the waveform of an available instrument, you should do that at a sampling rate that is 4096 times a multiple of the lowest subharmonic tone of that waveform … BUT none of the notes of a normal instument fullfills that requirement for any usual sampling rate.
And even if you sample at 96000 k you would need a tone below the lowest key of an 88 key piano keyboard.
If you sample at 192000 k you would need a tone with 46.875 Hz (F#1/Gb1 = Fis1/Ges1 has 46.2493), cut out a full wave (should have 4151 samples for F#1), than shrink (= pitch change up) this a little to 4096 samples and then apply a lowpass at 24kHz (1/8 of sampling rate) to make it right.
Because we don’t know if the lowpass respects the fact that we need a circular waveform (without overtones at the jump back) it would be a good idea to sample/cut out at least three full waves (12 454 samples), shrink them to 12288 samples and than after 24kHz lowpass cut out 4096 samples from the middle.
Comment to that “jump back overtone” issue:
Not only steps have overtones. Even a sharp bend has audible overtones too!
Alternative way (if your hardware support custom sample rates) that prevents shrinking and sample calculations):
sample an A0 (lowest key on piano, 27.5 Hz) at a custom sample rate of 112 640 “Hz” … gives you exactly 4096 samples per wave! … and than lowpass it at 14 080 Hz (14kHz would be near enough).
The FIR filter hint was a joke. If you see the numbers in real frequencies, you’ll clearly see that it’s not woth the effort to care about the Gibbs effect for 14kHz overtones of a 27.5Hz tone.
It’s just important to make sure that there is clearly no aliasing from higher overtones.