home *** CD-ROM | disk | FTP | other *** search
- on mix
- global gSong, gQMix, gPath, gCD, gGrooveSel, gOnSynth, gBpmSong, markerList, audioList
- cursor(4)
- IKSynthStop()
- set gOnSynth to 0
- IKStop()
- if gGrooveSel <> 0 then
- 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 gN to "g" & gGrooveSel
- set the memberNum of sprite (11 + gGrooveSel - pNum) to the number of member gN
- updateStage()
- end if
- set gGrooveSel to 0
- end if
- set the foreColor of member "fieldMarkerSeq" to 0
- put EMPTY into field "fieldState"
- set testo to field "fieldBpm" & RETURN
- repeat with j = 1 to count(markerList)
- set numLine to getAt(markerList, j)
- set tracce to 0
- repeat with i = 1 to 8
- set groove to word i of line numLine of field "grooveMem"
- if (groove <> "0") and getPos(audioList, chars(groove, 13, length(groove))) then
- set tracce to tracce + 1
- end if
- end repeat
- set testo to testo & tracce & RETURN
- repeat with i = 1 to 8
- if word i of line numLine of field "grooveMem" <> "0" then
- set groove to word i of line numLine of field "grooveMem"
- set nomeFile to chars(groove, 13, length(groove))
- if getPos(audioList, nomeFile) then
- set testo to testo & getPos(audioList, nomeFile) && integer(chars(groove, 1, 3)) && integer(chars(groove, 7, 9)) & RETURN
- end if
- end if
- end repeat
- end repeat
- set myFile to new(xtra("fileio"))
- set nameFile to displaySave(myFile, "Save mix file", EMPTY)
- set myFile to 0
- if nameFile <> EMPTY then
- if gQMix then
- set nameFile to chars(nameFile, 1, length(nameFile) - 3) & "wav"
- else
- set nameFile to chars(nameFile, 1, length(nameFile) - 4)
- end if
- if gQMix then
- IKQualityMix(nameFile, testo)
- else
- IKMultiTrackMix(nameFile, testo)
- end if
- end if
- IKFunction()
- cursor(-1)
- end
-
- on clickRedSeq
- global virTracklIst, volValList, volPosList, panValList, panPosList, stateTrackList, markerList, synthList, progList, audioList, gPlaySeq, gGrooveSel, gPath, gStartSeq, gCont, gOnSynth, gArp, gProg, gPosVolSynth, gPosPanSynth, gYellow, gRed, gBlue
- if gGrooveSel <> 0 then
- 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 gN to "g" & gGrooveSel
- set the memberNum of sprite (11 + gGrooveSel - pNum) to the number of member gN
- updateStage()
- end if
- set gGrooveSel to 0
- end if
- if IKGetCurrentBeat() <> -1 then
- if gOnSynth then
- IKSynthStop()
- set gOnSynth to 0
- end if
- IKStop()
- IKFunction()
- if gPlaySeq then
- set gPlaySeq to 0
- end if
- set the foreColor of field "fieldMarkerSeq" to 0
- if gStartSeq then
- set the foreColor of word gStartSeq of field "fieldMarkerSeq" to gYellow
- end if
- set virTracklIst to [-1, -1, -1, -1, -1, -1, -1, -1]
- set stateTrackList to ["off", "off", "off", "off", "off", "off", "off", "off"]
- set volValList to [28, 28, 28, 28, 28, 28, 28, 28]
- set panValList to [64, 64, 64, 64, 64, 64, 64, 64]
- set volPosList to [239, 239, 239, 239, 239, 239, 239, 239]
- set panPosList to [239, 239, 239, 239, 239, 239, 239, 239]
- else
- if field "fieldMarkerSeq" <> EMPTY then
- set num to getAt(markerList, gStartSeq)
- repeat with i = 1 to 8
- set groove to word i of line num of field "grooveMem"
- if (groove <> "0") and getPos(audioList, chars(groove, 13, length(groove))) then
- IKVolume(i, integer(chars(groove, 1, 3)))
- IKPan(i, integer(chars(groove, 7, 9)))
- IKPlay(i, getPos(audioList, chars(groove, 13, length(groove))))
- setAt(virTracklIst, i, getPos(audioList, chars(groove, 13, length(groove))))
- setAt(stateTrackList, i, "on")
- setAt(volValList, i, integer(chars(groove, 1, 3)))
- setAt(volPosList, i, integer(chars(groove, 4, 6)))
- setAt(panValList, i, integer(chars(groove, 7, 9)))
- setAt(panPosList, i, integer(chars(groove, 10, 12)))
- next repeat
- end if
- setAt(virTracklIst, i, -1)
- setAt(stateTrackList, i, "off")
- setAt(volValList, i, 28)
- setAt(volPosList, i, 239)
- setAt(panValList, i, 64)
- setAt(panPosList, i, 239)
- end repeat
- set gCont to gStartSeq
- set the foreColor of word gStartSeq of field "fieldMarkerSeq" to gRed
- set gPlaySeq to 1
- put "SEQUENCE PLAYING" into field "fieldState"
- set the textFont of member "fieldState" to "IK10"
- set the foreColor of member "fieldState" to gBlue
- end if
- end if
- end
-
- on loadSeq
- global gLoadSeq, gPlaySeq, gfirstmarker, glastmarker, gGrooveSel, gPath, gFirstNum, gOnSynth, gSong, markerList, audioList
- set loadSeq to gLoadSeq
- set gLoadSeq to EMPTY
- cursor(4)
- set myFile to new(xtra("fileio"))
- openFile(myFile, loadSeq, 1)
- set theFile to readFile(myFile)
- closeFile(myFile)
- set myFile to 0
- set sourceSong to line 1 of theFile
- if sourceSong = (gSong && "seq") then
- delete line 1 of theFile
- put the last line in theFile into field "fieldMarkerSeq"
- set the textFont of member "fieldMarkerSeq" to "Arial"
- set the textSize of member "fieldMarkerSeq" to 10
- set the foreColor of member "fieldMarkerSeq" to 0
- delete char 1 of field "fieldMarkerSeq"
- set markerList to []
- repeat with i = 1 to the number of words in field "fieldMarkerSeq"
- append(markerList, integer(word i of field "fieldMarkerSeq"))
- end repeat
- delete char -30003 of theFile
- set user to 0
- repeat with i = 1 to the number of words in theFile
- set groove to word i of theFile
- if (groove <> "0") and not getPos(audioList, chars(groove, 13, length(groove))) then
- put "0" into word i of theFile
- set user to user + 1
- end if
- end repeat
- if user then
- openWin("Message")
- tell window "Message"
- go("6")
- end tell
- end if
- put theFile into field "grooveMem"
- repeat with i = 1 to 8
- set the memberNum of sprite (1 + i) to the number of member "marker"
- set groove to "groove" & i
- set the memberNum of sprite (i + 10) to the number of member groove
- updateStage()
- end repeat
- case count(markerList) of
- 1, 2, 3, 4, 5, 6, 7:
- repeat with i = 1 to count(markerList)
- set gN to "g" & getAt(markerList, i)
- set the memberNum of sprite (i + 1) to the number of member gN
- updateStage()
- end repeat
- set gfirstmarker to 1
- set glastmarker to count(markerList)
- otherwise:
- set j to 9
- repeat with i = count(markerList) down to count(markerList) - 6
- set j to j - 1
- set gN to "g" & getAt(markerList, i)
- set the memberNum of sprite j to the number of member gN
- updateStage()
- end repeat
- set gfirstmarker to count(markerList) - 6
- set glastmarker to count(markerList)
- end case
- set max to min(max(markerList), 8)
- repeat with i = 1 to max
- set gN to "g" & i
- set the memberNum of sprite (10 + i) to the number of member gN
- updateStage()
- end repeat
- 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
- if IKGetCurrentBeat() <> -1 then
- if gOnSynth then
- set gOnSynth to 0
- IKSynthStop()
- end if
- IKStop()
- IKFunction()
- end if
- set gGrooveSel to 0
- if gPlaySeq then
- set gPlaySeq to 0
- end if
- set gFirstNum to "1"
- else
- openWin("Message")
- tell window "Message"
- go("19")
- end tell
- end if
- cursor(-1)
- end
-