home *** CD-ROM | disk | FTP | other *** search
- ; BANKSELP.CAL
- ;
- ; This routine will insert a Bank Select combination into a selected track.
- ; This is for instruments which use a "two patch changes" method for
- ; selecting banks, prior to the official Bank Select method being
- ; agreed on.
-
- (do
- (dword time Now)
- (getTime time "Insert Bank/Patch change at time:")
-
- (int pat1 0)
- (getInt pat1 "Bank (0..127):" 0 127)
-
- (int pat2 0)
- (getInt pat2 "Patch (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.
- ; Although this CAL routine is for instruments which use a
- ; pair of patch changes, perhaps the user had been using
- ; the BANKSEL.CAL program, and has CONTROL bank events
- ; here which they won't need. So delete those too.
- (= 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 PATCH pat1)
- (insert (+ time 1) 0 PATCH pat2)
- )
-