Converting Rotation to Rotary and Linear Reciprocating Motion

The pink shaft, the pink bevel gear and the pink spur gear are fixed together and receive rotation from the input blue shaft.
The orange bush and the orange spur gear are fixed together and receive rotation from the input blue shaft.
The red satellite bevel gear has a pin sliding in a circular slot of the green output cylinder. The latter rotates and linearly reciprocates simultaneously.
For this case, 1 revolution of the cylinder corresponds its 2 double strokes. This relation can be varied by altering speeds and rotary directions of the orange and pink spur gears.