9609747
Example
echo off
tcl 'esc-data'
tcl 'xcs-on'
tcl 'xonoff (f'
tcl 'set-baud 38400'
file midi.data
tcl 'clear-file midi.data'
id=1
first.data=1
tick=''
start=system(12)
loop
loop in byte while byte=248 do tick=tick+1 repeat
begin case
case byte >= 128 ;* st byte
midi.data=''
if byte<240 then
midi.data(st)=int(byte/16)
midi.data(ch)=rem(byte,16)+1
end else
midi.data(st)=byte
end
case first.data
midi.data(dt1)=byte
first.data=0
if status=13 or status=14 or status=241 or status=243 then gosub write.it
em
case 1 ;* second data byte
midi.data(dt2)=byte
first.data=1
if midi.data(st)<10 then
if byte=0 then
read midi.data from midi.data(ch):midi.data(note)
midi.data(tickoff)=tick
midi.data(secsoff)=system(12)-start
write midi.data on id
id=id+1
delete midi.data,midi.data(ch):midi.data(note)
end else
midi.data(seconds)=system(12)-start
midi.data(tick)=tick
write midi.data on midi.data(ch):midi.data(note)
end
end else gosub write.item
end case
repeat
write.item:
midi.data(seconds)=system(12)-start
midi.data(tick)=tick
write midi.data on id
id=id+1
return
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
