home *** CD-ROM | disk | FTP | other *** search
- on saveGroove
- global gSong, gPath, stateTrackList, volValList, panValList, virTracklIst, volPosList, panPosList, audioList
- set testo to gSong && "groove" & numToChar(13) & numToChar(10)
- repeat with k = 1 to 8
- if (getAt(stateTrackList, k) <> "off") and (getAt(stateTrackList, k) <> "mute") then
- case length(string(getAt(volValList, k))) of
- 1:
- set volVal to "00" & getAt(volValList, k)
- 2:
- set volVal to "0" & getAt(volValList, k)
- 3:
- set volVal to getAt(volValList, k)
- end case
- case length(string(getAt(panValList, k))) of
- 1:
- set panVal to "00" & getAt(panValList, k)
- 2:
- set panVal to "0" & getAt(panValList, k)
- 3:
- set panVal to getAt(panValList, k)
- end case
- set testo to testo & volVal & getAt(volPosList, k) & panVal & getAt(panPosList, k) & getAt(audioList, getAt(virTracklIst, k)) & " "
- next repeat
- end if
- set testo to testo & "0 "
- end repeat
- set myFile to new(xtra("fileio"))
- setFilterMask(myFile, ".txt")
- set nameFile to displaySave(myFile, "Save groove window", EMPTY)
- createFile(myFile, nameFile)
- openFile(myFile, nameFile, 2)
- writeString(myFile, testo)
- closeFile(myFile)
- set myFile to 0
- end
-
- on loadGroove
- global gloadGroove, gpag, gPath, gProg, gArp, gOnSynth, gPosVolSynth, gPosPanSynth, gGrooveSel, gBlue, gSong, virTracklIst, volValList, volPosList, stateTrackList, panValList, panPosList, progList, synthList, keepList, audioList
- set loadGroove to gloadGroove
- set gloadGroove to EMPTY
- cursor(4)
- set gGrooveSel to 0
- set the memberNum of sprite 12 to the number of member "jolly"
- updateStage()
- 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
- set myFile to new(xtra("fileio"))
- openFile(myFile, loadGroove, 1)
- set theFile to readFile(myFile)
- closeFile(myFile)
- set myFile to 0
- set sourceSong to line 1 of theFile
- if sourceSong = (gSong && "groove") then
- delete line 1 of theFile
- set user to 0
- repeat with i = 1 to 8
- set groove to word i of theFile
- if (groove <> "0") and not getPos(audioList, chars(groove, 13, length(groove))) then
- set user to user + 1
- put "0" into word i of theFile
- end if
- end repeat
- repeat with i = 1 to 8
- set info to word i of theFile
- if info <> "0" then
- setAt(volValList, i, integer(chars(info, 1, 3)))
- setAt(volPosList, i, integer(chars(info, 4, 6)))
- setAt(panValList, i, integer(chars(info, 7, 9)))
- setAt(panPosList, i, integer(chars(info, 10, 12)))
- setAt(virTracklIst, i, getPos(audioList, chars(info, 13, length(info))))
- setAt(stateTrackList, i, "on")
- next repeat
- end if
- setAt(volValList, i, 28)
- setAt(volPosList, i, 293)
- setAt(panValList, i, 64)
- setAt(panPosList, i, 293)
- setAt(virTracklIst, i, -1)
- setAt(stateTrackList, i, "off")
- end repeat
- if user then
- openWin("Message")
- tell window "Message"
- go("5")
- end tell
- end if
- 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
- IKSynthStop()
- IKStop()
- IKFunction()
- repeat with i = 1 to 8
- IKVolumeSync(i, getAt(volValList, i))
- IKPanSync(i, getAt(panValList, i))
- IKPlay(i, getAt(virTracklIst, i))
- end repeat
- if gOnSynth and (synthList <> []) then
- 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
- repeat with i = 1 to 8
- if getAt(virTracklIst, i) <> -1 then
- set onNum to "on" & i
- puppetSprite(40 + i, 1)
- set the memberNum of sprite (40 + i) to the number of member onNum
- else
- set controlT to "controlT" & i
- puppetSprite(40 + i, 1)
- set the memberNum of sprite (40 + i) to the number of member controlT
- end if
- updateStage()
- end repeat
- set keepList to [0, 0, 0, 0, 0, 0, 0, 0]
- else
- openWin("Message")
- tell window "Message"
- go("18")
- end tell
- end if
- cursor(-1)
- end
-