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 / 00647.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  6.8 KB  |  209 lines

  1. on mouseDown
  2.   if not (the visible of window "help") then
  3.     if inside(the clickLoc, rect(567, 413, 634, 426)) then
  4.       repeat while the mouseDown
  5.         set the memberNum of sprite 13 to the number of member "Hseq"
  6.         set the ink of sprite 13 to 36
  7.         set the loc of sprite 13 to point(601, 422)
  8.         updateStage()
  9.       end repeat
  10.       pass()
  11.     end if
  12.     if inside(the clickLoc, rect(567, 372, 634, 387)) then
  13.       repeat while the mouseDown
  14.         set the memberNum of sprite 13 to the number of member "HsongMenu"
  15.         set the ink of sprite 13 to 36
  16.         set the loc of sprite 13 to point(601, 381)
  17.         updateStage()
  18.       end repeat
  19.       pass()
  20.     end if
  21.     if inside(the clickLoc, rect(567, 393, 634, 408)) then
  22.       repeat while the mouseDown
  23.         set the memberNum of sprite 13 to the number of member "Hgroove"
  24.         set the ink of sprite 13 to 36
  25.         set the loc of sprite 13 to point(601, 401)
  26.         updateStage()
  27.       end repeat
  28.       pass()
  29.     end if
  30.     if inside(the clickLoc, rect(592, 453, 611, 471)) then
  31.       repeat while the mouseDown
  32.         set the memberNum of sprite 10 to the number of member "Hpref"
  33.         set the ink of sprite 10 to 36
  34.         set the loc of sprite 10 to point(602, 464)
  35.         updateStage()
  36.       end repeat
  37.       pass()
  38.     end if
  39.     if inside(the clickLoc, rect(615, 453, 634, 471)) then
  40.       repeat while the mouseDown
  41.         set the memberNum of sprite 10 to the number of member "Hquit"
  42.         set the ink of sprite 10 to 36
  43.         set the loc of sprite 10 to point(625, 464)
  44.         updateStage()
  45.       end repeat
  46.     end if
  47.   end if
  48. end
  49.  
  50. on mouseUp
  51.   global gBpmSong, gSelDuration, gPlaySong, gReturn, gPath, gStyle, gOnSynth, gGrooveSel, gFade, gRandom, gMix, gGreen, markerList, stateTrackList, tapList, randomizeList
  52.   if not (the visible of window "help") then
  53.     if inside(point(the mouseH, the mouseV), rect(567, 413, 634, 426)) then
  54.       repeat with i = 2 to 10
  55.         puppetSprite(i, 0)
  56.       end repeat
  57.       repeat with i = 43 to 44
  58.         puppetSprite(i, 0)
  59.       end repeat
  60.       puppetSprite(48, 0)
  61.       set tapList to [0, 0]
  62.       if IKGetCurrentBeat() <> -1 then
  63.         if gOnSynth then
  64.           IKSynthStop()
  65.           set gOnSynth to 0
  66.         end if
  67.         IKStop()
  68.         IKFunction()
  69.         set gPlaySong to 0
  70.         set the memberNum of sprite 39 to 1000
  71.       end if
  72.       put EMPTY into field "fieldBarBeat"
  73.       go("seq")
  74.       set bpm to float(field "fieldBpm")
  75.       set the locH of sprite 24 to (15 * ((100 * (bpm - gBpmSong) / gBpmSong) + 52) / 4) + 5
  76.       set the locV of sprite 24 to 362
  77.       updateStage()
  78.       set gGrooveSel to 0
  79.       put EMPTY into field "fieldState"
  80.       if markerList = [] then
  81.         put EMPTY into field "fieldDuration"
  82.       else
  83.         put 8 * count(markerList) & "  bars" into field "fieldDuration"
  84.       end if
  85.       set the visible of sprite 55 to 1
  86.       pass()
  87.     end if
  88.     if inside(point(the mouseH, the mouseV), rect(567, 372, 634, 387)) then
  89.       openWin("YesNo")
  90.       tell window "YesNo"
  91.         go("newSong")
  92.       end tell
  93.       pass()
  94.     end if
  95.     if inside(point(the mouseH, the mouseV), rect(567, 393, 634, 408)) then
  96.       repeat with i = 2 to 10
  97.         puppetSprite(i, 0)
  98.       end repeat
  99.       repeat with i = 43 to 44
  100.         puppetSprite(i, 0)
  101.       end repeat
  102.       puppetSprite(48, 0)
  103.       set gPlaySong to 0
  104.       if gFade then
  105.         IKMasterVolume(integer(field "fieldMasterVol"))
  106.       end if
  107.       set the memberNum of sprite 39 to 1000
  108.       set the loc of sprite 39 to point(320, 240)
  109.       go("groove")
  110.       put integer(word 1 of field "fieldBarBeat") into word 1 of field "fieldBarBeat"
  111.       set bpm to float(field "fieldBpm")
  112.       set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
  113.       set the locV of sprite 24 to 449
  114.       updateStage()
  115.       case random(4) of
  116.         4:
  117.           set gRandom to getAt(randomizeList, 4)
  118.         3:
  119.           set gRandom to getAt(randomizeList, 3)
  120.         2:
  121.           set gRandom to getAt(randomizeList, 2)
  122.         1:
  123.           set gRandom to getAt(randomizeList, 1)
  124.       end case
  125.       updateStage()
  126.       playRandom()
  127.       repeat with i = 50 to 56
  128.         set the visible of sprite i to 1
  129.       end repeat
  130.       pass()
  131.     end if
  132.     if inside(point(the mouseH, the mouseV), rect(615, 453, 634, 471)) then
  133.       openWin("YesNo")
  134.       tell window "YesNo"
  135.         go("quit")
  136.       end tell
  137.       pass()
  138.     end if
  139.     if inside(point(the mouseH, the mouseV), rect(592, 453, 611, 471)) then
  140.       if the visible of window "synth" then
  141.         close(window "synth")
  142.       end if
  143.       if IKGetCurrentBeat() <> -1 then
  144.         set gPlaySong to 0
  145.         set sNum to "s" & gStyle
  146.         set the memberNum of sprite (1 + gStyle) to the number of member sNum
  147.         updateStage()
  148.         set gStyle to 0
  149.         if gOnSynth then
  150.           IKSynthStop()
  151.           set gOnSynth to 0
  152.         end if
  153.         IKStop()
  154.         IKFunction()
  155.       end if
  156.       set gReturn to "vMix grooveM"
  157.       go("start", "pref")
  158.       pass()
  159.     end if
  160.     if inside(point(the mouseH, the mouseV), rect(489, 408, 523, 442)) then
  161.       set click to the timer
  162.       if getAt(tapList, 2) <> 0 then
  163.         if ((click - getAt(tapList, 2)) <= 80) and ((click - getAt(tapList, 2)) >= 10) then
  164.           puppetSprite(10, 0)
  165.           set media to float((click - getAt(tapList, 1)) / 2)
  166.           set bpm to float(3600) / media
  167.           if bpm > (6 * gBpmSong / 5) then
  168.             set bpm to float(6 * gBpmSong / 5)
  169.           end if
  170.           if bpm < (4 * gBpmSong / 5) then
  171.             set bpm to float(4 * gBpmSong / 5)
  172.           end if
  173.           set tapList to [0, 0]
  174.           IKMixBPM(bpm * 1000)
  175.           put bpm into field "fieldBpm"
  176.           set the textFont of member "fieldBpm" to "IK10"
  177.           set the foreColor of member "fieldBpm" to gGreen
  178.           set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
  179.           set the locV of sprite 24 to 341
  180.           updateStage()
  181.         else
  182.           set tapList to [click, 0]
  183.           puppetSprite(10, 1)
  184.           set the memberNum of sprite 10 to the number of member "Htap"
  185.           set the loc of sprite 10 to point(507, 425)
  186.           set the ink of sprite 10 to 8
  187.           updateStage()
  188.         end if
  189.       else
  190.         if (getAt(tapList, 2) = 0) and (getAt(tapList, 1) <> 0) then
  191.           if ((click - getAt(tapList, 1)) <= 80) and ((click - getAt(tapList, 1)) >= 10) then
  192.             setAt(tapList, 2, click)
  193.           else
  194.             setAt(tapList, 1, click)
  195.           end if
  196.         else
  197.           setAt(tapList, 1, click)
  198.         end if
  199.         puppetSprite(10, 1)
  200.         set the memberNum of sprite 10 to the number of member "Htap"
  201.         set the loc of sprite 10 to point(507, 425)
  202.         set the ink of sprite 10 to 8
  203.         updateStage()
  204.       end if
  205.     end if
  206.   end if
  207.   set the editable of member "fieldBpm" to 0
  208. end
  209.