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 / 00344.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  18.3 KB  |  512 lines

  1. on clickTrack
  2.   global gTraccia, gpag, gSolo, gGrooveSel, gRed, gBlue, stateTrackList, volPosList, panPosList, soloGroupList
  3.   set gGrooveSel to 0
  4.   set the locV of sprite 3 to getAt(volPosList, gTraccia)
  5.   set the locV of sprite 4 to getAt(panPosList, gTraccia)
  6.   updateStage()
  7.   if getAt(stateTrackList, gTraccia) <> "off" then
  8.     set q to getAt(virTracklIst, gTraccia) / 20
  9.     set r to getAt(virTracklIst, gTraccia) mod 20
  10.     case r of
  11.       0:
  12.         scrollByLine(member "fieldAudio", 20 * (q - gpag))
  13.         set gpag to q
  14.       otherwise:
  15.         scrollByLine(member "fieldAudio", 20 * (q + 1 - gpag))
  16.         set gpag to q + 1
  17.     end case
  18.   end if
  19.   if not gSolo and the controlDown and (getAt(virTracklIst, gTraccia) <> -1) then
  20.     setAt(soloGroupList, gTraccia, not getAt(soloGroupList, gTraccia))
  21.     if getAt(soloGroupList, gTraccia) then
  22.       set nome to the name of member the memberNum of sprite (40 + gTraccia) & "S"
  23.     else
  24.       set nome to chars(the name of member the memberNum of sprite (40 + gTraccia), 1, length(the name of member the memberNum of sprite (40 + gTraccia)) - 1)
  25.     end if
  26.     set the memberNum of sprite (40 + gTraccia) to the number of member nome
  27.     updateStage()
  28.   end if
  29.   repeat with i = 9 to 10
  30.     set the visible of sprite i to 1
  31.   end repeat
  32.   set Hname to "Htraccia" & gTraccia
  33.   set the memberNum of sprite 12 to the number of member Hname
  34.   case gTraccia of
  35.     1:
  36.       set the loc of sprite 12 to point(320, 68)
  37.     2:
  38.       set the loc of sprite 12 to point(441, 119)
  39.     3:
  40.       set the loc of sprite 12 to point(491, 240)
  41.     4:
  42.       set the loc of sprite 12 to point(441, 361)
  43.     5:
  44.       set the loc of sprite 12 to point(320, 411)
  45.     6:
  46.       set the loc of sprite 12 to point(199, 361)
  47.     7:
  48.       set the loc of sprite 12 to point(148, 240)
  49.     8:
  50.       set the loc of sprite 12 to point(199, 119)
  51.   end case
  52.   if getAt(virTracklIst, gTraccia) <> -1 then
  53.     set N to getAt(virTracklIst, gTraccia)
  54.     set the foreColor of word 2 of line N of field "fieldAudio" to gBlue
  55.     set fullName to line N of field "song"
  56.     repeat with i = 1 to 4
  57.       delete word 1 of fullName
  58.       if char 1 of fullName = " " then
  59.         delete char 1 of fullName
  60.       end if
  61.     end repeat
  62.     put fullName into field "fieldFullName"
  63.     set the textFont of member "fieldFullName" to "IK10"
  64.     set the foreColor of member "fieldFullName" to gRed
  65.   else
  66.     put " " into field "fieldFullName"
  67.   end if
  68. end
  69.  
  70. on clickRed
  71.   global gSolo, gOn, gArp, gProg, gOnSynth, gPosVolSynth, gPosPanSynth, gPath, stateTrackList, virTracklIst, volValList, redList, soloList, panValList, synthList, progList
  72.   if gSolo then
  73.     set gSolo to 0
  74.     set soloList to [0, 0, 0, 0, 0, 0, 0, 0]
  75.   end if
  76.   case gOn of
  77.     0:
  78.       set gOn to 1
  79.       puppetSprite(13, 0)
  80.       if redList = [0, 0, 0, 0, 0, 0, 0, 0] then
  81.         repeat with i = 1 to 8
  82.           if getAt(stateTrackList, i) <> "off" then
  83.             IKVolume(i, getAt(volValList, i))
  84.             IKPan(i, getAt(panValList, i))
  85.             IKPlay(i, getAt(virTracklIst, i))
  86.             setAt(stateTrackList, i, "on")
  87.             if getAt(soloGroupList, i) then
  88.               set onT to "on" & i & "S"
  89.             else
  90.               set onT to "on" & i
  91.             end if
  92.             set the memberNum of sprite (40 + i) to the number of member onT
  93.             updateStage()
  94.           end if
  95.         end repeat
  96.       else
  97.         repeat with i = 1 to 8
  98.           if getAt(redList, i) then
  99.             IKVolume(i, getAt(volValList, i))
  100.             IKPan(i, getAt(panValList, i))
  101.             IKPlay(i, getAt(virTracklIst, i))
  102.             setAt(stateTrackList, i, "on")
  103.             setAt(redList, i, 0)
  104.             if getAt(soloGroupList, i) then
  105.               set onT to "on" & i & "S"
  106.             else
  107.               set onT to "on" & i
  108.             end if
  109.             set the memberNum of sprite (40 + i) to the number of member onT
  110.             updateStage()
  111.           end if
  112.         end repeat
  113.       end if
  114.     1:
  115.       set gOn to 0
  116.       set gOnSynth to 0
  117.       puppetSprite(13, 1)
  118.       IKBeginBlock()
  119.       repeat with i = 1 to 8
  120.         if (getAt(stateTrackList, i) = "on") or (getAt(stateTrackList, i) = "solo") then
  121.           IKPlay(i, -1)
  122.           setAt(redList, i, 1)
  123.           setAt(stateTrackList, i, "mute")
  124.           if getAt(soloGroupList, i) then
  125.             set mute to "mute" & i & "S"
  126.           else
  127.             set mute to "mute" & i
  128.           end if
  129.           set the memberNum of sprite (40 + i) to the number of member mute
  130.           updateStage()
  131.           next repeat
  132.         end if
  133.         setAt(redList, i, 0)
  134.       end repeat
  135.       IKEndBlock()
  136.       IKSynthStop()
  137.       IKStop()
  138.       IKFunction()
  139.   end case
  140. end
  141.  
  142. on clickMarker
  143.   global virTracklIst, volValList, volPosList, stateTrackList, panValList, panPosList, audioList
  144.   if the lineCount of member "grooveMem" < 99 then
  145.     set spento to 0
  146.     repeat with i = 1 to 8
  147.       if (getAt(stateTrackList, i) = "on") or (getAt(stateTrackList, i) = "solo") then
  148.         case length(string(getAt(volValList, i))) of
  149.           1:
  150.             set volVal to "00" & getAt(volValList, i)
  151.           2:
  152.             set volVal to "0" & getAt(volValList, i)
  153.           3:
  154.             set volVal to getAt(volValList, i)
  155.         end case
  156.         case length(string(getAt(panValList, i))) of
  157.           1:
  158.             set panVal to "00" & getAt(panValList, i)
  159.           2:
  160.             set panVal to "0" & getAt(panValList, i)
  161.           3:
  162.             set panVal to getAt(panValList, i)
  163.         end case
  164.         put volVal & getAt(volPosList, i) & panVal & getAt(panPosList, i) & getAt(audioList, getAt(virTracklIst, i)) & " " after field "grooveMem"
  165.         next repeat
  166.       end if
  167.       put "0 " after field "grooveMem"
  168.       set spento to spento + 1
  169.     end repeat
  170.     if the lineCount of member "grooveMem" > 1 then
  171.       set linea1 to the last line in field "grooveMem"
  172.       set linea2 to line the lineCount of member "grooveMem" - 1 of field "grooveMem"
  173.     else
  174.       set linea1 to 1
  175.       set linea2 to 2
  176.     end if
  177.     if (spento = 8) or (linea1 = linea2) then
  178.       delete char -30003 of field "grooveMem"
  179.       put RETURN after field "grooveMem"
  180.     else
  181.       put RETURN after field "grooveMem"
  182.       case the lineCount of member "grooveMem" of
  183.         1, 2, 3, 4, 5, 6, 7, 8:
  184.           repeat with i = 1 to the lineCount of member "grooveMem"
  185.             puppetSprite(29 + i, 1)
  186.             set mNum to "g" & i
  187.             set the memberNum of sprite (29 + i) to the number of member mNum
  188.             updateStage()
  189.           end repeat
  190.         otherwise:
  191.           repeat with i = 1 to 8
  192.             puppetSprite(29 + i, 1)
  193.             set mNum to "g" & the lineCount of member "grooveMem" - 8 + i
  194.             set the memberNum of sprite (29 + i) to the number of member mNum
  195.             updateStage()
  196.           end repeat
  197.       end case
  198.     end if
  199.   end if
  200. end
  201.  
  202. on clickNameAudio numLine
  203.   global gTraccia, gSolo, gBlue, gRed, gSync, gGreen, stateTrackList, virTracklIst, panVolList, panPosList, volValList, volPosList
  204.   if gTraccia then
  205.     if word 1 of line numLine of field "fieldAudio" = "=" then
  206.       if getAt(virTracklIst, gTraccia) <> -1 then
  207.         put "=" into word 1 of line getAt(virTracklIst, gTraccia) of field "fieldAudio"
  208.         set the foreColor of line getAt(virTracklIst, gTraccia) of field "fieldAudio" to gGreen
  209.       end if
  210.       setAt(virTracklIst, gTraccia, numLine)
  211.       setAt(volValList, gTraccia, integer(word 2 of line getAt(virTracklIst, gTraccia) of field "song"))
  212.       setAt(volPosList, gTraccia, integer(log(power(1.02150000000000007, (142 + (310 * 141)) / 142) * 128 / (power(1.02150000000000007, 142) * getAt(volValList, gTraccia))) / log(1.02150000000000007)) + 2)
  213.       setAt(panValList, gTraccia, integer(word 3 of line getAt(virTracklIst, gTraccia) of field "song"))
  214.       setAt(panPosList, gTraccia, integer(163 + (19 * getAt(panValList, gTraccia) / 16)))
  215.       set the locV of sprite 3 to getAt(volPosList, gTraccia)
  216.       set the locV of sprite 4 to getAt(panPosList, gTraccia)
  217.       updateStage()
  218.       put gTraccia into word 1 of line numLine of field "fieldAudio"
  219.       set the foreColor of line numLine of field "fieldAudio" to gBlue
  220.       if getAt(stateTrackList, gTraccia) <> "mute" then
  221.         puppetSprite(40 + gTraccia, 1)
  222.         if not gSolo then
  223.           set num to "on" & gTraccia
  224.           setAt(stateTrackList, gTraccia, "on")
  225.         else
  226.           set num to "solo" & gTraccia
  227.           setAt(stateTrackList, gTraccia, "solo")
  228.           repeat with i = 1 to 8
  229.             if getAt(stateTrackList, i) = "on" then
  230.               IKPlay(i, -1)
  231.               set mute to "mute" & i
  232.               setAt(stateTrackList, i, "mute")
  233.               set the memberNum of sprite (40 + i) to the number of member mute
  234.             end if
  235.           end repeat
  236.         end if
  237.         set the memberNum of sprite (40 + gTraccia) to the number of member num
  238.         updateStage()
  239.         if the controlDown then
  240.           set gSync to 1
  241.           set the memberNum of sprite 54 to the number of member "HRledSync"
  242.           updateStage()
  243.         end if
  244.         if gSync then
  245.           IKVolumeSync2(gTraccia, getAt(volValList, gTraccia))
  246.           IKPanSync2(gTraccia, getAt(panValList, gTraccia))
  247.           IKPlaySync(gTraccia, getAt(virTracklIst, gTraccia))
  248.         else
  249.           IKVolumeSync(gTraccia, getAt(volValList, gTraccia))
  250.           IKPanSync(gTraccia, getAt(panValList, gTraccia))
  251.           IKPlay(gTraccia, getAt(virTracklIst, gTraccia))
  252.         end if
  253.       end if
  254.       set fullName to line getAt(virTracklIst, gTraccia) of field "song"
  255.       repeat with i = 1 to 4
  256.         delete word 1 of fullName
  257.         if char 1 of fullName = " " then
  258.           delete char 1 of fullName
  259.         end if
  260.       end repeat
  261.       put fullName into field "fieldFullName"
  262.       set the textFont of member "fieldFullName" to "IK10"
  263.       set the foreColor of member "fieldFullName" to gRed
  264.     end if
  265.   end if
  266.   if the memberNum of sprite 26 then
  267.     if (the name of member the memberNum of sprite 26 = "Hkeep") and (word 1 of line numLine of field "fieldAudio" <> "=") then
  268.       putKeep(numLine)
  269.     end if
  270.   end if
  271. end
  272.  
  273. on clickControlTrack traccia, spriteNum
  274.   global gSolo, gSync, stateTrackList, virTracklIst, volValList, panValList
  275.   if the controlDown then
  276.     set gSync to 1
  277.     set the memberNum of sprite 54 to the number of member "HRledSync"
  278.     updateStage()
  279.   end if
  280.   case gSolo of
  281.     0:
  282.       case getAt(stateTrackList, traccia) of
  283.         "on", "solo":
  284.           if gSync then
  285.             IKPlaySync(traccia, -1)
  286.           else
  287.             IKPlay(traccia, -1)
  288.           end if
  289.           set mute to "mute" & chars(the name of member the memberNum of sprite spriteNum, 3, length(the name of member the memberNum of sprite spriteNum))
  290.           set the memberNum of sprite spriteNum to the number of member mute
  291.           updateStage()
  292.           setAt(stateTrackList, traccia, "mute")
  293.         "mute":
  294.           IKVolumeSync(traccia, getAt(volValList, traccia))
  295.           IKPanSync(traccia, getAt(panValList, traccia))
  296.           if gSync then
  297.             IKPlaySync(traccia, getAt(virTracklIst, traccia))
  298.           else
  299.             IKPlay(traccia, getAt(virTracklIst, traccia))
  300.           end if
  301.           set onT to "on" & chars(the name of member the memberNum of sprite spriteNum, 5, length(the name of member the memberNum of sprite spriteNum))
  302.           set the memberNum of sprite spriteNum to the number of member onT
  303.           updateStage()
  304.           setAt(stateTrackList, traccia, "on")
  305.       end case
  306.     1:
  307.       case getAt(stateTrackList, traccia) of
  308.         "on", "mute":
  309.           set solo to "solo" & traccia
  310.           set the memberNum of sprite spriteNum to the number of member solo
  311.           setAt(stateTrackList, traccia, "solo")
  312.           IKVolumeSync(traccia, getAt(volValList, traccia))
  313.           IKPanSync(traccia, getAt(panValList, traccia))
  314.           if gSync then
  315.             IKPlaySync(traccia, getAt(virTracklIst, traccia))
  316.           else
  317.             IKPlay(traccia, getAt(virTracklIst, traccia))
  318.           end if
  319.           repeat with i = 1 to 8
  320.             if i <> traccia then
  321.               if getAt(stateTrackList, i) = "on" then
  322.                 set mute to "mute" & i
  323.                 set the memberNum of sprite (40 + i) to the number of member mute
  324.                 setAt(stateTrackList, i, "mute")
  325.                 if gSync then
  326.                   IKPlaySync(i, -1)
  327.                   next repeat
  328.                 end if
  329.                 IKPlay(i, -1)
  330.               end if
  331.             end if
  332.           end repeat
  333.         "solo":
  334.           if gSync then
  335.             IKPlaySync(traccia, -1)
  336.           else
  337.             IKPlay(traccia, -1)
  338.           end if
  339.           set mute to "mute" & traccia
  340.           set the memberNum of sprite (40 + traccia) to the number of member mute
  341.           setAt(stateTrackList, traccia, "mute")
  342.       end case
  343.   end case
  344. end
  345.  
  346. on clickSolo
  347.   global gSolo, gSync, gFirstClick, stateTrackList, soloList, volValList, panVolList, soloGroupList
  348.   if the controlDown then
  349.     set gSync to 1
  350.     set the memberNum of sprite 54 to the number of member "HRledSync"
  351.     updateStage()
  352.   end if
  353.   case gSolo of
  354.     1:
  355.       if soloList = [0, 0, 0, 0, 0, 0, 0, 0] then
  356.         repeat with i = 1 to 8
  357.           if getAt(stateTrackList, i) = "on" then
  358.             setAt(soloList, i, 1)
  359.             next repeat
  360.           end if
  361.           setAt(soloList, i, 0)
  362.         end repeat
  363.       end if
  364.       if soloGroupList <> [0, 0, 0, 0, 0, 0, 0, 0] then
  365.         repeat with i = 1 to 8
  366.           if getAt(virTracklIst, i) <> -1 then
  367.             case getAt(soloGroupList, i) of
  368.               0:
  369.                 setAt(stateTrackList, i, "mute")
  370.                 set mute to "mute" & i
  371.                 set the memberNum of sprite (40 + i) to the number of member mute
  372.                 if gSync then
  373.                   IKPlaySync(i, -1)
  374.                 else
  375.                   IKPlay(i, -1)
  376.                 end if
  377.               1:
  378.                 setAt(stateTrackList, i, "solo")
  379.                 set solo to "solo" & i
  380.                 set the memberNum of sprite (40 + i) to the number of member solo
  381.             end case
  382.             updateStage()
  383.           end if
  384.         end repeat
  385.         set gFirstClick to 0
  386.         set soloGroupList to [0, 0, 0, 0, 0, 0, 0, 0]
  387.       end if
  388.     0:
  389.       repeat with i = 1 to 8
  390.         if getAt(soloList, i) and (getAt(stateTrackList, i) <> "off") then
  391.           IKVolumeSync(i, getAt(volValList, i))
  392.           IKPanSync(i, getAt(panValList, i))
  393.           if gSync then
  394.             IKPlaySync(i, getAt(virTracklIst, i))
  395.           else
  396.             IKPlay(i, getAt(virTracklIst, i))
  397.           end if
  398.           setAt(stateTrackList, i, "on")
  399.           set onT to "on" & i
  400.           set the memberNum of sprite (40 + i) to the number of member onT
  401.           updateStage()
  402.           next repeat
  403.         end if
  404.         if getAt(stateTrackList, i) <> "off" then
  405.           if gSync then
  406.             IKPlaySync(i, -1)
  407.           else
  408.             IKPlay(i, -1)
  409.           end if
  410.           setAt(stateTrackList, i, "mute")
  411.           set mute to "mute" & i
  412.           set the memberNum of sprite (40 + i) to the number of member mute
  413.           updateStage()
  414.         end if
  415.       end repeat
  416.       set gFirstClick to 0
  417.       set soloList to [0, 0, 0, 0, 0, 0, 0, 0]
  418.   end case
  419. end
  420.  
  421. on delUser user
  422.   global gPath, gNumUser, gSong, virTracklIst, audioList, stateTrackList, minMaxGroupList, groupList
  423.   set vTrack to getPos(audioList, user)
  424.   IKSynthStop()
  425.   IKStop()
  426.   IKRemoveVTrack(vTrack)
  427.   IKFunction()
  428.   set nomeFile to gPath & "Song\" & gSong & "\" & user & ".wav"
  429.   IKChangeAttrib(nomeFile)
  430.   DeleteFile(nomeFile)
  431.   delete line vTrack of field "fieldAudio"
  432.   repeat with i = 1 to 8
  433.     if getAt(virTracklIst, i) > vTrack then
  434.       setAt(virTracklIst, i, getAt(virTracklIst, i) - 1)
  435.     end if
  436.   end repeat
  437.   deleteAt(audioList, vTrack)
  438.   set gNumUser to gNumUser - 1
  439.   delete line vTrack of field "song"
  440.   if gNumUser = 0 then
  441.     IKChangeAttrib(gPath & "Song\" & gSong & "\infoUs.gms")
  442.     DeleteFile(gPath & "Song\" & gSong & "\infoUs.gms")
  443.     set gms to gPath & "Song\" & gSong & "\info.gms"
  444.   else
  445.     set temp to IKCryptOpen(gPath & "Song\" & gSong & "\infoUs.gms")
  446.     set theFile to EMPTY
  447.     set stringTemp to IKCryptGets(temp)
  448.     repeat while stringTemp <> "**********"
  449.       set theFile to theFile & stringTemp & RETURN
  450.       set stringTemp to IKCryptGets(temp)
  451.     end repeat
  452.     IKCryptClose(temp)
  453.     if the last line in theFile = EMPTY then
  454.       delete char -30003 of theFile
  455.     end if
  456.     set N to 1
  457.     repeat while not offset(user, line N of theFile)
  458.       set N to N + 1
  459.     end repeat
  460.     delete line N of theFile
  461.     set N to 1
  462.     repeat while not offset("LONGCOMMAND: SONGTRACKS: ", line N of theFile)
  463.       set N to N + 1
  464.     end repeat
  465.     set newLine to line N of theFile
  466.     set tot to integer(the last word in newLine)
  467.     delete char -30001 of newLine
  468.     set newLine to newLine & tot - 1
  469.     put newLine into line N of theFile
  470.     repeat with j = 1 to count(minMaxGroupList)
  471.       set mi to integer(word 1 of getAt(minMaxGroupList, j))
  472.       set ma to integer(word 2 of getAt(minMaxGroupList, j))
  473.       if (vTrack >= mi) and (vTrack <= ma) then
  474.         exit repeat
  475.       end if
  476.     end repeat
  477.     setAt(minMaxGroupList, j, "mi " & ma - 1)
  478.     repeat with k = j + 1 to count(minMaxGroupList)
  479.       set mi to integer(word 1 of getAt(minMaxGroupList, k))
  480.       set ma to integer(word 2 of getAt(minMaxGroupList, k))
  481.       setAt(minMaxGroupList, k, mi - 1 && ma - 1)
  482.     end repeat
  483.     set N to 1
  484.     repeat while not offset("LONGCOMMAND: CATEGORYLIST: ", line N of theFile)
  485.       set N to N + 1
  486.     end repeat
  487.     repeat with k = 1 to integer(the last word in line N of theFile)
  488.       put getAt(groupList, k) && getAt(minMaxGroupList, k) into line N + k of theFile
  489.     end repeat
  490.     IKChangeAttrib(gPath & "Song\" & gSong & "\infoUs.gms")
  491.     DeleteFile(gPath & "Song\" & gSong & "\infoUs.gms")
  492.     set newFile to gPath & "Song\" & gSong & "\infoUs.gms"
  493.     set temp to IKCryptCreate(newFile)
  494.     repeat with k = 1 to the number of lines in theFile
  495.       set stringa to line k of theFile
  496.       IKCryptPuts(temp, stringa)
  497.     end repeat
  498.     IKCryptClose(temp)
  499.     set gms to gPath & "Song\" & gSong & "\infoUs.gms"
  500.   end if
  501.   readGms(gms)
  502.   IKBeginBlock()
  503.   repeat with i = 1 to 8
  504.     if (getAt(virTracklIst, i) <> -1) and (getAt(stateTrackList, i) <> "mute") then
  505.       IKVolume(i, getAt(volValList, i))
  506.       IKPan(i, getAt(panValList, i))
  507.       IKPlay(i, getAt(virTracklIst, i))
  508.     end if
  509.   end repeat
  510.   IKEndBlock()
  511. end
  512.