home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 4 / boot-disc-1996-12.iso / Apps / Cakewalk / PROAUD45 / SPLITCHN.CA_ / SPLITCHN.bin
Text File  |  1996-05-20  |  1KB  |  47 lines

  1. ;
  2. ; Splitchan.cal
  3. ;
  4. ; This takes the current track and splits it by channel into 16 other tracks.
  5. ; It is up to the user to:
  6. ;    - position the cursor on the desired track to be split
  7. ;    - make sure only that track is selected
  8. ;    - set From and Thru to cover whatever portion of it they wish split
  9. ;
  10.  
  11. (do
  12.     (include "need20.cal")    ; Require version 2.0 or higher of CAL
  13.  
  14.     (int nTrk 1)
  15.  
  16.     (getInt nTrk "First destination track?" 1 256)
  17.     (-- nTrk)    ; CAL uses 0..255
  18.  
  19.     (int nChannel 0)    (while (< nChannel 16)
  20.         (do
  21.             ; Provide some progress information on the message line
  22.             (message "Channel " (+ 1 nChannel) " --> Track " (+ 1 nTrk))
  23.  
  24.             ; Set the event filter 0 to include everything
  25.             (ResetFilter 0 1)
  26.             ; Restrict item 10, Channel, to be in the range nChannel..nChannel
  27.             (SetFilterRange 0 10 TRUE nChannel nChannel)
  28.             ; Now use that to cut the events meeting the criteria
  29.             (EditCut From Thru TRUE TRUE FALSE FALSE FALSE FALSE)
  30.             ; Paste them to the destination track, nTrk
  31.             (EditPasteToTrack From TRUE FALSE TRUE FALSE FALSE FALSE nTrk)
  32.  
  33.             ; Give track an informative name
  34.             (TrackName (format "Split Chan " (+ 1 nChannel)) nTrk)
  35.             ; Set the forced channel, although that's redundant because all the events
  36.             ; in the track have that channel
  37.             (TrackChannel nChannel nTrk)
  38.             ; Un-mute the track
  39.             (TrackActive TRUE nTrk)
  40.  
  41.             (++ nChannel)
  42.             (++ nTrk)
  43.         )
  44.     )
  45. )
  46.  
  47.