PDA

View Full Version : Another way to control more than one instance of the DDR



Jim Davis
04-17-2006, 08:56 AM
As I am poking around I found a directory in the skins folder that set up the dedicated keyboard shortcuts in VT4/skins/ResourceLibrary/DedicatedHotkeys one file for the ddr's got my attention. DDR_DH.ToasterScript . This is where dedicated hot keys for the DDR's are setup. Up to 3 DDR's have unque keystrokes . Rather than useing SetFocusToWindow & FindModule you can define which instance of the DDR you want your code to effect using the CreateShortCut command as listed below.

CreateShortCut ("Keystroke", code( your code here ), "Always", KbdPriority, m_Tab_Layout, n) n= the instance of the DDR you want the command to apply to.


Here is an example using some code John came up with to cue up some instant replay stuff which I modified to playback at the first shuttle position and cue on the preview buss for the first three DDR loaded.



// DDR & prepare for slomo Playback

// PREPRARE FOR PLAYBACK DDR1 and cue up slomo
CreateShortCut ("App Alt Ctrl Shift c", code(
if( GetNumClipsSelected()==1 ) {
ts_GoToOutPointCurrent()
FrameTime=1.0/GetFrameRate()
SetSpeedAndPosition(0, GetPosition() - (300 * FrameTime), 2)
MarkInPt( true )
ts_GoToInPointCurrent()
ts_ShuttleForwards()
PlaceOntoPreviewIn()
SetPause( True )
SetCue( true )
)
}
)"Always", KbdPriority, m_Tab_Layout, 1)

// PREPRARE FOR PLAYBACK DDR2 and cue up slomo
CreateShortCut ("App Alt Ctrl Shift v", code(
if( GetNumClipsSelected()==1 ) {
ts_GoToOutPointCurrent()
FrameTime=1.0/GetFrameRate()
SetSpeedAndPosition(0, GetPosition() - (300 * FrameTime), 2)
MarkInPt( true )
ts_GoToInPointCurrent()
ts_ShuttleForwards()
PlaceOntoPreviewIn()
SetPause( True )
SetCue( true )
)
}
)"Always", KbdPriority, m_Tab_Layout, 2)

// PREPRARE FOR PLAYBACK DDR3 and cue up slomo
CreateShortCut ("App Alt Ctrl Shift b", code(
if( GetNumClipsSelected()==1 ) {
ts_GoToOutPointCurrent()
FrameTime=1.0/GetFrameRate()
SetSpeedAndPosition(0, GetPosition() - (300 * FrameTime), 2)
MarkInPt( true )
ts_GoToInPointCurrent()
ts_ShuttleForwards()
PlaceOntoPreviewIn()
SetPause( True )
SetCue( true )
)
}
)"Always", KbdPriority, m_Tab_Layout, 3)

// PREPRARE FOR PLAYBACK DDR1
CreateShortCut ("App Alt Ctrl Shift z", code(ts_ShuttleForwards() PlaceOntoPreviewIn() SetPause( True ) SetCue( true )), "Always",

KbdPriority, m_Tab_Layout, 1)


// PREPRARE FOR PLAYBACK DDR2
CreateShortCut ("App Alt Ctrl Shift X", code(ts_ShuttleForwards() PlaceOntoPreviewIn() SetPause( True ) SetCue( true )), "Always",

KbdPriority, m_Tab_Layout, 2)

// PREPRARE FOR PLAYBACK DDR3
CreateShortCut ("App Alt Ctrl Shift X", code(ts_ShuttleForwards() PlaceOntoPreviewIn() SetPause( True ) SetCue( true )), "Always",

KbdPriority, m_Tab_Layout, 3)



I am not sure if there are limitations using this method vs. SetFocusToWindow & FindModule But Is seemed like a nifty little tidbit if your going to be doing this kinda of stuff. AS far as I can tell it only works with DDR's

PIZAZZ
04-17-2006, 09:48 AM
Sorry Jim, I haven't had a chance to respond to your other thread and bring up the existance of the dedicated DDR shortcuts. Aussie and I worked on those a while back to use in my VJLive project. Using the dedicated shortcuts works much better and more reliably than the send focus command. I have found that sometimes in the past the DDRs would forget who they were. This led me to work with Dhomas Trenn on developing a more direct method of controlling the modules via MIDI and soon serial.


Now if Mr. John could muster the resources to have a slider control the DDR playback speed.... we all would be golden. :)

Currently on VJLive we have buttons that + or - the playback speed by .01%. Unfortunately the DDR pauses for a slight moment every time you click a button.

Nice to see some more people getting into scripting. It is some fun stuff once you dive in.

John Perkins
04-17-2006, 11:32 AM
I was actually working for a general solution instead of a DDR only function.

There is a FindWindow() command that somehow never got completed. It works like the SetFocusToWindow() and FindModule() commands together but doesn't change the focus. It takes a module name and instance but then talks to the module directly, like findmodule() does.

It looks easy enough to copy the needed parts from the other two commands, so hopefully I can get that working in VT5, etc.

I haven't looked at how VT handles playback speed changes, so a slider may or may not be smooth. It's worth a try though. :goodluck:

I'm glad to see more activity in here too. :agree:

Jim Davis
04-17-2006, 12:05 PM
I was actually working for a general solution instead of a DDR only function.



Yup that would be nice . I was hoping that it would work with the RecordPanel but no dice .

Jim Davis
04-17-2006, 12:10 PM
Now if Mr. John could muster the resources to have a slider control the DDR playback speed.... we all would be golden. :)



What would be really helpful is a good reference manual with all the Tscript commands documented . I find some of the info I need in the current tscript docs but just as much by look at the tscripts themself. Allot of this is not documented you just gota hunt for it.

John Perkins
04-17-2006, 12:18 PM
Did you get the third version that I posted a while back?

It isn't perfect, but it is a lot better. I hope to document scripting a lot better and give examples. I don't have better documentation either, I'm learning this like you guys. Many of those commands have been forgotten over the years from lack of use.

If anyone would like to contribute better a explanation of a command (many just have a command name), post it here for everyone and I'll update the doc as we go.

Being an unsupported document, community involvement would be very cool.

Jim Davis
04-17-2006, 12:22 PM
The version I have is a little older than that. Aussie sent it to me I think. Where can I find a link for the newer one.

John Perkins
04-17-2006, 12:46 PM
http://www.newtek.com/forums/showthread.php?t=45870

If you don't use Open Office, there are other formats such as PDF and DOC posted later in the thread.

I'm amazed that you are getting so far without it. You'll have a blast with the new docs.

Just be aware that there are many audio mixer commands listed that don't work. When the mixer was rewritten, the commands weren't. :(