if inside(the clickLoc, rect(368, 100, 375, 106)) and (the lineCount of member "grooveMem" > 8) and (the name of member the memberNum of sprite 18 <> ("g" & string(the lineCount of member "grooveMem"))) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HnextGrooveSeq"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(370, 104)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(174, 139, 181, 146)) and (chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11)) <> "1") then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HpreviousGrooveSeq"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(175, 143)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(376, 115, 384, 121)) and (char 1 of the name of member the memberNum of sprite 3 <> "a") then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HnextMarker"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(378, 120)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(201, 173, 209, 180)) and (gfirstmarker > 1) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HpreviousMarker"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(204, 178)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(175, 326, 192, 343)) and (markerList <> []) and gMix then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "Hmix"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(182, 335)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(567, 372, 634, 387)) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HsongMenu"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(601, 381)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(567, 393, 634, 408)) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "Hgroove"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(601, 401)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(567, 433, 634, 448)) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "HvMix"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(601, 441)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(592, 453, 611, 471)) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "Hpref"
set the ink of sprite 10 to 36
set the loc of sprite 10 to point(602, 464)
updateStage()
end repeat
pass()
end if
if inside(the clickLoc, rect(615, 453, 634, 471)) then
repeat while the mouseDown
set the memberNum of sprite 10 to the number of member "Hquit"
if inside(point(the mouseH, the mouseV), rect(174, 139, 181, 146)) and (chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11)) <> "1") and (the lineCount of member "grooveMem" > 8) then
if gGrooveSel <> 0 then
set gN to "g" & gGrooveSel
repeat with i = 1 to 8
if char 1 of the name of member the memberNum of sprite (10 + i) = "H" then
set the memberNum of sprite (10 + i) to the number of member gN
updateStage()
exit repeat
end if
end repeat
end if
set pN to chars(the name of member the memberNum of sprite 18, 2, length(the name of member the memberNum of sprite 18))
repeat with j = 1 to 8
set gN to "g" & integer(pN - j)
set the memberNum of sprite (19 - j) to the number of member gN
end repeat
set pNum to integer(chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11)))
if (pNum <= gGrooveSel) and ((pNum + 7) >= gGrooveSel) then
set Hn to "H" & gGrooveSel
set the memberNum of sprite (11 + gGrooveSel - pNum) to the number of member Hn
updateStage()
end if
pass()
end if
if inside(point(the mouseH, the mouseV), rect(368, 100, 375, 106)) and (the lineCount of member "grooveMem" > 8) and (integer(chars(the name of member the memberNum of sprite 18, 2, length(the name of member the memberNum of sprite 18))) <> the lineCount of member "grooveMem") then
if gGrooveSel <> 0 then
set gN to "g" & gGrooveSel
repeat with i = 1 to 8
if char 1 of the name of member the memberNum of sprite (10 + i) = "H" then
set the memberNum of sprite (10 + i) to the number of member gN
updateStage()
exit repeat
end if
end repeat
end if
set pN to chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11))
repeat with j = 1 to 8
set gN to "g" & integer(pN + j)
set the memberNum of sprite (10 + j) to the number of member gN
end repeat
set pNum to integer(chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11)))
if (pNum <= gGrooveSel) and ((pNum + 7) >= gGrooveSel) then
set Hn to "H" & gGrooveSel
set the memberNum of sprite (11 + gGrooveSel - pNum) to the number of member Hn
updateStage()
end if
pass()
end if
if inside(point(the mouseH, the mouseV), rect(376, 115, 384, 121)) and (gfirstmarker <> glastmarker) then
repeat with i = 2 to glastmarker - gfirstmarker + 1
if ((gfirstmarker + i - 1) <= glastmarker) and ((gfirstmarker + i - 1) <= count(markerList)) then
set gN to "g" & getAt(markerList, gfirstmarker + i - 1)
set the memberNum of sprite i to the number of member gN
else
exit repeat
end if
updateStage()
end repeat
set gfirstmarker to gfirstmarker + 1
if (count(markerList) <= 8) or (glastmarker = count(markerList)) then
set the memberNum of sprite i to the number of member "marker"
else
set glastmarker to glastmarker + 1
if glastmarker <= count(markerList) then
set gN to "g" & getAt(markerList, glastmarker)
set the memberNum of sprite i to the number of member gN
else
set glastmarker to glastmarker - 1
set the memberNum of sprite i to the number of member "marker"
end if
end if
updateStage()
pass()
end if
if inside(point(the mouseH, the mouseV), rect(201, 173, 209, 180)) and (gfirstmarker > 1) then
repeat with i = glastmarker - gfirstmarker + 1 down to 1
if (i + 2) <= 9 then
set the memberNum of sprite (i + 2) to the memberNum of sprite (i + 1)
updateStage()
end if
end repeat
set gN to "g" & getAt(markerList, gfirstmarker - 1)
set the memberNum of sprite 2 to the number of member gN
set gfirstmarker to gfirstmarker - 1
if (glastmarker - gfirstmarker + 1) > 8 then
set glastmarker to glastmarker - 1
end if
pass()
end if
if inside(point(the mouseH, the mouseV), rect(175, 326, 192, 343)) and (markerList <> []) and gMix then
set durata to count(markerList) * 32 * 60 / float(field "fieldBpm")
set durata to durata * 44100 * 4
if not gQMix then
set numMaxTrack to 0
repeat with i = 1 to count(markerList)
set numTrack to 0
repeat with j = 1 to 8
set audio to word j of line getAt(markerList, i) of field "grooveMem"
if (audio <> "0") and getPos(audioList, audio) then
set numTrack to numTrack + 1
end if
end repeat
set numMaxTrack to max(numMaxTrack, numTrack)
end repeat
set durata to durata * numMaxTrack
end if
if IKGetFreeDiskSpace(chars(gPath, 1, offset("\", gPath))) < (durata / 1000) then
openWin("Message")
tell window "Message"
go("7")
end tell
else
mix()
end if
pass()
end if
if inside(point(the mouseH, the mouseV), rect(567, 372, 634, 387)) then
openWin("YesNo")
tell window "YesNo"
go("newSong")
end tell
pass()
end if
if inside(point(the mouseH, the mouseV), rect(567, 393, 634, 408)) then
set gFirstNum to chars(the name of member the memberNum of sprite 11, 2, length(the name of member the memberNum of sprite 11))
repeat with i = 2 to 19
puppetSprite(i, 0)
end repeat
puppetSprite(39, 1)
set the memberNum of sprite 39 to 1000
set the loc of sprite 39 to point(320, 240)
set the foreColor of field "fieldMarkerSeq" to 0
go("groove")
set the visible of sprite 20 to 1
put integer(word 1 of field "fieldBarBeat") into word 1 of field "fieldBarBeat"
set bpm to float(field "fieldBpm")
set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
set the locV of sprite 24 to 449
updateStage()
IKBeginBlock()
repeat with i = 1 to 8
case getAt(stateTrackList, i) of
"on":
puppetSprite(40 + i, 1)
set onT to "on" & i
set the memberNum of sprite (40 + i) to the number of member onT
updateStage()
IKVolume(i, getAt(volValList, i))
IKPan(i, getAt(panValList, i))
IKPlay(i, getAt(virTracklIst, i))
end case
end repeat
IKEndBlock()
if gPlaySeq then
set gPlaySeq to 0
set gGrooveSel to integer(word gCont of field "fieldMarkerSeq")
end if
if IKGetCurrentBeat() = -1 then
set gRandom to getAt(randomizeList, random(count(randomizeList)))
put gRandom into field "fieldRandom"
set the textFont of member "fieldRandom" to "IK10"
set the foreColor of member "fieldRandom" to gRed
playRandom()
else
repeat with i = 1 to 8
if getAt(virTracklIst, i) <> -1 then
put i into word 1 of line getAt(virTracklIst, i) of field "fieldAudio"
set the foreColor of word 1 of line getAt(virTracklIst, i) of field "fieldAudio" to gBlue
end if
end repeat
end if
pass()
end if
if inside(point(the mouseH, the mouseV), rect(567, 433, 634, 448)) then
repeat with i = 2 to 9
puppetSprite(i, 0)
end repeat
repeat with i = 11 to 19
puppetSprite(i, 0)
end repeat
set the foreColor of field "fieldMarkerSeq" to 0
set gPlaySeq to 0
if IKGetCurrentBeat() <> -1 then
if gOnSynth then
set gOnSynth to 0
IKSynthStop()
end if
IKStop()
IKFunction()
end if
put EMPTY into field "fieldBarBeat"
go("vMix")
set the visible of sprite 20 to 1
put EMPTY into field "fieldDuration"
set the loc of sprite 39 to point(320, 226)
set the memberNum of sprite 39 to 1000
updateStage()
set bpm to float(field "fieldBpm")
set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
set the locV of sprite 24 to 341
updateStage()
pass()
end if
if inside(point(the mouseH, the mouseV), rect(592, 453, 611, 471)) then
set gReturn to "seq grooveM"
set the foreColor of member "fieldMarkerSeq" to 0
put EMPTY into field "fieldState"
if (markerList <> []) and gPlaySeq then
if not gGrooveSel then
set gGrooveSel to getAt(markerList, gCont)
end if
end if
if the visible of window "synth" then
close(window "synth")
end if
set gPlaySeq to 0
go("start", "pref")
pass()
end if
if inside(point(the mouseH, the mouseV), rect(615, 453, 634, 471)) then
openWin("YesNo")
tell window "YesNo"
go("quit")
end tell
pass()
end if
if inside(point(the mouseH, the mouseV), rect(489, 407, 523, 442)) then
set click to the timer
if getAt(tapList, 2) <> 0 then
if ((click - getAt(tapList, 2)) <= 80) and ((click - getAt(tapList, 2)) >= 10) then
puppetSprite(19, 0)
set media to float((click - getAt(tapList, 1)) / 2)
set bpm to float(3600) / media
if bpm > (6 * gBpmSong / 5) then
set bpm to float(6 * gBpmSong / 5)
end if
if bpm < (4 * gBpmSong / 5) then
set bpm to float(4 * gBpmSong / 5)
end if
set tapList to [0, 0]
IKMixBPM(bpm * 1000)
put bpm into field "fieldBpm"
set the textFont of member "fieldBpm" to "IK10"
set the foreColor of member "fieldBpm" to gGreen
set the locH of sprite 24 to (15 * ((100 * (bpm - gBpmSong) / gBpmSong) + 52) / 4) + 5
set the locV of sprite 24 to 362
updateStage()
if markerList = [] then
put EMPTY into field "fieldDuration"
else
case word 2 of field "fieldDuration" of
"sec":
set sec to 1920 * the number of words in field "fieldMarkerSeq" / float(field "fieldBpm")
set sec to integer(sec)
set min to sec / 60
if min = 0 then
set min to "00"
end if
if (min >= 1) and (min <= 9) then
set min to "0" & min
end if
set sec to sec mod 60
if sec = 0 then
set sec to "00"
end if
if (sec >= 1) and (sec <= 9) then
set sec to "0" & sec
end if
put min & ":" & sec & " sec" into field "fieldDuration"
otherwise:
put 8 * the number of words in field "fieldMarkerSeq" & " bars" into field "fieldDuration"
end case
end if
set the textFont of member "fieldDuration" to "IK10"
set the foreColor of member "fieldDuration" to gBlue
else
set tapList to [click, 0]
puppetSprite(19, 1)
set the loc of sprite 19 to point(507, 425)
set the ink of sprite 19 to 8
set the memberNum of sprite 19 to the number of member "Htap"
updateStage()
end if
else
if (getAt(tapList, 2) = 0) and (getAt(tapList, 1) <> 0) then
if ((click - getAt(tapList, 1)) <= 80) and ((click - getAt(tapList, 1)) >= 10) then
setAt(tapList, 2, click)
else
setAt(tapList, 1, click)
end if
else
setAt(tapList, 1, click)
end if
puppetSprite(19, 1)
set the memberNum of sprite 19 to the number of member "Htap"