home *** CD-ROM | disk | FTP | other *** search
/ Computer Music Interactif 7 / cd.iso / pc / PC / Demos / GroovMak / data1.cab / Program_Executable_Files / Media / grooveM.dxr / 00357.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  2.5 KB  |  85 lines

  1. on mouseEnter
  2.   if the visible of window "Help" then
  3.     tell window "help"
  4.       go("grooveM23")
  5.     end tell
  6.   end if
  7. end
  8.  
  9. on mouseLeave
  10.   if the visible of window "Help" then
  11.     tell window "help"
  12.       go("start")
  13.     end tell
  14.   end if
  15. end
  16.  
  17. on mouseUp
  18.   global gOn
  19.   if gOn and not (the visible of window "help") then
  20.     set the editable of member "fieldBpm" to 1
  21.   end if
  22. end
  23.  
  24. on keyUp
  25.   global gBpmSong, gOn, gGreen
  26.   if gOn and not (the visible of window "help") then
  27.     if (the keyCode = 36) or (the keyCode = 76) then
  28.       set the editable of member "fieldBpm" to 0
  29.       delete char -30000 of field "fieldBpm"
  30.       set N to float(field "fieldBpm")
  31.       if not floatp(N) then
  32.         put gBpmSong into field "fieldBpm"
  33.       end if
  34.       set bpm to field "fieldBpm"
  35.       set the textFont of member "fieldBpm" to "IK10"
  36.       set the foreColor of member "fieldBpm" to gGreen
  37.       set bpm to float(bpm)
  38.       if bpm > (6 * gBpmSong / 5) then
  39.         set bpm to float(6 * gBpmSong / 5)
  40.       end if
  41.       if bpm < (4 * gBpmSong / 5) then
  42.         set bpm to float(4 * gBpmSong / 5)
  43.       end if
  44.       case the frame of
  45.         2, 3:
  46.           set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
  47.           set the locV of sprite 24 to 449
  48.           updateStage()
  49.         6, 7:
  50.           set the locH of sprite 24 to (15 * ((100 * (bpm - gBpmSong) / gBpmSong) + 52) / 4) + 5
  51.           set the locV of sprite 24 to 362
  52.           updateStage()
  53.           if word 2 of field "fieldDuration" = "sec" then
  54.             set sec to 1920 / float(field "fieldBpm") * the number of words in field "fieldMarkerSeq"
  55.             set sec to integer(sec)
  56.             set min to sec / 60
  57.             if min = 0 then
  58.               set min to "00"
  59.             end if
  60.             if (min >= 1) and (min <= 9) then
  61.               set min to "0" & min
  62.             end if
  63.             set sec to sec mod 60
  64.             if sec = 0 then
  65.               set sec to "00"
  66.             end if
  67.             if (sec >= 1) and (sec <= 9) then
  68.               set sec to "0" & sec
  69.             end if
  70.             put min & ":" & sec & "  sec" into field "fieldDuration"
  71.           end if
  72.         10, 11:
  73.           set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
  74.           set the locV of sprite 24 to 341
  75.           updateStage()
  76.       end case
  77.       updateStage()
  78.       IKMixBPM(bpm * 1000)
  79.       put bpm into field "fieldBpm"
  80.       set the textFont of member "fieldBpm" to "IK10"
  81.       set the foreColor of member "fieldBpm" to gGreen
  82.     end if
  83.   end if
  84. end
  85.