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

  1. /* cmd19arg */
  2. /* calculates 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 cmd19arg, 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 and displays the nearest
  15.     value for command 19.
  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 do
  24.         hexval = d2x(cmd19arg)
  25.         if (cmd19arg < 16) then hexval = "0"hexval
  26.         "wi_showstring Command: 19"hexval
  27.     end
  28. end
  29.