The real answer is they are all involved in the distortion, but each one has a different effect. There is a lot you should understand about distortion in guitar amps that the huge majority of guitarist don't, (and don't want to be told about
). So let's look at some engineering truths and bust a couple of myths. Believe them if you choose to but what is incorrect is incorrect. The laws of Physics will still apply.
Firstly, just changing a valve in a stage often does not alter its gain. Gain stages are designed to utilise negative feedback (NF). Even the ones which guitarists believe are designed to not have NF as it "sounds cramped" and other such stupid beliefs use it to stabilise their DC point. You mess with it at your peril! One of the effects of NF is to reduce gain in a stage and one of the effects of that is that, as the circuit components are used to set the gain of the stage, the gain produced by the valve (as long as it is significantly higher than the gain the feedback asks for) becomes irrelevant in the setup. NF takes over control of gain so even putting in a valve with twice the gain of the original, (if that were possible and it usually isn't), would not increase the stage gain by any real amount. That's the Feedback Principle at work. That's FACT. If you increase the gain the valve produces, the clamping effect of NF on stage gain becomes tighter and more accurate. If you reduce the valve gain (valve's don't really have a "gain" at all), you then reduce the effect the NF can exert and the gain will drop more and more significantly. If, like me, that is the way you want to go that is a good thing. I'll refer back to this later on when I talk about "valve equivalents"
.
Second, there is no difference in the frequency response between any particular makes of valve of any one type. That can be easily and clearly shown on the test bench and is absolutely true! Valves are manufactured to a tight specification. In there is the requirement for a particular frequency response. ALL 12AX7s MUST STICK TO THAT FREQUENCY RESPONSE OR THEY CANNOT BE LABELLED 12AX7s. It is flat until way above any audio frequency and into the RF regions. The valves we use for our guitar amps were actually designed as Radio Receiving valves well before guitar amps were even thought of! What differs is the way the valve goes into overload as that is an "outside the spec" condition and they can sound slightly different at that point, but the effect is MUCH more subtle than the sellers of valves and the guitarists who want their "golden eared guru" status confirmed would have you believe. If someone has an agenda to push, like making money for selling you something, do you just take their word for everything they tell you? For anyone who doubts this I can show you frequency response curves for all of the major valve company's 12AX7s in the same preamp circuit and you will see, they are all absolutely the same curve with just slight variations in gain constant over the whole curve and well within the production spread of all of them. These curves were produced by a company actually trying to prove that valves do sound different so are absolutely free of any bias in favour of my point. They prove my point despite them trying to show it is incorrect. You will get MUCH more difference by playing with speaker choices than with valves.
Ok, to the valves in the GM40D. Well the circuit schematic for the GM40D is not out in the wild, but the GM36 schematic is if you just dig around a little. The GM40D is a later version within the same Grandmeister family so should share most of the GM36's circuit configuration. In their basic use of their valves I would bet my hat it will be exactly the same. The following info is based on my intimate knowledge of the GM36. I will assume looking at the amp from the front at all times.
The first one, the one on the right at the front under the aluminium cover, is the input valve and its following second stage. The 12AX7 has two separate triodes inside it. These are usually used independently to create two individual gain stages. Change that valve and you change both stages. In our amps the first stage is a basic highish gain stage while the second is a low gain stage (3x). In Clean only the first of its two triodes is in the signal path with the other one out of circuit and not used. In all of the other channels the first triode feeds the second so giving more gain to hit the third final gain stage. The gain of the first stage is altered when in Clean/Crunch or in Lead/Ultra mode. Changing that valve could affect distortion most aggressively. The reason for that being its overload distortion is then amplified by the other stages afterwards.
The second one, the one in the middle of the front row, is the next preamp stage and its follower. The first triode in that valve is a simple gain stage whose gain changes for Clean/Crunch and Lead/Ultra. The second stage is a Direct Coupled Cathode Follower (DCCF). This is a stage with a gain of 1x, (yes that is 1x, it's a "follower" and that means it has 100% NF so the valve's gain is virtually irrelevant). The DCCF is used because it has much stronger drive capabilities than the usual gain stage. It buffers the gain stage in front of it from the tone controls which it drives and which would load the gain stage down. If it is set up correctly, and H&K do set theirs up well, it produces its own particular type of distortion which is mainly even harmonic, often considered to be the "musical" distortion type. It is often used to sweeten up an otherwise harsh amp.
The third valve, in the front row on the left, is the Phase Inverter (PI) or Phase Splitter. This valve is often a "balanced" one for reasons which will be obvious. This valve has the job of taking the single input signal and splitting it into two exact opposite signals, one being the exact copy of the other but upside down, to feed to each side of the output stage. Both triodes in the 12AX7 are linked together in a particular way by which they take in the one input and each gives out equal but opposite outputs. Hence the balanced selection for the valve for those who like that approach. A change of this valve means a change to both parts of the circuit, presumably equally.
The 4 larger ones in the back row are of course the output valves. These will distort dependent on the signal fed to them from the PI and again will have less effect than the first two valves.
The whole power amp circuitry, PI and output valves, is normally inside another feedback loop which goes from the output back to the input of the PI. This means the gain of the power amp is a combination of the PI gain and the output valve gain and is going to be considerably less than those two multiplied together. Remember, that is one of the things NF is brought in to do. The negative feedback prevents the PI valves' gain from having too much effect on the overall power amp gain.
I'm not sure from your post what you are actually trying to achieve. If I assume you want to increase the distortion then you are out of luck. Other than sourcing high gain selected 12AX7s or EL84s there is no other way to try to play with it without changing other circuit components. Even putting in selected high gain items will not have much affect at all as the negative feedback is solely responsible for the gain of each stage when the gain of the valve inside is high enough. The higher the valve gain the more the negative feedback limits the stage gain. And also, putting in a higher gain valve would mean that NF will actually reduce distortion more when the signal level is below overload. So the parts of your signal which are not being clipped at any gain will be cleaner than before.
If you are trying to reduce distortion then you are in luck. You can alter that slightly.
My own advice here is, DO NOT UNDER ANY CIRCUMSTANCES SWAP A 12AX7 OUT FOR A 12AT7/12AU7/12AY7. THESE VALVES ARE IN NO WAY EQUIVALENTS. If you do swap them out for each other you will screw up every aspect of the circuit which the designer has spent many hours working out and implementing and you may even make the amp unstable or prone to breakdown. They are
***NOT*** lower gain equivalents as people will insist on describing them. They are totally separate different valves designed to perform totally different tasks which just happen to have similar number code designations. For example, the 12AW7, presumably meant to be another member of "the TUVWX family", is actually a single pentode not a dual triode, a totally different class of valve completely, and does not even fit into the same socket. It would require a complete redesign of the stage to run one of them correctly in a 12AX7 stage. I know the implications, I have been involved professionally in circuit design for over half a century. It's like putting a Honda Civic injection system on a Ferrari to slow it down for town use. How much stress do you think the Ferrari is put under by having a "lower power" injection setup strapped to it which it was not designed to match? It may work, but definitely not well, and perhaps not for very long. You choose to play with that approach at your peril.
There is an alternative. If you want to drop the gain of a stage (slightly), you can use the only other valve which is a genuine close equivalent to the 12AX7. This is the 5751 which has an amplification factor or "mu" of 70 to the 12AX7's 100. It isn't a deliberate low gain version but it happens that the other parameters of the valve are a very close match to the 12AX7, enough to not throw a stage design out of kilter when used in place. I use a 5751 in my own first gain stages of my GM36 for my classic rock (60s/70s). It doesn't drop the gain out of sight, (remember NF rules), but it does give a more "dial-in-able" distortion spread across the gain pot to me.
There you are. There should be enough info there to get to grips with your issue, whichever way you want to go. I would recommend you go out and check any of this which interests you for yourself. Others will definitely disagree with my position vehemently. However, my claims are all based on things I can demonstrate working in the workshop and on the data, curves etc that I can collect and show afterwards. Theirs is down to "my golden ears tell me and they can't be wrong". Well, the ears are incredibly easily fooled. At times they even fool themselves.
If you need more info just ask. I can prove every point I have made here independently of my own work. If not then good luck with your valve swapping.