The invention relates to a method and a generator for generating a time sequence of discharge pulses separated from each other by pulse pauses for electrical discharge machining. At least two pulse capacitors are discharged each in the form of a partial pulse into the spark gap for forming together a discharge pulse. A discharge pulse having a predetermined waveform is selected from a plurality of discharge pulses having differing predetermined waveforms. The discharge of the at least two pulse capacitors is controlled such that the selected discharge pulse is generated with the predetermined waveform.