home *** CD-ROM | disk | FTP | other *** search
- /*
- ARexx script for use with PlotCMD
- (PlotCMD is a MUIRexx script for use with OctaMED Soundstudio)
- Read the PlotCMD doc for details
- */
-
- ADDRESS OCTAMED_REXX
- OPTIONS RESULTS
-
- PARSE ARG cmd /* Argument = command in hex (ex: 0C) */
-
- IN_SELECT LAST
- CALL checkifsample()
-
- SA_GETSAMPLELENGTH VAR samplen
- ED_GETNUMLINES VAR blocklen
-
- len=MIN(samplen, blocklen)
-
- ED_SETDATA_UPDATE OFF
-
- DO i=0 TO len-1
- SA_GETSAMPLE OFFSET i
- level=(RESULT+32767)/1024 /* Convert to 0-64 values */
- level=round(level) /* Round to nearest integeer */
- ED_SETDATA LINE i CMDNUM X2D(cmd) CMDLVL level
- END
-
- ED_SETDATA_UPDATE ON
- ED_SETDATA_UPDATE
-
- EXIT
-
-
-
-
-
- /* P R O C E D U R E S
- -----------------------------------------------------*/
-
- round: PROCEDURE
- PARSE ARG nr
- IF (nr-TRUNC(nr))>=0.5 THEN
- nr=TRUNC(nr)+1
- ELSE
- nr=TRUNC(nr)
- return nr
-
- checkifsample: PROCEDURE
- IN_GETTYPE VAR type
- IF ~(type == SAMPLE | type == SAMPLE16) THEN DO
- WI_REQUEST '"No sample!"' '"Ok"'
- EXIT
- END
- return
-