home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1996 February / CD_02_96.BIN / share / _music / disk1 / splitchn.ca_ / splitchn.bin
Text File  |  1993-04-28  |  1KB  |  48 lines

  1. ;
  2. ; SPLITCHN.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)
  20.     (while (< nChannel 16)
  21.         (do
  22.             ; Provide some progress information on the message line
  23.             (message "Channel " (+ 1 nChannel) " --> Track " (+ 1 nTrk))
  24.  
  25.             ; Set the event filter 0 to include everything
  26.             (ResetFilter 0 1)
  27.             ; Restrict item 10, Channel, to be in the range nChannel..nChannel
  28.             (SetFilterRange 0 10 TRUE nChannel nChannel)
  29.             ; Now use that to cut the events meeting the criteria
  30.             (EditCut From Thru TRUE TRUE FALSE FALSE FALSE FALSE)
  31.             ; Paste them to the destination track, nTrk
  32.             (EditPasteToTrack From TRUE FALSE TRUE FALSE FALSE FALSE nTrk)
  33.  
  34.             ; Give track an informative name
  35.             (TrackName (format "Split Chan " (+ 1 nChannel)) nTrk)
  36.             ; Set the forced channel, although that's redundant because all the events
  37.             ; in the track have that channel
  38.             (TrackChannel nChannel nTrk)
  39.             ; Un-mute the track
  40.             (TrackActive TRUE nTrk)
  41.  
  42.             (++ nChannel)
  43.             (++ nTrk)
  44.         )
  45.     )
  46. )
  47.  
  48.