Potentiometer capacitor placement

I am designing a PCB with a RP2040 (Raspberry Pi Pico) and a couple of potentiometers (in the form of Expression Pedals).

Am I supposed to place the RC filter to reduce noise close to the potentiometers or close to the ADC pin on the MCU (they are 15cm away on the PCB) ?
Does it make any difference ?

Yes, close to the ADC but it is not critical. the "noise" in question is the irregular change in voltage as the wiper moves across the potentiometer track.

Thanks for your answer.

The potentiometer is actually an expression pedal plugged on a TRS stereo jack, and I get the noise even when the pedal is not connected.
Maybe the capacitor I use is too low? I have a 15nF. Maybe a 100nF would be better?

A 'floating' pin is generally speaking a bad thing, and the A/D will return random values (noise).
You should connect the A/D pin with a high value resistor (1Meg) to ground (or to VCC).
Leo..

Yes too low, 100nF is better. Make sure it is a ceramic capacitor or it won’t work.