What you're talking about doing is quantizing note length. Essentially what you're doing is adjusting the time of every note-off event. Yes, you can certainly do this with MIDI REXX. If your track is single notes (ie, not chords), then you could go through the track looking for every note-on and note-off event. You need to pick the smallest "sub-beat" that occurs in your song. For example, above that is a sixteenth note. Just search for every note-off event, and adjust its timing so it falls to the next "sub-beat". Assuming your midi file is 192 PPQN, that means there are 48 PPQN in every sixteenth note. So you can round up a note-off's time (to the nearest sixteenth note) as so:
selected = MIDITrack(10)
IF selected \== 0 THEN DO
DO UNTIL err \== ""
err = MIDIGetEvent('Off |(Off')
IF err == "" THEN DO
midievent.!clock = (midievent.!clock // 48) + 48
err = MIDISetEvent('TIME')
IF err \== "" THEN SAY "ERROR:" err
END
ELSE IF err \== "No currently selected event" THEN SAY "ERROR:" err
END
END
|