home *** CD-ROM | disk | FTP | other *** search
/ Computer Music Interactif 2 / cd.iso / mac / share / Funkit / FunKit / funkit16.Dxr / 00007.ls < prev    next >
Encoding:
Text File  |  1997-07-03  |  1.5 KB  |  54 lines

  1. on startup
  2.   global gDrumLength, gDrumList, gCurrentDrumBtn, gOnOff, gbanknum
  3.   set the cpuHogTicks to 10000
  4.   set hogcputicks to 3000
  5.   set gbanknum to 0
  6.   set gOnOff to 1
  7.   set gCurrentDrumBtn to 11
  8.   set gDrumList to the name of member 101 of castLib 2
  9.   set gDrumLength to calculatelooplength(101)
  10.   repeat with i = 11 to 16
  11.     set the cursor of sprite i to [307, 308]
  12.   end repeat
  13.   repeat with i = 17 to 28
  14.     set the cursor of sprite i to [303, 304]
  15.   end repeat
  16.   set the cursor of sprite 8 to [303, 304]
  17.   repeat with i = 31 to 33
  18.     set the cursor of sprite i to [307, 308]
  19.   end repeat
  20.   repeat with i = 1 to 3
  21.     set the volume of sound i to 255
  22.   end repeat
  23.   set the keyDownScript to "checkkeydown"
  24.   set the visible of sprite 36 to 1
  25.   repeat with i = 2 to 7
  26.     puppetSprite(i, 1)
  27.     set the visible of sprite i to 0
  28.   end repeat
  29.   set the cursor of sprite 48 to [307, 308]
  30.   puppetSprite(45, 1)
  31.   set the cursor of sprite 45 to [303, 304]
  32.   startTimer()
  33. end
  34.  
  35. on stopMovie
  36.   repeat with i = 11 to 22
  37.     puppetSprite(i, 0)
  38.   end repeat
  39.   repeat with i = 31 to 33
  40.     puppetSprite(i, 0)
  41.   end repeat
  42.   puppetSprite(42, 0)
  43. end
  44.  
  45. on calculatelooplength castNum
  46.   set bitdepth to the sampleSize of member castNum of castLib 2 / 8
  47.   set Srate to the sampleRate of member castNum of castLib 2
  48.   set Ssize to the size of member castNum of castLib 2
  49.   set Ssize to Ssize + 0.0
  50.   set seconds to Ssize / Srate / bitdepth
  51.   set thelooplength to integer(seconds * 60)
  52.   return thelooplength
  53. end
  54.