/* reverser */ OPTIONS RESULTS MXREQUEST "REVERSE,Esrever" if result == 0 then exit MXPOINTER "sleepy" GETBARDATA if BARDATA.SELECT == 'NONE' then do MXREPORT "Needs selected notes!" exit end else BEGINSCAN 'selected' if result ~= 0 then do forever NEXTEVENT if result == 0 then break DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS SIZ = BARDATA.MEASURE ARP = SIZ - EVENT.START.CLOCKS PAR = SIZ - ARP RAT = BARDATA.BEAT TAR = BARDATA.STEP if EVENT.TYPE == 'NOTE' then if EVENT.STOP.BARS = EVENT.START.BARS then do EVENT.START.CLOCKS = (SIZ - DUR) - EVENT.START.CLOCKS EVENT.STOP.CLOCKS = (SIZ + DUR) - EVENT.STOP.CLOCKS REPLEVENT end if EVENT.TYPE == 'NOTE' then if EVENT.STOP.BARS = EVENT.START.BARS + 1 then do EVENT.START.CLOCKS = (SIZ - ARP) - EVENT.START.CLOCKS EVENT.STOP.CLOCKS = (SIZ + ARP)-2*SIZ REPLEVENT end end ENDSCAN GETBARDATA if BARDATA.SELECT == 'NONE' then do MXREPORT "No events selected or marked!" exit end else BEGINSCAN 'selected' if result ~= 0 then do forever NEXTEVENT if result == 0 then break DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS SIZ = BARDATA.MEASURE ARP = SIZ - EVENT.START.CLOCKS PAR = SIZ - ARP RAT = BARDATA.BEAT n = (BARDATA.STOP.BARS+1) - BARDATA.START.BARS do z = 1 to n IF EVENT.START.BARS = (BARDATA.START.BARS - 1) + z then do EVENT.START.BARS = EVENT.START.BARS + (2*n-(z+(z-1))) EVENT.STOP.BARS = EVENT.STOP.BARS + (2*n-(z+(z-1))) REPLEVENT end end END ENDSCAN GETBARDATA if BARDATA.SELECT == 'NONE' then do MXREPORT "No events selected or marked!" exit end else BEGINSCAN 'selected' if result ~= 0 then do forever NEXTEVENT if result == 0 then break DUR = EVENT.STOP.CLOCKS - EVENT.START.CLOCKS SIZ = BARDATA.MEASURE ARP = SIZ - EVENT.START.CLOCKS PAR = SIZ - ARP RAT = BARDATA.BEAT n = (BARDATA.STOP.BARS+1) - BARDATA.START.BARS if EVENT.TYPE == 'NOTE' then do EVENT.START.BARS = EVENT.START.BARS - n EVENT.STOP.BARS = EVENT.STOP.BARS - n REPLEVENT end end MXPOINTER 'NORMAL' EXIT