home *** CD-ROM | disk | FTP | other *** search
- on set_junk
- global stopidx, startidx, loopidx, walkidx, junk_cst, junk_vol, junk_time, ltl_len, ltl_time, ltl_scast, ltl_mix, sample_offset, sample_rate, circle_qua, ticks_ps, ll_cast, ll_ttime, ll_size, ll_walk
- repeat while 1
- if loopidx > 12 then
- return
- end if
- set loop_add to value(getAt(ltl_len, loopidx))
- if loop_add > 0 then
- set newloopidx to loopidx + loop_add
- exit repeat
- next repeat
- end if
- set loopidx to loopidx + 1
- end repeat
- set junk_cst to getAt(ltl_scast, loopidx)
- set the floatPrecision to 8
- set ss to float(getAt(ltl_time * value(getAt(ltl_len, loopidx)), loopidx))
- if circle_qua = "16" then
- set ss to ss / 2
- set sample_rate to 44100
- else
- set sample_rate to 22050
- end if
- set junk_time to integer(ss / sample_rate * ticks_ps)
- set walkidx to walkidx + value(getAt(ltl_len, loopidx))
- llst_insert(junk_cst, junk_time, junk_time, loopidx)
- set loopidx to newloopidx
- end
-
- on getstartidx track
- global LED_1, LED_2, t1_segcnt, t2_segcnt
- if (LED_1 = 0) or (LED_1 = 13) then
- set startidx to 1
- else
- set startidx to LED_1
- end if
- if t1_segcnt > t2_segcnt then
- set tmx to t1_segcnt
- else
- set tmx to t2_segcnt
- end if
- if startidx > tmx then
- set startidx to 1
- end if
- return startidx + track
- end
-
- on getstopidx track
- global LED_1, LED_2, areon, t1_segcnt, t2_segcnt
- set tl_mx to tl_maxpos(1)
- if (LED_2 = 0) or (LED_2 = 13) or (areon < 2) then
- set stopidx to tl_mx + 1
- else
- if (LED_2 - 1) > tl_mx then
- set stopidx to tl_mx
- else
- set stopidx to LED_2
- end if
- end if
- return stopidx + track
- end
-
- on circlestop
- global fcommand
- set fcommand to EMPTY
- puppetSound(0)
- WALK(mrelease)
- updateStage()
- end
-
- on llst_init
- global ll_cast, ll_ttime, ll_size, ll_walk, ll_name
- set ll_cast to []
- set ll_ttime to []
- set ll_size to []
- set ll_walk to []
- set ll_name to []
- end
-
- on llst_insert lcast, lttime, lsize, lwalk, lname
- global ll_cast, ll_ttime, ll_size, ll_walk
- append(ll_cast, lcast)
- append(ll_ttime, lttime)
- append(ll_size, lsize)
- append(ll_walk, lwalk)
- append(ll_name, lname)
- end
-
- on gettlitems
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- set retvar to 0
- repeat with i = 1 to 12
- set retvar to retvar + value(ltl_len, i)
- end repeat
- return retvar
- end
-
- on gettlstart idx
- global ltl_len, ltl_time, ltl_scast, ltl_mix
- set retvar to 1
- set cnt to 1
- repeat with i = 1 to 12
- set vlen to value(getAt(ltl_len, i))
- if vlen > 0 then
- if (retvar + vlen) > idx then
- exit repeat
- end if
- set retvar to retvar + vlen
- set cnt to cnt + 1
- end if
- end repeat
- return cnt
- end
-
- on gettlstop idx
- global ltl_len, ltl_time, ltl_scast, ltl_mix, startidx
- set retvar to 1
- set cnt to 1
- repeat with i = 1 to 12
- set vlen to value(getAt(ltl_len, i))
- if vlen > 0 then
- if (retvar + vlen) >= idx then
- exit repeat
- end if
- set retvar to retvar + vlen
- set cnt to cnt + 1
- end if
- end repeat
- return cnt
- end
-