home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 93 / af093a.adf / archives / af2.lzx / Extras / Rexx / Cmd19set.omed < prev    next >
Text File  |  1984-01-11  |  937b  |  25 lines

  1. /* cmd19set */
  2. /* calculates and enters the argument for command 19 to get the sample */
  3. /* start as near the range start as possible */
  4.  
  5. /* Instructions:
  6.     Copy this macro to OctaMED directory. Create a new shortcut
  7.     in the Keyboard Shortcut editor. Set the shortcut name and
  8.     input part as you wish, set Action as Execute ARexx File,
  9.     Command as cmd19set, and Window as SAMPLEEDITOR.
  10.  
  11.     When you want to start a sample not from the beginning, using
  12.     the command 19xx, open the Sample Editor, point the range
  13.     cursor where you want to begin playing, and press the key you
  14.     had set up. The macro calculates the nearest value for command
  15.     19, and enters it at the current cursor position.
  16. */
  17.  
  18. address 'OCTAMED_REXX'
  19. "sa_getrangestart var rngstart"
  20. if (rc = 0) then do
  21.     cmd19arg = trunc((rngstart + 128) / 256)
  22.     if (cmd19arg > 255) then "wi_showstring The point is too far from the beginning."
  23.     else "ed_setdata cmdnum=25 qual="cmd19arg
  24. end
  25.