Pfft - shift specific bins frequency to match

theophile gagnard's icon

Hello,
I am trying to make a device that let pass frequencies that are in a key, and shift the other frequency so they match the key.
The first part is quite easy, but I can't find a way to shift frequencies of the bins properly.
I don't know if if would be better to pitch shift or frequency shit.
I'm basically trying to understand the processing of Pitchmap or chroma.

thank you in advance and have a nice day !