D2
3 messages in this thread
Keith
Dear Keith, Something old and something new:
#1 On the subject of timecode, my needs for auto-entry timecode is not that
urgent. But what would be handy and seems not as complicated is to have
event triggering to happen based on a list of time code numbers manually
entered. A line from this list could look like this "TC057A=01:55:13:29".
This means that event #57 will trigger at SMPTE time code 01:55:13:29 (the
"A" represents the first trigger of an event, other letters could be for
other triggers within one event as in stop/starting an anim). When script
is running you could manually advance to event #57 and wait for the
trigger. I don't know midi very well so I don't know how SMPTE #'s match
but I guess a conversion formula could be written. It is very important
though that SMPTE #'s are written as they are read from the time code
reader for easy and accurate typing (using a colon between
"hours:minutes:seconds:frames" is not necessary though). If more advanced
entry and triggering of time code would be possible then that would be
great. I'll gladly suggest a direction if we reach that stage.
#2 I have the ability in my script to go to any other event by hitting 3
numbers (ex: 0,5,7 means go to event #57) before hitting the trigger key.
Hitting letters or just two numbers will be ignored and the trigger key
will activate the event that is next in line. If I hit 3 keys that give me
a number that is higher than my last event, the program will abort because
the event label doesn't exist. I have a way of checking for this, but I
want to have the ability to type in other choices (ex: different
transitions) and it is hard to write script each time to protect from
illegal goto's. Is there any way a goto command that leads to a nonexistent
label could just be ignored until a legal label is typed in?
Thanks again for your clear responses, regards Richard
>A line from this list could look like this "TC057A=01:55:13:29".
The timecode will be handled by the MIDI module as seperate values in an
array, something like this:
DIM tcode[4]
….
MIDI "readtime",tcode
This will read the current timecode value, and return the frames/seconds/
minutes/hours values in seperate cells in the tcode array. To wait for a
specific frame:
tcode[1] = frames
tcode[2] = seconds
tcode[3] = minutes
tcode[4] = hours
MIDI "gwait",tcode
A script that waits for the next timecode occuring in a list may have to
scan the entire list if the list is unsorted, etc. One assumption that can
be made is that the list is always kept in sorted order, so once one event
has occurred, the next event of interest is the very next one in the list.
There is some list handling that has to be performed, and within The
Director, this would most likely be done with an array of timecodes like
the one in the array above.
DIM tlist[400,4] :rem up to 400 events, 4 values each,
HH,MM,SS,FF
Once such a list is constructed, you could start at the beginning of the
list, doing successive MIDI "gwait" commands to wait for each next event.
A list can then be entered manually like this:
tlist[1,1]=0,1,32,12
tlist[2,1]=0,1,48,8
tlist[3,1]=0,1,56,2
tlist[4,1]=0,2,08,16
tlist[5,1]=0,2,18,4
etc., and an index used to keep track of the next expected event:
nexttime=1
/top:
MIDI "gwait",tlist[nexttime,1]
GOSUB nexttime
nexttime=nexttime+1
GOTO top
Though a script designed to automate the list generation would be useful.
Keith
To protect for illegal goto's there are a couple of things you might do,
such as use ON GOTOs instead, which will fall through to the next line if
there is no match:
ON value GOTO F1,F2,F3,F4,F5,F6,F7,F8,F9,F10
ON value-10 GOTO F11,F12,F13,F14,F15,F16,F17,F18,F19,F20
ON value-20 GOTO F21,F22,F23,F24,F25,F26,F27,F28,F29,F30
Could be a bit to type, and if they're that sequential, it might be easier
to just do a range check first:
IF value > 30 | value < 1 THEN GOTO ILLEGAL
GOTO value
etc.
Keith