Elena Kolpakova Posted April 5, 2020 Share Posted April 5, 2020 Is it possible to break from a (forEachEvent) function? I know (break) and (return) do not work, and (exit) ends the script execution entirely. Perhaps there's a (goto) at least? Or, is it possible to (delete) an event outside (forEachEvent) function, e.g. by its index in the selection? Or could I iterate over events without calling (forEachEvent)? The reason for the question is that the default, bundled undupe.cal doesn't work with polyphonic sequences. So I wanted to write my own, but it seems it's pretty much impossible at this point. My last hope is for some undocumented features of the language to be there like a loop break I asked above. Any other ideas are welcome of course. I guess the edit commands could be useful but I feel lazy to dig into those if there's a way to avoid them. Link to comment Share on other sites More sharing options...
Matthew Sorrels Posted April 5, 2020 Share Posted April 5, 2020 Looking at my CAL scripts I found this RemoveDupNotes that I guess I wrote (don't remember it to be honest). It does duplicate note removal on polyphonic sequences by processing each MIDI note lane. Not sure it really works though, but it might be a start. I bet it's pretty slow. There is a bunch of debugging stuff commented out if you find it's not working for you. RemoveDupNotes.cal 1 Link to comment Share on other sites More sharing options...
Elena Kolpakova Posted April 5, 2020 Author Share Posted April 5, 2020 This is brilliant and works great! Thank you so much! And a very smart idea to work around the limitations! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now