RE: Eradicating duplicated notes with different lengths
2007/01/31 18:20:32
(permalink)
Hi Twigman
Here is the CAL program. Just copy the following into notepad and save it as whatever name you like, with a .CAL extension.
Select the part you want to check and run the CAL (Ctrl+F1). First dialog asks for the maximum distance between notes that are considered duplicates (0 is a good default meaning notes must be exactly on top of each other). Second dialog asks for the maximum size of note that will be deleted. So in you case choose a crochet size which is most likely 960 - but you cancheck this in Options/Project/Clock.
Have fun!
; DELSMALLDUPES.CAL
; Modified by Tyrone Howe (info@tyronehowemusic.com)
(do
(dword lastTime 0)
(int lastKey 0)
(int nDeleted 0)
(int timeWindow 0)
(int longestDuration 480)
(getInt timeWindow "Furthest notes can be apart but still considered duplicates (in ticks):" 0 TIMEBASE)
(++ timeWindow)
(/= timeWindow 2)
(getInt longestDuration "Longest duration for removal (in ticks):" 480 3840)
)
(do
(if (== Event.Kind NOTE)
(if (== lastKey Note.Key)
(do
(if (&& (>= Event.Time (- lastTime timeWindow)) (<= Event.Time (+ lastTime timeWindow)))
(if (&& (== Note.Key lastKey) (<= Note.Dur longestDuration ))
(do
(delete)
(++ nDeleted)
)
NIL
)
NIL
)
NIL
)
(= lastKey Note.Key)
) NIL
)
(= lastTime Event.Time)
)
(do
(pause "Deleted " nDeleted " duplicate events.")
)
hmmmm - posting here seems to eliminate all the TABs - I'll PM you the file as well.
Tyrone Howe
Sonar 6, Pentium D 2.8 Ghz
Edirol PCR-50 and UA-25