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 / 00181.ls < prev    next >
Encoding:
Text File  |  1999-09-17  |  2.6 KB  |  75 lines

  1. on exitFrame
  2.   go(the frame)
  3. end
  4.  
  5. on enterFrame
  6.   global gOn, gOnSynth, gPath, gArp, gProg, gPosVolSynth, gPosPanSynth, gBlue, gLoadSynth, folderSynthList, progList, synthList
  7.   if gOn and gOnSynth then
  8.     if the visible of sprite 3 then
  9.       set the visible of sprite 3 to 0
  10.     end if
  11.   else
  12.     if not (the visible of sprite 3) then
  13.       set the visible of sprite 3 to 1
  14.     end if
  15.   end if
  16.   if the visible of window "openS" then
  17.     if (field "fieldSynth" = EMPTY) and (folderSynthList <> []) then
  18.       put getAt(folderSynthList, 1) into field "fieldSynth"
  19.       set the textFont of field "fieldSynth" to "IK10"
  20.       set the foreColor of member "fieldSynth" to gBlue
  21.       updateStage()
  22.     end if
  23.     if (field "fieldSynth" <> EMPTY) and (folderSynthList = []) then
  24.       put EMPTY into field "fieldSynth"
  25.       set the textFont of field "fieldSynth" to "IK10"
  26.       set the foreColor of member "fieldSynth" to gBlue
  27.       updateStage()
  28.       IKSynthStop()
  29.       repeat with i = 1 to 3
  30.         set start to (12 * (i - 1)) + 3
  31.         repeat with j = 1 to 12
  32.           if char 1 of the name of member the memberNum of sprite (start + j) = "y" then
  33.             set nota to chars(the name of member the memberNum of sprite (start + j), 2, length(the name of member the memberNum of sprite (start + j))) & i
  34.             if getPos(synthList, nota) then
  35.               set nota to chars(nota, 1, length(nota) - 1)
  36.               set the memberNum of sprite (start + j) to the number of member nota
  37.               updateStage()
  38.             end if
  39.           end if
  40.         end repeat
  41.       end repeat
  42.       set synthList to []
  43.       set gOnSynth to 0
  44.     end if
  45.     if (field "fieldSynth" <> EMPTY) and (folderSynthList <> []) then
  46.       if not getPos(folderSynthList, field "fieldSynth") then
  47.         put getAt(folderSynthList, 1) into field "fieldSynth"
  48.         set the textFont of field "fieldSynth" to "IK10"
  49.         set the foreColor of member "fieldSynth" to gBlue
  50.         updateStage()
  51.         IKSynthStop()
  52.         IKSetSynth(gPath & "Synth\" & field "fieldSynth" & "\")
  53.         case char 1 of gArp of
  54.           "[":
  55.             set arp to 1
  56.           "]":
  57.             set arp to 2
  58.           "{":
  59.             set arp to 4
  60.           "}":
  61.             set arp to 8
  62.         end case
  63.         IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
  64.         IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
  65.         IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
  66.       end if
  67.     end if
  68.   end if
  69.   if gLoadSynth <> VOID then
  70.     if (gLoadSynth <> EMPTY) and (FileExists(gLoadSynth) = 0) then
  71.       loadSynth()
  72.     end if
  73.   end if
  74. end
  75.