A converter having a DC link capacitor with a center point (b), an upper arm and a lower arm, the both arms comprising switching cells connected in series, each switching cell having a capacitor and a bridge circuit to by-pass the capacitor or to set the capacitor in the series connection, an upper switch connected in series with the upper arm, a lower switch connected in series with the lower arm, the upper switch and the lower switch being connected together and the connection point forming an output voltage terminal (a), and the series connection of the upper arm, the upper switch, the lower switch and the lower arm is connected in parallel with the DC link capacitor, the converter further comprising an upper valve component (D+) and a lower valve component (D-), the upper valve component being connected to a point between the upper arm and the upper switch and to the center point of the DC link capacitor and the lower valve component being connected to a point between the lower arm and the lower switch and to the center point of the DC link capacitor, the valve components being arranged such that the upper valve component allows current from the center point of the DC link capacitor towards the upper arm and the lower valve component allows current from the lower arm towards center point of the DC link capacitor, wherein a current path through the upper valve component and/or the lower valve component comprises inductance to form a resonance circuit, wherein the converter is characterized by comprising a controller configured to: obtain a voltage reference, determine the number of switching cells required to obtain an output voltage corresponding to the voltage reference, connect the determined amount of capacitors of the switching cells to the current path for a determined on-time (T on) period, and after the determined on-time (T on) connect capacitors of all the switching cells to the current path for the duration of a blanking time (t b). a DC link capacitor with a center point (b), an upper arm and a lower arm, the both arms comprising switching cells connected in series, each switching cell having a capacitor and a bridge circuit to by-pass the capacitor or to set the capacitor in the series connection, an upper switch connected in series with the upper arm, a lower switch connected in series with the lower arm, the upper switch and the lower switch being connected together and the connection point forming an output voltage terminal (a), and the series connection of the upper arm, the upper switch, the lower switch and the lower arm is connected in parallel with the DC link capacitor, the converter further comprising an upper valve component (D+) and a lower valve component (D-), the upper valve component being connected to a point between the upper arm and the upper switch and to the center point of the DC link capacitor and the lower valve component being connected to a point between the lower arm and the lower switch and to the center point of the DC link capacitor, the valve components being arranged such that the upper valve component allows current from the center point of the DC link capacitor towards the upper arm and the lower valve component allows current from the lower arm towards center point of the DC link capacitor, wherein a current path through the upper valve component and/or the lower valve component comprises inductance to form a resonance circuit, wherein the converter is characterized by comprising a controller configured to: obtain a voltage reference, determine the number of switching cells required to obtain an output voltage corresponding to the voltage reference, connect the determined amount of capacitors of the switching cells to the current path for a determined on-time (T on) period, and after the determined on-time (T on) connect capacitors of all the switching cells to the current path for the duration of a blanking time (t b). obtain a voltage reference, determine the number of switching cells required to obtain an output voltage corresponding to the voltage reference, connect the determined amount of capacitors of the switching cells to the current path for a determined on-time (T on) period, and after the determined on-time (T on) connect capacitors of all the switching cells to the current path for the duration of a blanking time (t b).