• SONAR
  • Does anyone have the old LoVel.cal script? (p.2)
2015/10/26 10:32:55
mudgel
I must go through my archive and create a list of all the scripts.
2015/10/26 11:12:53
brundlefly
I have one, so I opened it up, and found that's it's one I customized from the HiVel script. Sorry for the long post, but this is the easiest way to share it. Just paste into Notepad, and save as LoVel.cal:
 
;;; David M Baay 11/18/2009 from Robert C. Prince's HIVEL.CAL
;;;
;;;
;;;
;;;
;;; LOVEL.CAL
;;;
;;; This is a CAL program that finds the lowest velocity for you.
;;; It allows you to abort the pgm upon finding a velocity of 0.
;;;
;;;
;;;
;;;
;;;
;;; *****************************************************************
;;; Prolog
(do
; set variables
(int HoldLo 127) ; holds the lowest velocity found thus far
(dword LoTime 0) ; time of the lowest velocity
(int c 0) ; counter for notes processed
(int TEP) ; total events processed
;close off the do paren and the prolog
)
;;; *****************************************************************
;;; Body
;;;
(do
; output message to user
(message
"Lowest Velocity: " HoldLo
" at Time: " (meas LoTime) ": " (beat LoTime) ": " (tick LoTime)
" Notes: " c
" Events: " TEP
)
(if (== Event.Kind NOTE)
; If a note event, do all the following
(do
; bump the counter
(++ c)
; is the velocity lower than the lowest found thus far?
(if (< Note.Vel HoldLo)

; yes it is, so do all the following
(do
; put the Note.Vel in HoldLo
(= HoldLo Note.Vel)
; put the event time in LoTime
(= LoTime Event.Time)
; is the lowest velocity 0?
(if (== HoldLo 0)
; yes lowest vel is 0, so allow user to abort
(pause "Lowest velocity found: " HoldLo
" at Time: " (meas LoTime)
": " (beat LoTime)
": " (tick LoTime)
" Press Esc to abort . . ."
)
; no lowest vel is not 0, so continue the search
NIL
; close the is lowest velocity 0 paren
)
; close the yes it's lowest vel thus far do paren
)
; NO it is not the lowest velocity thus far, so go on
NIL
; close the if lowest vel thus far paren
)
; close yes it is a note do loop
)
; No, it is not a note event
NIL
; close if event = note paren
)
; bump up total events processed
(++ TEP)
; close body/do paren
)
;;; ******************************************************************
;;; Epilog
;;;
(do
(pause "Lowest Velocity Found: " HoldLo " at time "
(meas LoTime) ": " (beat LoTime) ": " (tick LoTime)
" Press any key to continue"
)
; move cursor to LoTime
(= Now LoTime)
)
 
 
2015/10/26 11:25:35
Soundwise
FZ1
I did have a look at the text of the file hoping the script was so simple that even I could understand it and bend it to my will.
Nope



I've attempted to do this for you. Please, check it out and let me know if it works as expected.
https://drive.google.com/...E5MDQ/view?usp=sharing
2015/10/26 11:26:50
bitflipper
Here ya go:
========================== Cut here ==============================
; LoVel.CAL
; Author: Dave Townsend, inspired by HiVel.cal by Robert C. Prince
; Finds the lowest velocity in the selected region of a MIDI track
; Note: must select a region or select the entire track first
(do
    ; variable declarations
    (int HoldLo 127) ; lowest velocity found thus far
    (dword LoTime 0) ; time of the lowest velocity
    (int notecount 0) ; note offset
    (int eventcount 0) ; event offset
)
(forEachEvent
    (do
        (if (== Event.Kind NOTE)
            (do
                (if (< Note.Vel HoldLo)
                    (do
                        (++ notecount) ; inc note counter
                        (= HoldLo Note.Vel) ; remember this velocity value
                        (= LoTime Event.Time) ; save event time
                    ) 
                NIL 
                ) 
            )
        NIL ; not a note
        ) ; end if note/not note
    (++ eventcount) ; inc event counter
    )
) ; main loop
 
(do
    (if (== eventcount 0)
        (pause "No events found in selected region")
        (pause "Lowest Velocity: " HoldLo " at time " (meas LoTime) ": " (beat LoTime) ": " (tick LoTime))
    )
    (= Now LoTime) ; move cursor to LoTime
)
 
 
2015/10/26 17:57:28
FZ1
Wow, Thank you so much Dilletant, Brundlefly and Bitflipper.
Three different scripts provided within a few hours.
Looks like my low velocity needs are covered forever.

Much Appreciated

Fuzzy1
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account