Activate Loop Switch to Next Marker

Dmitry e1Deus's icon

Hi! How do I create a simple M4L device that will activate a Cycle Loop (Loop Switch) from the playhead location to the nearest marker? Thanks!

Max version: 9

Live version: 12