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

  1. on mouseEnter
  2.   if the visible of window "Help" then
  3.     tell window "help"
  4.       go("synth1")
  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 mouseDown
  18.   global gOn
  19.   if gOn and (char 1 of the name of member the memberNum of sprite the clickOn <> "m") and not (the visible of window "help") then
  20.     set the locH of sprite 74 to the locH of sprite the clickOn + 1
  21.   end if
  22. end
  23.  
  24. on mouseUp
  25.   global gOnSynth, gArp, gProg, gPath, gOn, gPosVolSynth, gPosPanSynth, gSynthSel, synthList, markerSynthList, progList, paramList
  26.   if gOn and not (the visible of window "help") then
  27.     if char 1 of the name of member the memberNum of sprite the clickOn <> "m" then
  28.       set gSynthSel to integer(the name of member the memberNum of sprite the clickOn)
  29.       if not gOnSynth then
  30.         set gOnSynth to 1
  31.       end if
  32.       set synthList to []
  33.       repeat with k = 1 to count(getAt(markerSynthList, integer(the name of member the memberNum of sprite the clickOn)))
  34.         append(synthList, getAt(getAt(markerSynthList, integer(the name of member the memberNum of sprite the clickOn)), k))
  35.       end repeat
  36.       repeat with i = 1 to 3
  37.         set start to (12 * (i - 1)) + 3
  38.         repeat with j = 1 to 12
  39.           set nota to the name of member the memberNum of sprite (start + j)
  40.           if char 1 of nota = "y" then
  41.             set nota to chars(nota, 2, length(nota)) & i
  42.             if not getPos(synthList, nota) then
  43.               set nota to chars(nota, 1, length(nota) - 1)
  44.               set the memberNum of sprite (start + j) to the number of member nota
  45.               updateStage()
  46.             end if
  47.             next repeat
  48.           end if
  49.           set nota to nota & i
  50.           if getPos(synthList, nota) then
  51.             set nota to "y" & chars(nota, 1, length(nota) - 1)
  52.             set the memberNum of sprite (start + j) to the number of member nota
  53.             updateStage()
  54.           end if
  55.         end repeat
  56.       end repeat
  57.       set temp to getAt(paramList, integer(the name of member the memberNum of sprite the clickOn))
  58.       if field "fieldSynth" <> getAt(temp, 1) then
  59.         IKSynthStop()
  60.         put getAt(temp, 1) into field "fieldSynth"
  61.         IKSetSynth(gPath & "Synth\" & field "fieldSynth" & "\")
  62.       end if
  63.       set gArp to getAt(temp, 2)
  64.       set gProg to getAt(temp, 3)
  65.       put getAt(temp, 3) into field "fieldProg"
  66.       put getAt(temp, 2) into field "fieldArp"
  67.       put getAt(temp, 1) into field "fieldSynth"
  68.       set gPosVolSynth to getAt(temp, 4)
  69.       set gPosPanSynth to getAt(temp, 5)
  70.       set the locV of sprite 45 to gPosVolSynth
  71.       set the locV of sprite 46 to gPosPanSynth
  72.       updateStage()
  73.       case char 1 of gArp of
  74.         "[":
  75.           set arp to 1
  76.         "]":
  77.           set arp to 2
  78.         "{":
  79.           set arp to 4
  80.         "}":
  81.           set arp to 8
  82.       end case
  83.       IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
  84.       IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
  85.       IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
  86.     end if
  87.   end if
  88. end
  89.  
  90. on rightMouseDown
  91.   global gOn, gSynthSel, prima
  92.   if gOn then
  93.     if (char 1 of the name of member the memberNum of sprite the clickOn <> "m") and (gSynthSel <> integer(the name of member the memberNum of sprite the clickOn)) then
  94.       set the memberNum of sprite 88 to the number of member the memberNum of sprite the clickOn
  95.       set the ink of sprite 88 to 36
  96.       set the visible of sprite the clickOn to 0
  97.       repeat while the mouseDown
  98.         set the locH of sprite 88 to the mouseH
  99.         set the locV of sprite 88 to the mouseV
  100.         updateStage()
  101.       end repeat
  102.     end if
  103.     set prima to 0
  104.   end if
  105. end
  106.  
  107. on rightMouseUp
  108.   global gOn, gFirstSynth, gLastSynth, gLastSprite, gSynthSel, prima, markerSynthList, posRectList, paramList
  109.   if gOn then
  110.     set prima to prima + 1
  111.     if prima = 1 then
  112.       set newPos to point(the mouseH, the mouseV)
  113.       set numero to integer(the name of member the memberNum of sprite the clickOn)
  114.       if inside(newPos, getAt(getAt(posRectList, the clickOn - 67), 2)) then
  115.         set the loc of sprite the clickOn to getAt(getAt(posRectList, the clickOn - 67), 1)
  116.         updateStage()
  117.       else
  118.         if gSynthSel > numero then
  119.           set gSynthSel to gSynthSel - 1
  120.           set the locH of sprite 74 to the locH of sprite 74 - 12
  121.         end if
  122.         deleteAt(markerSynthList, numero)
  123.         deleteAt(paramList, numero)
  124.         repeat with i = 68 to 73
  125.           set the memberNum of sprite i to the number of member "m"
  126.         end repeat
  127.         case count(markerSynthList) of
  128.           0:
  129.             set gLastSynth to 0
  130.             set gFirstSynth to 0
  131.             set gLastSprite to 67
  132.           otherwise:
  133.             if count(markerSynthList) < 6 then
  134.               repeat with i = 1 to count(markerSynthList)
  135.                 set the memberNum of sprite (67 + i) to the number of member string(i)
  136.               end repeat
  137.               set gLastSprite to gLastSprite - 1
  138.             else
  139.               repeat with i = 6 down to 1
  140.                 set the memberNum of sprite (67 + i) to the number of member string(count(markerSynthList) - 6 + i)
  141.               end repeat
  142.               set gLastSprite to 73
  143.             end if
  144.             set gFirstSynth to integer(the name of member the memberNum of sprite 68)
  145.             set gLastSynth to integer(the name of member the memberNum of sprite gLastSprite)
  146.         end case
  147.       end if
  148.       set the loc of sprite the clickOn to getAt(getAt(posRectList, the clickOn - 67), 1)
  149.       updateStage()
  150.     end if
  151.     set the visible of sprite the clickOn to 1
  152.     set the memberNum of sprite 88 to 1000
  153.     updateStage()
  154.   end if
  155. end
  156.