Old 10-02-2015, 09:06 AM   #1
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default Script to Display Text from Region on Video Window?

Hey nerds!

There are some insanely wonderful scripts that I've found on here recently. Its a world I've just begun to dive into and I have to say: I'm impressed!

I was wondering if anyone had any insight on where to get started here, or if the scripting API have the necessary elements to do this task that I'm trying to conjure up.

Basically, this would be useful for me for ADR and Voiceover sessions. I would love to be able to have text from either regions (or empty items?) display on the video window for the actor to read instead of futzing with physical paper notes.

I've used Nuendo's ADR Taker for this in the past, as its hands down the best for this kind of work, at least until we can put our heads together and figure out how to make Reaper do it better! If we could figure out how to use video fx to replicate the crossing bars overlay, that would be icing on the cake.

(

So where to get started? Would this work better as a script, or as a JS effect? Thoughts? Ideas?

Lets figure out how to make something great!
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 10-02-2015, 09:44 AM   #2
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 4,589
Default

I think Heda's Note Reader script does what you want:
http://forum.cockos.com/showthread.php?t=155928
Sexan is offline   Reply With Quote
Old 10-02-2015, 10:01 AM   #3
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

Quote:
Originally Posted by Sexan View Post
I think Heda's Note Reader script does what you want:
http://forum.cockos.com/showthread.php?t=155928
This is awesome work! It would be perfect if this could be read from Regions, so a tie-in with the Region/Marker Manager could come into play. Its super fast to be able to run an ADR session from the Region Manager, I can sort the cues and color code them etc. It also makes navigation easier. Also, if the text could be sent to the lower third of the Video Display window, that would be perfect as well.

Maybe something like this would be possible via a JSFX that would be placed on the video track that receives information from the Region manager very similarly to what Heda's Note Reader does?

I have yet to dive in on how to code anything, as I'm a 110% noob at that, but I'm willing to learn to be able to pull something like this off.

I would love Airon, RobinGShore, and any Post-Production guys' insight on what they think might be useful too. I think if everyone interested in this kind of thing put their heads together, we could make something REALLY great for Reaper.

By the way, Sexan, it is literally impossible to not smile looking at your avatar. Kitty Missile.
__________________
www.dungeonbeach.com

Last edited by analogexplosions; 10-02-2015 at 10:10 AM. Reason: cats
analogexplosions is offline   Reply With Quote
Old 10-02-2015, 10:14 AM   #4
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,924
Default

Quote:
Originally Posted by Sexan View Post
I think Heda's Note Reader script does what you want:
http://forum.cockos.com/showthread.php?t=155928

Are you saying here you can write to the video window?



>
__________________
Nathan, Lincoln, UK. | Item Marker Tool. (happily retired) | Source Time Position Tool. | CD Track Marker Tool. | Timer Recording Tool. | dB marks on MCP faders FR.
planetnine is offline   Reply With Quote
Old 10-02-2015, 10:14 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

There is ton of reasons two prefer making this works from text items (empty items with text) rather than Regions, essential because you can't select regions, or work on multiple regions at the same time, and the fact that text items can handle break lines, and you can have several sets of text items (one set per track), not several sets of regions.
That's why Heda's script don't work with Regions.

But if you need these text items to appear as regions, then another heda's script

EEL script: Show/Hide Markers using Track's empty items with notes



Note: Heda's Notes window is already so powerful that I don't see anyone that would rebuilt it from scrach for JSFX just to be displayed on the video. But volunteers are welcome if they think it will be useful :P

If you need Text items actions then...
If you really need a script that can display regions name => Clocks Regions



Have fun with all that :P
X-Raym is offline   Reply With Quote
Old 10-02-2015, 10:16 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@planetnine

You can but note with Heda's Notes Reader !
X-Raym is offline   Reply With Quote
Old 10-02-2015, 10:27 AM   #7
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

Quote:
Originally Posted by planetnine View Post
Are you saying here you can write to the video window?



>
I cheat right now and use the text overlay preset for the video processor on items and change the names there which works great for showing coders what sounds are what in the video examples I send them as I can move the PIP items around and copy them and they see the sound shown as well as hear it on the master video of the gameplay super cool.

I didn't know that script overlays on the video.. got to load that up again! EDIT: misread.. although it made me remember after trying those scripts again how amazing they are!

PLEASE. can someone work out how to take that video processor preset and integrate it reading regions or item names and display that on the video!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.

Last edited by musicbynumbers; 10-02-2015 at 10:52 AM.
musicbynumbers is offline   Reply With Quote
Old 10-02-2015, 11:56 AM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

I don't think it is possible. Reascript functions (GetMediaItem for exemple) doesn't work in video processor. (just tested)
Maybe it works only with JSFX function.. but this is an other domain =/
X-Raym is offline   Reply With Quote
Old 06-29-2018, 07:52 AM   #9
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

Just wanted to give this topic a bump. This was back in 2015 when I started the thread.

Have there been any new developments that would make something like this possible? It would make ADR/VO recording sessions so much better.
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 06-29-2018, 10:36 AM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

You can access the VideoProcessor-Code in TrackStateChunks/ItemStateChunks and modify it that way.

You would need to replace a shown text (I guess the text-preset is a good starting point).

Important: Every codeline must start with a |

This is damn slow but possible...
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-29-2018, 11:08 AM   #11
analogexplosions
Human being with feelings
 
analogexplosions's Avatar
 
Join Date: May 2011
Location: Nashville
Posts: 360
Default

Quote:
Originally Posted by mespotine View Post
You can access the VideoProcessor-Code in TrackStateChunks/ItemStateChunks and modify it that way.

You would need to replace a shown text (I guess the text-preset is a good starting point).

Important: Every codeline must start with a |

This is damn slow but possible...
I’m super new to coding, but learning just so I can try to make things that help improve my own workflow.
Do you think it’s possible from within the video processor JSFX to call “item notes” or “region name” to display text?

I’m trying to recreate something similar to Nuendo or DaVinci Resolve’s ADR recording systems. Ideally, it’d be handled in the region manager, or a similar spreadsheet-type window with character names and the dialog line, with the dialog line displaying on the video window.
__________________
www.dungeonbeach.com
analogexplosions is offline   Reply With Quote
Old 06-29-2018, 02:30 PM   #12
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I wrote you some Lua-functions, that do getting and setting text in a videoprocessor, without having to do it in the videoprocessor itself.
It works only for items, as trackFX would be, as mentioned earlier, too slow to update.

It modifies the first(!) Video Processor in the FX-Chain of an item and only, if it uses the "Title text overlay"-preset.

I can't write you a proper script due lack of time, but this should be a start for you or someone else, who couldhelp you coding such a script.

Code:
-- Get/Set Text in Video Processor-functions

-- Only works for TakeFX in MediaItems! As I use StateChunks to change texts, TrackFX would be too slow to do that.
-- Changes/gets the text of the first(!) video processor in the FX Chain of the MediaItem
-- Only supports Reaper's built-in "Title text overlay"-preset!
-- You can use safely newlines, these will be added properly.

-- Usecase: Use a MediaItem, that's streched along the whole project.
--          Give it a video-processor as TakeFX
--          Apply these functions to this MediaItem.
--          That way, you can change the text whenever you want.
--          Keep in mind: this MediaItem must be the "highest order", means, it must be above all other video/picture items
--                        otherwise, other items may "overwrite" the text
--          Changing texts may cause hickups and stuttering because of the change.

function SetTextInVideoProcessor(item, text)
  -- sets the videotext in a given item in it's first(!) Video Processor in the FXChain.
  -- the Video Processor must be set to the built-in "Title text overlay"-preset!
  -- multiline-texts are allowed
  
  --   item - a MediaItem object as returned by reaper.GetMediaItem
  --   text - the text, that you want to set. Write \n to include a newline.
  -- The function returns retval, errormessage
  --     retval - true, in case of success; false, in case of an error
  --     errormessage - in case of an error, this message gives you a hint, what went wrong.

  -- Meo Mespotine - mespotine.de
  -- licensed under an MIT-license
  
  if reaper.ValidatePtr2(0, item, "MediaItem*")==false then return false, "No valid MediaItem" end
  if type(text)~="string" then return false, "Must be a string" end
  local _bool, StateChunk=reaper.GetItemStateChunk(item, "", false)
  if StateChunk:match("VIDEO_EFFECT")==nil then return false, "No Video Processor found in this item" end
  local part1, code, part2=StateChunk:match("(.-)(<CODE.-\n>)(\nCODEPARM.*)")
  
  if code:match("// Title text overlay")==nil then return false, "Only default preset \"Title text overlay\" supported. Please select accordingly." 
  else 
    local c1,test,c3=code:match("(.-text=\")(.-)(\".*)") 
    text=string.gsub(text, "\n", "\\n")
    code=c1..text..c3
  end
  StateChunk=part1..code..part2
  return reaper.SetItemStateChunk(item, StateChunk, false), "Done"
end

function GetTextInVideoProcessor(item)
  -- gets the videotext in a given item in it's first(!) Video Processor in the FXChain.
  -- the Video Processor must be set to the built-in "Title text overlay"-preset!
  -- multiline-texts are allowed


  --   item - a MediaItem object as returned by reaper.GetMediaItem
  -- The function returns retval, errormessage, textinvideoitem
  --     retval - true, in case of success; false, in case of an error
  --     errormessage - in case of an error, this message gives you a hint, what went wrong.
  --     textinvideoitem - the text, that is currently set in videoitem

  -- Meo Mespotine - mespotine.de
  -- licensed under an MIT-license
  
  if reaper.ValidatePtr2(0, item, "MediaItem*")==false then return false, "No valid MediaItem" end
  local _bool, StateChunk=reaper.GetItemStateChunk(item, "", false)
  if StateChunk:match("VIDEO_EFFECT")==nil then return false, "No Video Processor found in this item" end
  local part1, code, part2=StateChunk:match("(.-)(<CODE.-\n>)(\nCODEPARM.*)")
  
  if code:match("// Title text overlay")==nil then return false, "Only default preset \"Title text overlay\" supported. Please select accordingly." 
  else 
    local c1,test,c3=code:match("(.-text=\")(.-)(\".*)") 
    test=string.gsub(test, "\\n", "\n")
    return true, "Done", test
  end
end

MediaItem=reaper.GetMediaItem(0,0)
SuccessfulOrNot, MsgInCaseOfError=SetTextInVideoProcessor(MediaItem, "Text line one\nText line Two\nanother(third) line, etc")
SuccessfulOrNot, VideoProcessorText=GetTextInVideoProcessor(MediaItem)

Getting projectnotes from within the VideoProcessor is, to my knowlegde, not possible yet.
Meo-Ada Mespotine is offline   Reply With Quote
Old 06-29-2018, 05:56 PM   #13
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@mespotine
I invite you to post such useful code.snippet on ReaTeam Template repo, so we can see it evolves if it has updates :P
X-Raym is offline   Reply With Quote
Old 06-30-2018, 01:20 PM   #14
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

@XRaym
I will look into it, as soon as I have some time to do that(still busy with coding another Reaper-focused project).
But if you want, you can add it to the ReaTeam Template repo, so it doesn't get lost due me forgetting it
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.