You may be able to do that with Arduino or Raspberry Pi Pico (or any Raspberry Pi) and neopixels (which I think are strips of Led lights and a potentiometer so when that is turned the number of LEDs that come on is bound to the position of the potentiometer (POT.
Pots can be either rotary or linear I think in terms of their physical appearance.