home *** CD-ROM | disk | FTP | other *** search
- /* DrumNum.dmcs */
- /* By Keith Barkley, November 1993 */
-
- /* Set up number/name array. Names from GM document off of the internet. */
- /* Change it if you want to. */
- name. = "NULL"
- name.35 = "ACOUSTIC BASS DRUM" ; name.36 = "BASS DRUM 1"
- name.37 = "SIDE STICK" ; name.38 = "ACOUSTIC SNARE"
- name.39 = "HANDCLAP" ; name.40 = "ELECTRIC SNARE"
- name.41 = "LOW FLOOR TOM" ; name.42 = "CLOSED HI HAT"
- name.43 = "HIGH FLOOR TOM" ; name.44 = "PEDAL HI HAT"
- name.45 = "LOW TOM" ; name.46 = "OPEN HI HAT"
- name.47 = "LOW MID TOM" ; name.48 = "HI MID TOM"
- name.49 = "CRASH CYMBAL 1" ; name.50 = "HIGH TOM"
- name.51 = "RIDE CYMBAL 1" ; name.52 = "CHINESE CYMBAL"
- name.53 = "RIDE BELL" ; name.54 = "TAMBOURINE"
- name.55 = "SPLASH CYMBAL" ; name.56 = "COWBELL"
- name.57 = "CRASH CYMBAL 2" ; name.58 = "VIBRASLAP"
- name.59 = "RIDE CYMBAL 2" ; name.60 = "HI BONGO"
- name.61 = "LOW BONGO" ; name.62 = "MUTE HI CONGA"
- name.63 = "OPEN HI CONGA" ; name.64 = "LOW CONGA"
- name.65 = "HIGH TIMBALE" ; name.66 = "LOW TIMBALE"
- name.67 = "HIGH AGOGO" ; name.68 = "LOW AGOGO"
- name.69 = "CABASA" ; name.70 = "MARACAS"
- name.71 = "SHORT WHISTLE" ; name.72 = "LONG WHISTLE"
- name.73 = "SHORT GUIRO" ; name.74 = "LONG GUIRO"
- name.75 = "CLAVES" ; name.76 = "HI WOOD BLOCK"
- name.77 = "LOW WOOD BLOCK" ; name.78 = "MUTECUICA"
- name.79 = "OPEN CUICA" ; name.80 = "MUTE TRIANGLE"
- name.81 = "OPEN TRIANGLE"
-
- /* These names are defined for my Roland Dr. Synth */
- name.27 = "HIGH Q" ; name.28 = "SLAP"
- name.31 = "STICKS" ; name.32 = "SQUARE CLICK"
-
- name.82 = "SHAKER" ; name.83 = "JINGLE BELLS"
- name.85 = "CASTANETS" ; name.86 = "MUTE SURDO"
- name.87 = "OPEN SURDO"
-
- /* if you add new names remember to change these variables... */
-
- lownote = 27 /* 35 for GM */
- highnote = 87 /* 81 for GM */
-
- clipname = "GMOldDrumNote"
-
- T = 'TITLE "GM Drum Request"'
-
- oldnote = GETCLIP(clipname)
- if oldnote = "" THEN oldnote = 35
-
- /* Get name or help request */
- OPTIONS RESULTS
- P = ' PROMPT "Type in the name of the drum or click HELP."'
- D = ' DEFAULT "' || name.oldnote || '"'
- B = ' BUTTONS "_OK|_Help"'
-
- RequestString T || P || D || B
-
- IF ( RC = 5 ) THEN CALL GET_HELP
-
- /* user thought they knew the name of the drum */
-
- note = 0
- searchname = UPPER(COMPRESS(RESULT))
- DO i = lownote TO highnote
- IF (searchname = COMPRESS(name.i) ) THEN DO
- note = i
- LEAVE i
- END /* end if */
- END
- IF (note ~= 0) THEN CALL INSERT_IT note
-
- OPTIONS RESULTS
- P = ' PROMPT "Could not find ' || searchname || '!"'
- B = ' BUTTONS "_Quit|_Help" '
-
- RequestResponse T || P || B
-
- IF (RESULT = 1) THEN CALL GET_HELP
- EXIT 0
-
- /**********************************************************/
- /* This functions allows the user to select a list or a search */
-
- GET_HELP:
- /* Ask for list or search */
- OPTIONS RESULTS
- P = ' PROMPT "Would you like a List or a Search?"'
- B = ' BUTTONS "_List|_Search"'
-
- RequestResponse T || P || B
-
- IF (RESULT = 0) THEN CALL GO_LIST
- ELSE CALL GO_SEARCH
- EXIT 0
-
- /************************************************************/
- /* This function is used to list all the instruments from lownote */
- /* to highnote and allows the user to just click the mouse to */
- /* select the desired instrument. */
-
- GO_LIST:
- /* list some number of items in patch order. provide a number to make */
- /* it easy to select..*/
-
- maxlen = 79 /* Length of line available in requester */
- n = lownote - 1 /* the number of the note we want */
- i = 0 /* the index */
- string = ""
- lnote = 0
- request = 0 /* Do we need a request ? */
-
- DO UNTIL (n= highnote)
-
- DO UNTIL (name.n ~= "NULL" ) /* In case there are gaps in the list */
- n = n + 1 /* Always done at least once */
- END
-
- i = i + 1
-
- /* Build String of form " 1-name1; 2-name2" */
- build = ";" || i || "-" || name.n
- numlist.i = n
-
- IF (LENGTH(string)+LENGTH(build)) > maxlen THEN DO
- request = 1
- n = n-1 /* roll back n */
- i = i - 1 /* i = last index */
- END
- ELSE string = string || build
-
- IF (n = highnote) THEN request = 1 /* If we have reached the end */
-
- IF (request = 1) THEN DO
- string = DELSTR(string, 1, 1) /* Remove the first semicolon */
-
- OPTIONS RESULTS
-
- ttl = ' TITLE "Click # of desired drum."'
- string = ' PROMPT "' || string || '"'
- b = ""
-
- DO bi = 1 TO i /* build list of button numbers */
- b = b || bi || '|'
- END
-
- b = ' BUTTONS "' || b || '_None"'
-
- RequestResponse ttl || string || b
-
- r = RESULT + 1 /* because it returns the buttons starting at '0'*/
- IF ( r = i+1) THEN DO
- /* set up for next loop */
- string = ""
- i = 0
- request = 0
- /* Note :: Do nothing with n .. we didn't use it yet...*/
-
- ITERATE
- END /* End of ( r = i+1) IF */
-
- /* Found it ! */
- lnote = numlist.r
- LEAVE
-
- END /* end of request if */
-
- END /* Until n = highnote do */
-
- CALL Insert_It lnote
- EXIT 0
-
- /*****************************************************/
- /* This function allows the abuser to enter either a letter or */
- /* a word to search for. A letter returns all the insruments that */
- /* start with that letter. A word matches all instances of that */
- /* sequence of characters. */
-
- GO_SEARCH:
- /* Get search string */
- /* If single character then get all names that start with letter. */
- /* If multiple characters use index function to find all occurances */
-
- OPTIONS RESULTS
-
- P = ' PROMPT "Enter a character or a word" '
- D = ' DEFAULT "" '
- B = ' BUTTONS "_OK" '
-
- RequestString T || P || D || B
-
- searchstr = UPPER(COMPRESS(RESULT))
- len = LENGTH(searchstr)
-
- DO i = lownote TO highnote
- ind = INDEX(COMPRESS(name.i) , searchstr)
- IF (ind = 0) THEN ITERATE i /* str not found */
- IF (len = 1) & (ind > 1 ) THEN ITERATE i /* single letter not 1st */
- /* String Matches ! */
- OPTIONS RESULTS
-
- P = ' PROMPT "Is ' || name.i || ' correct?"'
- B = ' BUTTONS "_OK|_Next|_Quit" '
-
- RequestResponse T || P || B
- IF (RESULT = 0) THEN CALL INSERT_IT i
- IF (RESULT = 2) THEN CALL INSERT_IT 0
- END
-
- EXIT 0 /* End of function */
-
- /* This is where all the functions come in order to insert the */
- /* GM instrument note number. It also updates the clip list. */
-
- INSERT_IT:
- /* if notenum is invalid, return, if not then insert note and leave...*/
- PARSE ARG notenum
-
- IF ((notenum < lownote ) | (notenum > highnote) ) THEN EXIT 0
-
- CALL SETCLIP clipname,notenum
- InsertItem "NOTE PITCH "|| notenum
- Next "CHORD"
-
- EXIT 0
-