home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / music / sfx-030 / sfx-data / _rexx / pan.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-03-08  |  1.3 KB  |  56 lines

  1. /* SFX Pan */
  2.  
  3. OPTIONS RESULTS
  4. ADDRESS REXX_SFX
  5.  
  6. GetActiveBuffer
  7. buf1=RESULT
  8. IF buf1>-1 THEN DO
  9.     GetChannels buf1
  10.     cha=RESULT
  11.     IF cha=1 THEN DO
  12.         SelOperator 'ConvertChannels'                    /* make Stereo */
  13.         SetOperatorParam 'ConvertChannels' 'Dest' '1'
  14.         ProcessSample buf1
  15.         IF RC=0 THEN buf1=RESULT
  16.         ELSE buf1=-2
  17.         buf2=-1
  18.         IF buf1>-1 THEN DO                            /* RampUp first channel */
  19.             SelOperator 'Amplify'
  20.             SetOperatorParam 'Amplify' 'Wrap' '0'
  21.             SetOperatorParam 'Amplify' 'P1ModShape' 'Linear'
  22.             DisableChannel buf1 1
  23.             SetOperatorParam 'Amplify' 'AmpfS' '0.0'
  24.             SetOperatorParam 'Amplify' 'AmpfE' '1.0'
  25.             ProcessSample buf1
  26.             IF RC=0 THEN buf2=RESULT
  27.             ELSE buf2=-2
  28.             RemoveBuffer buf1
  29.         END
  30.         ELSE Message '"Operator ConvertChannels failed !"'
  31.         buf1=-1
  32.         IF buf2>-1 THEN DO                            /* RampDown second channel */
  33.             EnableChannel buf2 1
  34.             DisableChannel buf2 0
  35.             SetOperatorParam 'Amplify' 'AmpfS' '1.0'
  36.             SetOperatorParam 'Amplify' 'AmpfE' '0.0'
  37.             ProcessSample buf2
  38.             IF RC=0 THEN buf1=RESULT
  39.             ELSE buf1=-2
  40.             RemoveBuffer buf2
  41.         END
  42.         ELSE Message '"Operator Amplify failed !"'
  43.         IF buf1>-1 THEN DO
  44.             EnableChannel buf1 0
  45.             RedrawBuffer buf1
  46.             SetActiveBuffer buf1
  47.             CleanUp 0
  48.         END
  49.         ELSE Message '"Operator Amplify failed !"'
  50.     END
  51.     ELSE Message '"Mono source required !"'
  52. END
  53. ELSE Message '"No sample to operate on !"'
  54. ActivateSFX
  55. EXIT
  56.