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 / 00368.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  12.7 KB  |  381 lines

  1. on exitFrame
  2.   go(the frame)
  3. end
  4.  
  5. on enterFrame
  6.   global gTraccia, gBpmSong, gSolo, gloadGroove, gOn, gYes, gOnSynth, gPosSynth, gYesQuit, gYesDel, gYesDelUser, gDelUser, gPath, gGreen, gSync, gFirstClick, gRandom, gRed, stateTrackList, volPosList, volValList, panPosList, panValList, virTracklIst, keepList, markerSynthList, soloGroupList, tapList, gBpmPall, gOnVol, gOnPan, gClose
  7.   case the rollOver of
  8.     10:
  9.       set fullName to line the mouseLine of field "song"
  10.       repeat with i = 1 to 4
  11.         delete word 1 of fullName
  12.         if char 1 of fullName = " " then
  13.           delete char 1 of fullName
  14.         end if
  15.       end repeat
  16.       put fullName into field "fieldFullName"
  17.     41, 42, 43, 44, 45, 46, 47, 48:
  18.       if getAt(virTracklIst, the rollOver - 40) <> -1 then
  19.         set fullName to line getAt(virTracklIst, the rollOver - 40) of field "song"
  20.         repeat with i = 1 to 4
  21.           delete word 1 of fullName
  22.           if char 1 of fullName = " " then
  23.             delete char 1 of fullName
  24.           end if
  25.         end repeat
  26.         put fullName into field "fieldFullName"
  27.       else
  28.         if not gTraccia then
  29.           put " " into field "fieldFullName"
  30.         else
  31.           set fullName to line getAt(virTracklIst, gTraccia) of field "song"
  32.           repeat with i = 1 to 4
  33.             delete word 1 of fullName
  34.             if char 1 of fullName = " " then
  35.               delete char 1 of fullName
  36.             end if
  37.           end repeat
  38.           put fullName into field "fieldFullName"
  39.         end if
  40.       end if
  41.     otherwise:
  42.       if inside(point(the mouseH, the mouseV), rect(109, 63, 130, 84)) then
  43.         put getAt(randomizeList, 4) into field "fieldRandom"
  44.       else
  45.         if inside(point(the mouseH, the mouseV), rect(129, 47, 150, 68)) then
  46.           put getAt(randomizeList, 3) into field "fieldRandom"
  47.         else
  48.           if inside(point(the mouseH, the mouseV), rect(150, 32, 171, 54)) then
  49.             put getAt(randomizeList, 2) into field "fieldRandom"
  50.           else
  51.             if inside(point(the mouseH, the mouseV), rect(171, 20, 193, 41)) then
  52.               put getAt(randomizeList, 1) into field "fieldRandom"
  53.             else
  54.               put gRandom into field "fieldRandom"
  55.             end if
  56.           end if
  57.         end if
  58.       end if
  59.       set the textFont of member "fieldRandom" to "IK10"
  60.       set the foreColor of member "fieldRandom" to gRed
  61.       set N to 0
  62.       if inside(point(the mouseH, the mouseV), rect(295, 42, 344, 92)) and (getAt(virTracklIst, 1) <> -1) then
  63.         set N to getAt(virTracklIst, 1)
  64.       else
  65.         if inside(point(the mouseH, the mouseV), rect(295, 387, 344, 437)) and (getAt(virTracklIst, 5) <> -1) then
  66.           set N to getAt(virTracklIst, 5)
  67.         else
  68.           if inside(point(the mouseH, the mouseV), rect(416, 91, 466, 141)) and (getAt(virTracklIst, 2) <> -1) then
  69.             set N to getAt(virTracklIst, 2)
  70.           else
  71.             if inside(point(the mouseH, the mouseV), rect(416, 336, 466, 386)) and (getAt(virTracklIst, 4) <> -1) then
  72.               set N to getAt(virTracklIst, 4)
  73.             else
  74.               if inside(point(the mouseH, the mouseV), rect(174, 91, 224, 141)) and (getAt(virTracklIst, 8) <> -1) then
  75.                 set N to getAt(virTracklIst, 8)
  76.               else
  77.                 if inside(point(the mouseH, the mouseV), rect(174, 336, 224, 386)) and (getAt(virTracklIst, 6) <> -1) then
  78.                   set N to getAt(virTracklIst, 6)
  79.                 else
  80.                   if inside(point(the mouseH, the mouseV), rect(467, 216, 517, 266)) and (getAt(virTracklIst, 3) <> -1) then
  81.                     set N to getAt(virTracklIst, 3)
  82.                   else
  83.                     if inside(point(the mouseH, the mouseV), rect(123, 216, 173, 266)) and (getAt(virTracklIst, 7) <> -1) then
  84.                       set N to getAt(virTracklIst, 7)
  85.                     end if
  86.                   end if
  87.                 end if
  88.               end if
  89.             end if
  90.           end if
  91.         end if
  92.       end if
  93.       if N then
  94.         set fullName to line N of field "song"
  95.         repeat with i = 1 to 4
  96.           delete word 1 of fullName
  97.           if char 1 of fullName = " " then
  98.             delete char 1 of fullName
  99.           end if
  100.         end repeat
  101.         put fullName into field "fieldFullName"
  102.       else
  103.         if not gTraccia then
  104.           put " " into field "fieldFullName"
  105.         else
  106.           if getAt(virTracklIst, gTraccia) = -1 then
  107.             put " " into field "fieldFullName"
  108.           else
  109.             set fullName to line getAt(virTracklIst, gTraccia) of field "song"
  110.             repeat with i = 1 to 4
  111.               delete word 1 of fullName
  112.               if char 1 of fullName = " " then
  113.                 delete char 1 of fullName
  114.               end if
  115.             end repeat
  116.             put fullName into field "fieldFullName"
  117.           end if
  118.         end if
  119.       end if
  120.   end case
  121.   if not (the editable of member "fieldBpm") then
  122.     if (field "fieldBpm" < (4 * gBpmSong / 5)) or (field "fieldBpm" > (6 * gBpmSong / 5)) then
  123.       put gBpmSong into field "fieldBpm"
  124.       set the textFont of member "fieldBpm" to "IK10"
  125.       set the foreColor of member "fieldBpm" to gGreen
  126.       set the locH of sprite 24 to 321
  127.       set the locV of sprite 24 to 449
  128.       updateStage()
  129.       IKMixBPM(gBpmSong * 1000)
  130.     end if
  131.   end if
  132.   if the visible of window "Help" then
  133.     moveHelp()
  134.     showGrooveMessage()
  135.     if rollOver(53) then
  136.       tell window "help"
  137.         go("grooveM10")
  138.       end tell
  139.     end if
  140.   end if
  141.   if gClose then
  142.     set gClose to 0
  143.     scrollByLine(member "fieldAudio", 1)
  144.     scrollByLine(member "fieldAudio", -1)
  145.   end if
  146.   if gOnSynth then
  147.     set the visible of sprite 52 to 1
  148.     set the visible of sprite 51 to 0
  149.   else
  150.     if windowPresent("synth") then
  151.       set the visible of sprite 51 to 1
  152.       set the visible of sprite 52 to 0
  153.     end if
  154.   end if
  155.   if getAt(tapList, 2) then
  156.     if (the timer - getAt(tapList, 2)) > 80 then
  157.       puppetSprite(26, 0)
  158.     end if
  159.   else
  160.     if getAt(tapList, 1) then
  161.       if (the timer - getAt(tapList, 1)) > 80 then
  162.         puppetSprite(26, 0)
  163.       end if
  164.     end if
  165.   end if
  166.   if the visible of window "synth" then
  167.     set pos to point(the mouseH + the stageLeft, the mouseV + the stageTop)
  168.     if inside(pos, the rect of window "synth") and the mouseDown then
  169.       set m to the mouseH + the stageLeft - getAt(the rect of window "synth", 1)
  170.       set N to the mouseV + the stageTop - getAt(the rect of window "synth", 2)
  171.       repeat while the mouseDown
  172.         set the rect of window "synth" to rect(the mouseH + the stageLeft - m, the mouseV + the stageTop - N, 318 + the mouseH + the stageLeft - m, 72 + the mouseV + the stageTop - N)
  173.         updateStage()
  174.       end repeat
  175.       set gPosSynth to the rect of window "synth"
  176.     end if
  177.   end if
  178.   if gloadGroove <> VOID then
  179.     if (gloadGroove <> EMPTY) and (FileExists(gloadGroove) = 0) then
  180.       loadGroove()
  181.     end if
  182.   end if
  183.   if gYesDel then
  184.     set gYesDel to 0
  185.     IKBeginBlock()
  186.     repeat with i = 1 to 8
  187.       if getAt(virTracklIst, i) <> -1 then
  188.         IKPlay(i, -1)
  189.         put "=" into word 1 of line getAt(virTracklIst, i) of field "fieldAudio"
  190.         puppetSprite(12, 0)
  191.         put EMPTY into field "fieldRandom"
  192.       end if
  193.     end repeat
  194.     IKEndBlock()
  195.     set stateTrackList to ["off", "off", "off", "off", "off", "off", "off", "off"]
  196.     set virTracklIst to [-1, -1, -1, -1, -1, -1, -1, -1]
  197.     set volValList to [64, 64, 64, 64, 64, 64, 64, 64]
  198.     set volPosList to [239, 239, 239, 239, 239, 239, 239, 239]
  199.     set panValList to [64, 64, 64, 64, 64, 64, 64, 64]
  200.     set panPosList to [239, 239, 239, 239, 239, 239, 239, 239]
  201.     set keepList to [0, 0, 0, 0, 0, 0, 0, 0]
  202.     set soloGroupList to [0, 0, 0, 0, 0, 0, 0, 0]
  203.     put " " into field "fieldFullName"
  204.     set gTraccia to 0
  205.     set the foreColor of field "fieldAudio" to gGreen
  206.     if gSolo then
  207.       set gSolo to 0
  208.     end if
  209.   end if
  210.   if gYes then
  211.     set gYes to 0
  212.     if gOnSynth then
  213.       IKSynthStop()
  214.       set gOnSynth to 0
  215.     end if
  216.     if the visible of window "synth" then
  217.       close(window "synth")
  218.     end if
  219.     set markerSynthList to []
  220.     set keepList to [0, 0, 0, 0, 0, 0, 0, 0]
  221.     IKStop()
  222.     go("start", "menuSong")
  223.   end if
  224.   if gSolo then
  225.     set the memberNum of sprite 11 to the number of member "Hsolo"
  226.   else
  227.     set the memberNum of sprite 11 to the number of member "solo"
  228.   end if
  229.   updateStage()
  230.   if stateTrackList = ["off", "off", "off", "off", "off", "off", "off", "off"] then
  231.     repeat with i = 1 to 8
  232.       set controlT to "controlT" & i
  233.       set the memberNum of sprite (40 + i) to the number of member controlT
  234.       updateStage()
  235.     end repeat
  236.     set the memberNum of sprite 39 to 1000
  237.     updateStage()
  238.     put EMPTY into field "fieldBarBeat"
  239.   end if
  240.   if gOn and (virTracklIst <> [-1, -1, -1, -1, -1, -1, -1, -1]) then
  241.     set valore to IKGetCurrentBeat()
  242.     if valore <> -1 then
  243.       set beat to (valore mod 4) + 1
  244.       set temp to (valore / 4) + 1
  245.       if gSync then
  246.         if (the timer mod 80) < 40 then
  247.           set the memberNum of sprite 54 to the number of member "HRledSync"
  248.         else
  249.           set the memberNum of sprite 54 to the number of member "ledSync"
  250.         end if
  251.         updateStage()
  252.         if temp = 1 then
  253.           set the memberNum of sprite 54 to the number of member "ledSync"
  254.           updateStage()
  255.           set gSync to 0
  256.         end if
  257.       else
  258.         set gFirstClick to 1
  259.       end if
  260.       if beat <> word 2 of field "fieldBarBeat" then
  261.         put beat into word 2 of field "fieldBarBeat"
  262.       end if
  263.       if temp <> word 1 of field "fieldBarBeat" then
  264.         put temp & "      " & beat into field "fieldBarBeat"
  265.       end if
  266.       set bar to "bar" & word 1 of field "fieldBarBeat"
  267.       set the memberNum of sprite 39 to the number of member bar
  268.       set the loc of sprite 39 to point(320, 240)
  269.       updateStage()
  270.     end if
  271.     set the textFont of member "fieldBarBeat" to "IK10"
  272.     set the foreColor of member "fieldBarBeat" to gGreen
  273.   else
  274.     set the memberNum of sprite 39 to 1000
  275.     updateStage()
  276.   end if
  277.   repeat with i = 1 to 8
  278.     if getAt(virTracklIst, i) <> -1 then
  279.       set barra to "barraVol" & i & getAt(volValList, i) / 8
  280.       set the memberNum of sprite (13 + i) to the number of member barra
  281.       case i of
  282.         1:
  283.           set the loc of sprite 14 to point(320, 131)
  284.         2:
  285.           set the loc of sprite 15 to point(396, 163)
  286.         3:
  287.           set the loc of sprite 16 to point(429, 240)
  288.         4:
  289.           set the loc of sprite 17 to point(396, 316)
  290.         5:
  291.           set the loc of sprite 18 to point(320, 349)
  292.         6:
  293.           set the loc of sprite 19 to point(243, 316)
  294.         7:
  295.           set the loc of sprite 20 to point(211, 240)
  296.         8:
  297.           set the loc of sprite 21 to point(243, 163)
  298.       end case
  299.     else
  300.       set the memberNum of sprite (13 + i) to 2000
  301.     end if
  302.     updateStage()
  303.   end repeat
  304.   if gBpmPall then
  305.     if the mouseDown then
  306.       set x to the mouseH
  307.       if x > 396 then
  308.         set x to 395
  309.       end if
  310.       if x < 246 then
  311.         set x to 246
  312.       end if
  313.       set the locH of sprite 24 to x
  314.       set the locV of sprite 24 to 449
  315.       updateStage()
  316.     else
  317.       set gBpmPall to 0
  318.     end if
  319.     set bpm to (float(4 * (the locH of sprite 24 - 321) / 15) * gBpmSong / float(100)) + gBpmSong
  320.     IKMixBPM(bpm * 1000)
  321.     put bpm into field "fieldBpm"
  322.     set the textFont of member "fieldBpm" to "IK10"
  323.     set the foreColor of member "fieldBpm" to gGreen
  324.   end if
  325.   if gOnVol then
  326.     if the mouseDown then
  327.       set y to the mouseV
  328.       if y < 168 then
  329.         set y to 168
  330.       end if
  331.       if y > 310 then
  332.         set y to 310
  333.       end if
  334.       set the loc of sprite 3 to point(529, y)
  335.       updateStage()
  336.       setAt(volPosList, gTraccia, the locV of sprite 3)
  337.       set vol to 128 / power(1.02150000000000007, 142) * power(1.02150000000000007, ((-141 * the locV of sprite 3) + 142 + (310 * 141)) / 142)
  338.       if integer(vol) = 6 then
  339.         set vol to 0
  340.       end if
  341.       if integer(vol) = 123 then
  342.         set vol to 128
  343.       end if
  344.       setAt(volValList, gTraccia, integer(vol))
  345.       IKVolume(gTraccia, vol)
  346.     else
  347.       set gOnVol to 0
  348.     end if
  349.   end if
  350.   if gOnPan then
  351.     if the mouseDown then
  352.       set y to the mouseV
  353.       if y < 163 then
  354.         set y to 163
  355.       end if
  356.       if y > 315 then
  357.         set y to 315
  358.       end if
  359.       set the loc of sprite 4 to point(543, y)
  360.       updateStage()
  361.       setAt(panPosList, gTraccia, y)
  362.       set pan to (getAt(panPosList, gTraccia) - 163) * 16 / 19
  363.       if pan = 128 then
  364.         set pan to 127
  365.       end if
  366.       setAt(panValList, gTraccia, integer(pan))
  367.       IKPan(gTraccia, pan)
  368.     else
  369.       set gOnPan to 0
  370.     end if
  371.   end if
  372.   if gYesQuit then
  373.     uscita()
  374.     go("exit")
  375.   end if
  376.   if gYesDelUser then
  377.     set gYesDelUser to 0
  378.     delUser(gDelUser)
  379.   end if
  380. end
  381.