• SONAR
  • Remove duplicate MIDI notes? (p.3)
2016/07/06 20:42:30
rogeriodec
tparker24
As I recall, the problem occurs if processing multiple clips at one time.  If you work on a single clip, all is well.  So, you'll need to bounce multiple clips into a single clip (or process the clips one at a time).  

I'm not 100% positive on this, but at least, it's something to try.




Yeah, try this:
  1. Open a new project, 1 midi track
  2. Open PRV and create, for example, 10 identical notes, one after another.
  3. Select all
  4. Set all velocities of notes to 10 (Process -> Scale Velocity), so you'll have 10 identical, consecutive notes, all with the velocity 10
  5. Run the following script, which adds 1 to 1 increment each note position, i.e., theoretically the first note should be with the velocity 11, the second note should be 12, and so forth (save the code below into a new file any CAL and run it (Ctrl + F1)
 
(int x 0)

(forEachEvent
    (if (&& (== Event.Kind NOTE) (< Note.Vel 127))
        (do
            (+= x 1)
   (pause x)
            (+= Note.Vel x)
        )
    )
)

 
  • The first thing you'll notice is that the loop (forEachEvent) runs more than the number of events (notes). This is shown by the command (pause x) that shows the value being added to each note.
  • After running the script finished, you will see that all velocities were changed, however randomly.
  • And there is only one clip, one track, only 10 events (10 notes), nothing more.
2016/07/06 21:12:32
rogeriodec
tparker24
As I recall, the problem occurs if processing multiple clips at one time.  If you work on a single clip, all is well.  So, you'll need to bounce multiple clips into a single clip (or process the clips one at a time).  

I'm not 100% positive on this, but at least, it's something to try.




tparker, first I have to thank you and also I have to retract.
After reading your post I realized that the KEY to UNDUPE.CAL work is: ENSURE THAT ALL EVENTS ARE SELECTED IN ONLY 1 CLIP.


And also, in the example script I created in my previous post, I replaced the "forEachEvent" by command "do" which correctly handles all events.
 
With this I understand that this case is closed, that is, every time we need to use a script that make a sequence analysis of events (UNDUPE, LEGATO, etc.), we must always remember to keep the selected events in a single clip.
2017/01/12 22:26:12
AdamGrossmanLG
tparker24
As I recall, the problem occurs if processing multiple clips at one time.  If you work on a single clip, all is well.  So, you'll need to bounce multiple clips into a single clip (or process the clips one at a time).  

I'm not 100% positive on this, but at least, it's something to try.






i just tried on a single clip and it still didn't work.  then again, nothing works right for me :(
2017/01/13 08:20:38
rogeriodec
SilverBlueMedallion
 
i just tried on a single clip and it still didn't work.  then again, nothing works right for me :(


Send me a link with this project (or just the part that does not work) for me to take a look.
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account