home *** CD-ROM | disk | FTP | other *** search
- on keyUp
- global gTraccia, gSolo, gRandom, gpag, gOn, gProg, gArp, gSynthSeq, gBpmSong, gPosVolSynth, gPosPanSynth, gSynthSel, gOnSynth, gGreen, stateTrackList, virTracklIst, tempList, panValList, volValLsit, markerList, folderSynthList, synthList, scaleList
- if ((the key = "b") or (the key = "B")) and the shiftDown then
- IKMixBPM(gBpmSong * 1000)
- put gBpmSong into field "fieldBpm"
- case the frame of
- 3:
- set the loc of sprite 24 to point(322, 449)
- 7:
- set the loc of sprite 24 to point(201, 362)
- 11:
- set the loc of sprite 24 to point(319, 341)
- end case
- updateStage()
- set the textFont of member "fieldBpm" to "IK10"
- set the foreColor of member "fieldBpm" to gGreen
- end if
- case the frame of
- 2, 3:
- case the keyPressed of
- "a":
- set temp to chars(the name of member the memberNum of sprite 12, 2, length(the name of member the memberNum of sprite 12))
- if not integerp(integer(temp)) then
- clickMarker()
- end if
- "q":
- set gSolo to not gSolo
- puppetSprite(11, 1)
- clickSolo()
- "w":
- if (gTraccia <> 0) and gOn then
- set spriteNum to 40 + gTraccia
- set traccia to spriteNum - 40
- clickControlTrack(traccia, spriteNum)
- end if
- end case
- case the keyCode of
- 83, 84, 85, 86, 87, 88, 89:
- set gTraccia to the keyCode - 82
- puppetSprite(12, 1)
- if gSolo and (getAt(stateTrackList, gTraccia) <> "off") then
- clickControlTrack(gTraccia, 40 + gTraccia)
- end if
- clickTrack()
- 91:
- set gTraccia to 8
- puppetSprite(12, 1)
- if gSolo and (getAt(stateTrackList, 8) <> "off") then
- clickControlTrack(8, 48)
- end if
- clickTrack()
- end case
- 6, 7:
- case the keyCode of
- 49:
- set the memberNum of sprite 36 to the number of member "redButton"
- set the ink of sprite 36 to 8
- updateStage()
- put EMPTY into field "fieldState"
- clickRedSeq()
- end case
- 10, 11:
- case the keyCode of
- 49:
- if IKGetCurrentBeat() <> -1 then
- set the memberNum of sprite 36 to the number of member "redMix"
- updateStage()
- clickRedMix()
- end if
- end case
- end case
- if the visible of window "synth" then
- tell window "synth"
- case the keyPressed of
- ".":
- if gOn and (folderSynthList <> []) and not (the visible of window "help") then
- if synthList <> [] then
- emptySynth()
- end if
- end if
- "\":
- clickLed()
- end case
- if the keyCode = 24 then
- markSynth()
- end if
- set tasto to the keyPressed
- if not (findPos(keyNoteList, tasto) = 0) then
- if gOn and (IKGetCurrentBeat() <> -1) and (folderSynthList <> []) and not (the visible of window "help") then
- set nota to getProp(keyNoteList, tasto)
- set oct to ((findPos(keyNoteList, tasto) - 1) / count(scaleList)) + 1
- set notaOct to nota & oct
- set Gnota to "y" & nota
- if not getPos(synthList, notaOct) then
- repeat with i = ((oct - 1) * 12) + 4 to ((oct - 1) * 12) + 4 + 11
- tell window "synth"
- if the name of member the memberNum of sprite i = nota then
- set the memberNum of sprite i to the number of member Gnota
- updateStage()
- exit repeat
- end if
- end tell
- end repeat
- append(synthList, notaOct)
- else
- repeat with i = ((oct - 1) * 12) + 4 to ((oct - 1) * 12) + 4 + 11
- tell window "synth"
- if the name of member the memberNum of sprite i = Gnota then
- set the memberNum of sprite i to the number of member nota
- updateStage()
- exit repeat
- end if
- end tell
- end repeat
- deleteAt(synthList, getPos(synthList, notaOct))
- end if
- if synthList = [] then
- set gOnSynth to 0
- IKSynthStop()
- else
- if not gOnSynth then
- set gOnSynth to 1
- end if
- case char 1 of gArp of
- "[":
- set arp to 1
- "]":
- set arp to 2
- "{":
- set arp to 4
- "}":
- set arp to 8
- end case
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
- IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
- end if
- if gSynthSel then
- tell window "synth"
- set the locH of sprite 74 to -20
- end tell
- set gSynthSel to 0
- end if
- end if
- end if
- end tell
- end if
- end
-
- on keyDown
- global gTraccia, gpag, gOn, gOnSynth, gArp, gProg, gSynthSel, gPosVolSynth, gPosPanSynth, gBpmSong, gPath, gRandom, gBlue, gGreen, volValList, volPosList, stateTrackList, progList, folderSynthList, synthList, arpList, virTracklIst, randomizeList
- if the visible of window "synth" then
- tell window "synth"
- if gOn and (folderSynthList <> []) and not (the visible of window "help") then
- case the keyCode of
- 18, 19:
- set pos to getPos(folderSynthList, field "fieldSynth")
- if the keyCode = 19 then
- if pos = count(folderSynthList) then
- set pos to 1
- else
- set pos to pos + 1
- end if
- else
- if pos = 1 then
- set pos to count(folderSynthList)
- else
- set pos to pos - 1
- end if
- end if
- put getAt(folderSynthList, pos) into field "fieldSynth"
- set the textFont of member "fieldSynth" to "IK10"
- set the foreColor of member "fieldSynth" to gBlue
- if gOnSynth then
- IKSynthStop()
- end if
- IKSetSynth(gPath & "Synth\" & field "fieldSynth" & "\")
- case char 1 of gArp of
- "[":
- set arp to 1
- "]":
- set arp to 2
- "{":
- set arp to 4
- "}":
- set arp to 8
- end case
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
- if synthList <> [] then
- IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
- end if
- if gSynthSel then
- set the locH of sprite 74 to -20
- set gSynthSel to 0
- end if
- 20, 21:
- set pos to getPos(arpList, field "fieldArp")
- if the keyCode = 21 then
- if pos = count(arpList) then
- set pos to 1
- else
- set pos to pos + 1
- end if
- else
- if pos = 1 then
- set pos to count(arpList)
- else
- set pos to pos - 1
- end if
- end if
- put getAt(arpList, pos) into field "fieldArp"
- set the textFont of member "fieldArp" to "IK10"
- set the foreColor of member "fieldArp" to gBlue
- set gArp to field "fieldArp"
- case char 1 of gArp of
- "[":
- set arp to 1
- "]":
- set arp to 2
- "{":
- set arp to 4
- "}":
- set arp to 8
- end case
- if gOnSynth then
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
- IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
- end if
- if gSynthSel then
- set the locH of sprite 74 to -20
- set gSynthSel to 0
- end if
- 23:
- set pos to getPos(progList, field "fieldProg")
- if pos = count(progList) then
- set pos to 1
- else
- set pos to pos + 1
- end if
- put getAt(progList, pos) into field "fieldProg"
- set the textFont of member "fieldProg" to "IK10"
- set the foreColor of member "fieldProg" to gBlue
- set gProg to field "fieldProg"
- case char 1 of gArp of
- "[":
- set arp to 1
- "]":
- set arp to 2
- "{":
- set arp to 4
- "}":
- set arp to 8
- end case
- if gOnSynth then
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- IKSynthPan(integer(128 * (-gPosPanSynth + 54) / 45))
- IKSynthArp(getPos(progList, gProg) - 1, arp, createSeq())
- end if
- if gSynthSel then
- set the locH of sprite 74 to -20
- set gSynthSel to 0
- end if
- 22:
- if gOn then
- if gPosVolSynth < 54 then
- set the locV of sprite 45 to the locV of sprite 45 + 1
- set gPosVolSynth to the locV of sprite 45
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- updateStage()
- end if
- end if
- 26:
- if gOn then
- if gPosVolSynth > 9 then
- set the locV of sprite 45 to the locV of sprite 45 - 1
- set gPosVolSynth to the locV of sprite 45
- IKSynthVolume(integer(128 * (-gPosVolSynth + 54) / 45))
- updateStage()
- end if
- end if
- end case
- end if
- end tell
- end if
- case the keyCode of
- 25, 29:
- set bpm to field "fieldBpm"
- if (the keyCode = 25) and (bpm > ((4 * gBpmSong / 5) + 1)) then
- set bpm to bpm - 1
- IKMixBPM(bpm * 1000)
- end if
- if (the keyCode = 29) and (bpm < ((6 * gBpmSong / 5) - 1)) then
- set bpm to bpm + 1
- IKMixBPM(bpm * 1000)
- end if
- put bpm into field "fieldBpm"
- set the textFont of member "fieldBpm" to "IK10"
- set the foreColor of member "fieldBpm" to gGreen
- case the frame of
- 2, 3:
- set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
- set the locV of sprite 24 to 449
- 6, 7:
- set the locH of sprite 24 to (15 * ((100 * (bpm - gBpmSong) / gBpmSong) + 52) / 4) + 5
- set the locV of sprite 24 to 362
- 10, 11:
- set the locH of sprite 24 to (15 * 25 * (bpm - gBpmSong) / gBpmSong) + 321
- set the locV of sprite 24 to 341
- end case
- updateStage()
- end case
- case the frame of
- 2, 3:
- case the keyPressed of
- "a":
- set temp to chars(the name of member the memberNum of sprite 12, 2, length(the name of member the memberNum of sprite 12))
- if not integerp(integer(temp)) then
- set the memberNum of sprite 13 to the number of member "Hmarker"
- set the ink of sprite 13 to 36
- set the loc of sprite 13 to point(51, 240)
- updateStage()
- end if
- end case
- case the keyCode of
- 49:
- puppetSprite(13, 1)
- set the memberNum of sprite 13 to the number of member "Hred"
- set the ink of sprite 13 to 36
- set the loc of sprite 13 to point(320, 240)
- updateStage()
- clickRed()
- 70:
- if gTraccia <> 0 then
- if getAt(stateTrackList, gTraccia) <> "off" then
- if getAt(volPosList, gTraccia) > 168 then
- setAt(volPosList, gTraccia, getAt(volPosList, gTraccia) - 1)
- set vol to (128 / power(1.02200000000000002, 142) * power(1.02200000000000002, ((-142 * the locV of sprite 3) + 142 + (310 * 141)) / 142)) + 4
- if integer(vol) = 124 then
- set vol to 128
- end if
- IKVolume(gTraccia, integer(vol))
- setAt(volValList, gTraccia, integer(vol))
- set the locV of sprite 3 to getAt(volPosList, gTraccia)
- updateStage()
- end if
- end if
- end if
- 78:
- if gTraccia <> 0 then
- if getAt(stateTrackList, gTraccia) <> "off" then
- if getAt(volPosList, gTraccia) < 310 then
- setAt(volPosList, gTraccia, getAt(volPosList, gTraccia) + 1)
- set vol to (128 / power(1.02200000000000002, 142) * power(1.02200000000000002, ((-142 * the locV of sprite 3) + 142 + (310 * 141)) / 142)) - 1
- if integer(vol) = 5 then
- set vol to 0
- end if
- IKVolume(gTraccia, integer(vol))
- setAt(volValList, gTraccia, integer(vol))
- set the locV of sprite 3 to getAt(volPosList, gTraccia)
- updateStage()
- end if
- end if
- end if
- 125:
- if gTraccia <> 0 then
- case getAt(virTracklIst, gTraccia) of
- (-1):
- set numLine to random(the lineCount of member "fieldAudio")
- otherwise:
- if getAt(virTracklIst, gTraccia) = the lineCount of member "fieldAudio" then
- set numLine to 1
- else
- set numLine to getAt(virTracklIst, gTraccia)
- end if
- end case
- repeat while getOne(virTracklIst, numLine)
- set numLine to numLine + 1
- if numLine = (the lineCount of member "fieldAudio" + 1) then
- set numLine to 1
- end if
- end repeat
- clickNameAudio(numLine)
- set q to the lineCount of member "fieldAudio" / 20
- set r to the lineCount of member "fieldAudio" mod 20
- if r then
- set numPag to q + 1
- else
- set numPag to q
- end if
- set q to numLine / 20
- set r to numLine mod 20
- if r then
- set pag to q + 1
- else
- set pag to q
- end if
- if gpag > pag then
- scrollByLine(member "fieldAudio", -20 * (gpag - pag))
- set gpag to pag
- else
- if gpag < pag then
- scrollByLine(member "fieldAudio", 20 * (pag - gpag))
- set gpag to pag
- end if
- end if
- end if
- 126:
- if gTraccia <> 0 then
- case getAt(virTracklIst, gTraccia) of
- (-1):
- set numLine to random(the lineCount of member "fieldAudio")
- otherwise:
- if getAt(virTracklIst, gTraccia) = 1 then
- set numLine to the lineCount of member "fieldAudio"
- else
- set numLine to getAt(virTracklIst, gTraccia)
- end if
- end case
- repeat while getOne(virTracklIst, numLine)
- set numLine to numLine - 1
- if numLine = 0 then
- set numLine to the lineCount of member "fieldAudio"
- end if
- end repeat
- clickNameAudio(numLine)
- set q to the lineCount of member "fieldAudio" / 20
- set r to the lineCount of member "fieldAudio" mod 20
- if r then
- set numPag to q + 1
- else
- set numPag to q
- end if
- set q to numLine / 20
- set r to numLine mod 20
- if r then
- set pag to q + 1
- else
- set pag to q
- end if
- if gpag > pag then
- scrollByLine(member "fieldAudio", -20 * (gpag - pag))
- set gpag to pag
- else
- if gpag < pag then
- scrollByLine(member "fieldAudio", 20 * (pag - gpag))
- set gpag to pag
- end if
- end if
- end if
- 124:
- set q to the lineCount of member "fieldAudio" / 20
- set r to the lineCount of member "fieldAudio" mod 20
- if r then
- set numPag to q + 1
- else
- set numPag to q
- end if
- if gpag <> numPag then
- scrollByLine(member "fieldAudio", 20)
- set gpag to gpag + 1
- else
- scrollByLine(member "fieldAudio", -20 * (numPag - 1))
- set gpag to 1
- end if
- 123:
- if gpag <> 1 then
- scrollByLine(member "fieldAudio", -20)
- set gpag to gpag - 1
- else
- set q to the lineCount of member "fieldAudio" / 20
- set r to the lineCount of member "fieldAudio" mod 20
- if r then
- set numPag to q + 1
- else
- set numPag to q
- end if
- scrollByLine(member "fieldAudio", 20 * (numPag - 1))
- set gpag to numPag
- end if
- 115, 116, 119, 121:
- if gTraccia then
- set the foreColor of word 2 of line getAt(virTracklIst, gTraccia) of field "fieldAudio" to gGreen
- end if
- set gTraccia to 0
- set the loc of sprite 3 to point(529, 239)
- set the loc of sprite 4 to point(543, 239)
- repeat with i = 1 to 8
- if getAt(virTracklIst, i) <> -1 then
- put "=" into word 1 of line getAt(virTracklIst, i) of field "fieldAudio"
- end if
- end repeat
- scrollByLine(member "fieldAudio", -20 * (the lineCount of member "fieldAudio" / 20))
- set gpag to 1
- if virTracklIst <> [-1, -1, -1, -1, -1, -1, -1, -1] then
- repeat with i = 1 to 8
- setAt(tempList, i, getAt(virTracklIst, i))
- end repeat
- end if
- set virTracklIst to [-1, -1, -1, -1, -1, -1, -1, -1]
- case the keyCode of
- 115:
- set gRandom to getAt(randomizeList, 1)
- 116:
- set gRandom to getAt(randomizeList, 2)
- 119:
- set gRandom to getAt(randomizeList, 4)
- 121:
- set gRandom to getAt(randomizeList, 3)
- end case
- updateStage()
- playRandom()
- end case
- 6, 7:
- case the keyCode of
- 49:
- set the memberNum of sprite 36 to the number of member "HredSeq"
- set the ink of sprite 36 to 36
- updateStage()
- end case
- 10, 11:
- case the keyCode of
- 49:
- if IKGetCurrentBeat() <> -1 then
- set the memberNum of sprite 36 to the number of member "HredMix"
- end if
- end case
- end case
- end
-