Index: /fact/tools/pyscripts/pyfact/extractor.py
===================================================================
--- /fact/tools/pyscripts/pyfact/extractor.py	(revision 12985)
+++ /fact/tools/pyscripts/pyfact/extractor.py	(revision 12986)
@@ -128,5 +128,5 @@
     """ test the extractors """
     sg = SignalGenerator()
-    pulse_str = 'len 300 bsl -0.5 noise 0.5 triangle 10 65 8 100' 
+    pulse_str = 'len 300 bsl -0.5 noise 0.5 triangle 65 10 8 100' 
     pulse = sg(pulse_str)
     event = []
Index: /fact/tools/pyscripts/pyfact/generator.py
===================================================================
--- /fact/tools/pyscripts/pyfact/generator.py	(revision 12985)
+++ /fact/tools/pyscripts/pyfact/generator.py	(revision 12986)
@@ -44,8 +44,10 @@
 
         if 'triangle' in o:
-            self.triangle_height = float(o['triangle'][0])
-            self.triangle_pos = float(o['triangle'][1])
-            self.triangle_rise = int(o['triangle'][2])
-            self.triangle_fall = int(o['triangle'][3])
+            self.pulses = []
+            # append 1st pulse to list of pulses
+            self.pulses.append( ( float(o['triangle'][0]) , float(o['triangle'][1]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+            number_of_pulses_after_1st = (len(o['triangle'])-4)/2
+            for i in range(number_of_pulses_after_1st):
+                self.pulses.append( ( float(o['triangle'][2*i+4]) , float(o['triangle'][2*i+5]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
 
         if 'spike' in o:
@@ -66,10 +68,13 @@
             signal[self.step_start:self.step_stop] += self.step_height
         if 'triangle' in self.options:
-            start = self.triangle_pos - self.triangle_rise
-            stop = self.triangle_pos + self.triangle_fall
-            pos = self.triangle_pos
-            height = self.triangle_height
-            signal[start:pos] += np.linspace(0., height, self.triangle_rise)
-            signal[pos:stop] += np.linspace(height, 0. , self.triangle_fall)
+            for pulse in self.pulses:
+                pos = pulse[0]
+                height = pulse[1]
+                rise = pulse[2]
+                fall = pulse[3]
+                start = pos - rise
+                stop = pos + fall
+                signal[start:pos] += np.linspace(0., height, rise)
+                signal[pos:stop] += np.linspace(height, 0. , fall)
         if 'spike' in self.options:
             for spike in self.spikes:
@@ -84,5 +89,5 @@
         s += ' * bsl:      level (-0.5)\n'
         s += ' * step:     height, start, end\n'
-        s += ' * triangle: height, position, risingedge, fallingedge\n'
+        s += ' * triangle: pos height risingedge, fallingedge [pos height ...]\n'
         s += ' * spike:    pos height [pos height ...]\n'
         
@@ -121,5 +126,5 @@
 if __name__ == '__main__':
     """ test the class """
-    myGenerator = SignalGenerator('len 100 noise 0.3 bsl -2.5 step 20.3 12 24 triangle 10.2 50 10 30 spike 2 50. 20 50')
+    myGenerator = SignalGenerator('len 400 noise 0.3 bsl -2.5 triangle 50 10.2 10 100 65 10 150 20 180 10 250 10 spike 100 50. 20 50 21 49')
     sig = myGenerator()
     print myGenerator
