JMC64 I would like to know if it is possible to detect if a jack-plug is connected to an input in Pd.
This really depends on what you connect to the inputs: the input signals are shorted to ground when nothing is plugged in, so if you have something "quiet enough" you won't have a way to detect this.
JMC64 Just checking if env~ > 30 does the trick.
great that this works in your case!