Look at scripting in Reaper (Reascipt) if it's audio related.