home *** CD-ROM | disk | FTP | other *** search
- ; BANKSEL.CAL
- ;
- ; This routine will insert a Bank Select combination into a selected track
- ; The user may change the NOW time for the insertion.
- ;
- ; This routine works in both Cakewalk Professional for Windows and
- ; Cakewalk Professional for DOS. Enjoy!
- ;
-
- (do
- (dword time Now)
- (getTime time "Insert Bank/Patch change at time:")
-
- (int msb 0)
- (getInt msb "Bank MSB/Controller 0 (0..127):" 0 127)
-
- (int lsb 0)
- (getInt lsb "Bank LSB/Controller 32 (0..127):" 0 127)
-
- (int pat 0)
- (getInt pat "Patch Number (0..127):" 0 127)
-
- ; Delete existing bank-change events around this time.
- ; The spread of 3 ticks is because below we insert the events
- ; spread apart by a tick each to ensure their ordering.
- (= From time)
- (= Thru (+ time 2))
-
- (forEachEvent
- (do
- (if (&& (== Event.Kind CONTROL) (== Control.Num 0))
- (delete)
- (if (&& (== Event.Kind CONTROL) (== Control.Num 32))
- (delete)
- (if (== Event.Kind PATCH)
- (delete)
- )
- )
- )
- )
- )
-
- ; Insert the new events
- (insert time 0 CONTROL 0 msb)
- (insert (+ time 1) 0 CONTROL 32 lsb)
- (insert (+ time 2) 0 PATCH pat)
- )
-