First a caveat: I'm not an audio guy, so I don't know what the connection is supposed to accomplish, but I'll take it at face value that you want a number of lines with different resistances to ground, and you want to be able to disconnect them from that ground, which would result in a high impedance state.
GPIOs can be set one of three ways, logical high, logical low, and floating. The first two are output states, the last one is the input state.
Logical high -- when the pin is at ~3.3V -- may or may not be of use here, but probably not. Logical low definitely is, because it is the equivalent of ground, 0V. Beware that this means you can short through a GPIO set as a low output (the fact that this is an "output state" may be a bit confusing, since you will be sinking current to it).
There's only one input state, floating, because the major purpose of an input is to be sensitive to voltage changes. Without external influence, the voltage of the pin floats around. A characteristic of this state is that it is high impedance; I can't give you an exact figure, but presume it is too high for any significant amount of current to flow (unless you apply too much voltage), much like literally disconnecting a wire (where with enough voltage and the right circumstances a route to ground may include a "disconnected" wire, e.g., then through the air brightly to earth, but this is not our context).
So, if you want to programmatically control a route to ground and only a small amount of current is involved, you can do it by toggling a pin between an output driven low (= to ground) and an input (= disconnected).
A "small amount" here means <= ~20 mA; you may get away with a bit more. You will have to apply Ohm's law using the voltage from the preamp and the resistors you want to use to see if this can safely be done with a Pi.
If not, you can control a route to ground with a transistor using a GPIO.
simulate this circuit – Schematic created using CircuitLab
If you never look at schematics, the arrangement on the right is a BJT transistor and the squiggle up top a resistor, so it is clear we are not toggling a short circuit.
This is simpler in the sense that it's more intuitive, because you have a external physical connection to ground, and you control the transistor in an obvious way: Set the GPIO as an output, toggling it high connects the circuit, toggling it low disconnects.
However, there are some complications with regard to what a transistor will do to a signal passing though and I suspect in this case you should prefer the no transistor, ground through the GPIO method -- but again I'm not an audio guy.