But no matter what, transistors switching off and on will always make huge amounts of high order distortion.@kosst_amojan
It doesn't work that way IME. What makes distortion in a class D is how well the encoding scheme works. For example if PWM, any offsets generated by the comparator (or otherwise) can cause distortion. This means you have to be careful in such a circuit to block any DC that might come from your triangle wave generator- and in that circuit, the quality of the triangle wave is pretty important too.
Its not uncommon for the encoding scheme to have troubles at lower levels. For this reason I prefer PWM as its problems are more likely to be at higher power levels rather than at low levels.
Each encoding scheme has its upside and also difficulties! But the switching of the outputs themselves do not contribute to distortion, which is a major advantage of Class D, since the operation of class A, class AB and B this is not the case.