I'm trying to replace an analog pot with a digital one for the volume control in a guitar amp. I have a digital pot - MCP4141 put instead of the analog one. However, checking on the oscilloscope seems like "zero level" is in the middle of the signal, so everything below this level gets cut off. How could I "move up" whole wave above the ground level? Does have to be a resistor put between "B" and ground? Or something else?
None of the 'pot' pins can be allowed to go (much) beyond the power supply voltages.
If you have a digital pot with 0/5V supply you need to keep the voltages within that range. Since you are dealing with audio signals, they are AC, and you could bias the input at 2.5V with a couple of resistors and your coupling capacitor, so that the analog input (and output) sit at +2.5V (thump on start-up). Or use +/-2.5V supplies. And make sure you never get too much input amplitude or you could destroy the chip.
It's often not that easy to replace a pot with a digital pot in an existing circuit- you end up redesigning.
There are some digital pots (eg. AD7376) that will work with relatively high and bipolar supply voltages, while retaining digital inputs referenced to ground but they tend to be relatively expensive. Depending on the function, you might also do much better with a log taper digital pot in an audio application.
You can see from the absolute maximum ratings that the pot terminals are unipolar, so it doesn't look like it will support negative input voltages. Adding a series resistor won't help because the input voltage is going negative regardless. You would probably need to find a bipolar pot. I think this might be a candidate: https://www.maximintegrated.com/en/products/analog/data-converters/digital-potentiometers/DS1808.html
This might also be useful: http://www.diyaudio.com/forums/solid-state/87408-digital-potentiometer-bipolar-signal-question.html
according to the device data sheet, the potential to any input pin A or B will be between VSS to VDD i.e 0 to 5V, so you need to level shift the voltage applied to A input and DC couple the signal at wiper output to use the full voltage range
Refer to solution for using the level shifter answer