Page 1 of 1

Typewriter effect

Posted: Sun Feb 12, 2012 3:13 pm
by Seymour Clufley
This should come in handy for someone doing video production.

I wanted to have text appear on the screen as if somebody was typing it on a typewriter - you see this in old films. But since the text had nearly 150 characters, this would mean a lot of manual work, including aligning a sound file to each new "type". So instead I wrote this little program.

You give it the text (which can include line breaks). It wraps the text and draws each frame, including a little bit of human randomness. It uses EasyBMPtoAVI to create an AVI from all these frames. It also creates the necessary soundtrack as a WAV file - including key hits, space bar hits, and carriage returns.

Use Premiere or an equivalent program to watch the AVI and WAV files together.

It's set for PAL - 768x576 at 25fps. This should play fine anywhere, but change it for production if you're in NTSC land.

The rar file below has everything you'll need. The folder "typewriter_resources" should be placed in the C:\ root. The included font looks like an old typewriter - install it, or change the designation in the PB file to "Courier New".

Typewriter effect

Hope somebody has a use for it!

Re: Typewriter effect

Posted: Sun Feb 12, 2012 5:48 pm
by luis
I like it :D

I played the two files using virtualdub, it's nice, well done !

Thanks for sharing it.


If you want to test the program with the right font without installing it, add a
AddFontResource_("Acoustic Bass.ttf") before the loadfont()
and a RemoveFontResource_("Acoustic Bass.ttf") after freefont()