Adding Oscillating Knife to my CNC Router

Hi everyone
I am interested in adding an Oscillating knife to my CNC Router machine to cut Foam, soft and semi rigid. The knife needs to Look Ahead and turn accordingly as can be seen in this Youtube link, please watch at .25 speed so the action is clear. Any help in hardware and Software recommendation would be much appreciated. Thanks

https://youtu.be/1trLFSBwIbM