if (beat <> 1) and (beat <> word 2 of field "fieldBarBeat") then
put beat into word 2 of field "fieldBarBeat"
end if
if beat = 4 then
set new to 0
end if
if (beat = 1) and not new then
put 1 into word 2 of field "fieldBarBeat"
set m to integer(word 1 of field "fieldBarBeat") + 1
if m <= 9 then
set m to "00" & m
end if
if (m >= 10) and (m <= 99) then
set m to "0" & m
end if
put m into word 1 of field "fieldBarBeat"
set new to 1
end if
if word 1 of field "fieldBarBeat" = "000" then
put "001" into word 1 of field "fieldBarBeat"
end if
set bar to "bar" & bar
set the memberNum of sprite 39 to the number of member bar
set the loc of sprite 39 to point(320, 224)
set gAnim to gAnim + 1
if gAnim = 121 then
set gAnim to 49
end if
if gAnim <> 120 then
if the visible of sprite 120 then
set the visible of sprite gAnim to 0
else
set the visible of sprite gAnim to 1
end if
else
if the visible of sprite 49 then
set the visible of sprite gAnim to 1
else
set the visible of sprite gAnim to 0
end if
end if
if word 2 of field "fieldDuration" = "sec" then
set oldMin to chars(word 1 of field "fieldDuration", 1, length(word 1 of field "fieldDuration") - 3)
set oldSec to chars(word 1 of field "fieldDuration", length(word 1 of field "fieldDuration") - 1, length(word 1 of field "fieldDuration"))
set oldSec to (oldMin * 60) + oldSec
set sec to 240 / float(field "fieldBpm") * getAt(durationList, gStyle)
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"
set the textFont of member "fieldDuration" to "IK10"
set the foreColor of member "fieldDuration" to gBlue
end if
else
set gAnim to 48
repeat with i = 49 to 120
set the visible of sprite i to 0
end repeat
set the memberNum of sprite 39 to 1000
updateStage()
put EMPTY into field "fieldDuration"
put EMPTY into field "fieldBarBeat"
set gStyle to 0
end if
if the visible of window "Help" then
moveHelp()
showMixMessage()
end if
if gToSeq then
transferToSeq()
end if
if the visible of window "synth" then
set pos to point(the mouseH + the stageLeft, the mouseV + the stageTop)
if inside(pos, the rect of window "synth") and the mouseDown then
set m to the mouseH + the stageLeft - getAt(the rect of window "synth", 1)
set N to the mouseV + the stageTop - getAt(the rect of window "synth", 2)
repeat while the mouseDown
set the rect of window "synth" to rect(the mouseH + the stageLeft - m, the mouseV + the stageTop - N, 320 + the mouseH + the stageLeft - m, 72 + the mouseV + the stageTop - N)
updateStage()
end repeat
set gPosSynth to the rect of window "synth"
end if
end if
if gYes then
set gYes to 0
if gOnSynth then
IKSynthStop()
set gOnSynth to 0
end if
if the visible of window "synth" then
close(window "synth")
end if
IKStop()
set markerSynthList to []
set gPlaySong to 0
go("start", "menuSong")
end if
if gLoadMix <> VOID then
if (gLoadMix <> EMPTY) and (FileExists(gLoadMix) = 0) then
loadMix()
end if
end if
if gBpmPall then
if the mouseDown then
set x to the mouseH
if x > 395 then
set x to 395
end if
if x < 246 then
set x to 246
end if
set the locH of sprite 24 to x
set the locV of sprite 24 to 341
updateStage()
else
set gBpmPall to 0
end if
set bpm to (float(4 * (the locH of sprite 24 - 321) / 15) * gBpmSong / float(100)) + gBpmSong
IKMixBPM(bpm * 1000)
put bpm into field "fieldBpm"
set the textFont of member "fieldBpm" to "IK10"
set the foreColor of member "fieldBpm" to gGreen
end if
if gSelDuration then
if the mouseDown then
set campo to "fieldStyle" & gDuration
set dMax to the number of lines in field campo
set durata to 8 * (((dMax - 1) * (the mouseH - 162) / 43) + 1)
if durata < 8 then
set durata to 8
end if
if durata > (dMax * 8) then
set durata to dMax * 8
end if
set num to integer((21 * ((durata / 8) - 1) / (dMax - 1)) + 1)
set dNum to "d" & num
set the memberNum of sprite (5 + gDuration) to the number of member dNum
updateStage()
if gDuration = gStyle then
case word 2 of field "fieldDuration" of
"bars":
put durata into word 1 of field "fieldDuration"
"sec":
set sec to 240 * durata / 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 >= 0) and (sec <= 9) then
set sec to "0" & sec
end if
put min & ":" & sec into word 1 of field "fieldDuration"
end case
end if
else
set campo to "fieldStyle" & gDuration
set dMax to the number of lines in field campo
set durata to 8 * (((dMax - 1) * (the mouseH - 162) / 43) + 1)
if durata < 8 then
set durata to 8
end if
if durata > (dMax * 8) then
set durata to dMax * 8
end if
setAt(durationList, gDuration, durata)
if gDuration = gStyle then
if count(randomList) < (durata / 8) then
repeat with i = count(randomList) + 1 to durata / 8
append(randomList, 1)
end repeat
else
if count(randomList) > (durata / 8) then
repeat while count(randomList) > (durata / 8)
deleteAt(randomList, count(randomList))
end repeat
end if
end if
end if
set gSelDuration to 0
end if
end if
set the textFont of member "fieldBarBeat" to "IK10"
set the foreColor of member "fieldBarBeat" to gGreen