Monday, June 7, 2010

DrScheme is now Racket

The style authoring documentation recommends using the DrScheme environment for writing Scheme/muSE scripts. The environment has just been renamed Racket.

Sunday, August 23, 2009

Pulling resources from the web

In the upcoming release of muvee Reveal (R15), a new function fetch-uri has been introduced to simplify the task of downloading files from the web at "make muvee time". fetch-uri takes a URL, downloads its contents and returns a temporary path of a local file containing the contents. Some uses of fetch-uri are -

  1. To download media elements at construction time for use within muvees created by your style.

  2. To load .scm libraries directly from a URL.

  3. To query services such as search engines for data based on which other fetch-uri calls can be triggered.


The example style S10000_ImageSearch ("Image Search") is a simple example of how to use fetch-uri to turn photo caption text into images using Google's image search facility. The search functionality is packaged into a module google.scm which you can import into your style (see lib/about.html).

To use the "Image Search" style, add some photos and give them caption text for which Google's image search returns one or more images. In the result muvee, you'll see images from the search results instead of the text you entered.

Sunday, August 16, 2009

Anaglyphs using "ColorWriteMask"

The upcoming release of muvee Reveal (R15) features a new primitive effect called ColorWriteMask. Using it, you can selectively render a scene to the red, green, blue or alpha channels of the display area (aka "frame buffer"). Here is an example of a red write mask -

(define red-mask
(effect "ColorWriteMask" (A)
(param "Red" 1)
(param "Green" 0)
(param "Blue" 0)
(param "Alpha" 1)))

When you apply the red-mask to a scene, only the red channel values of the frame buffer will be affected and will consist of the red channel components of the scene itself (unless you have a pixel shader that mixes up channels, that is).

We can use the ColorWriteMask to spatially separate the red and cyan color components of the scene, thereby rendering the scene as an anaglyph. The example style S10000_CubeIn3D shows you how to get this effect. The key functionality is implemented in anaglyph.scm, which you can bring into your own styles like a library using -

(load (resource "anaglyph.scm"))


Now, whip out your red-cyan 3D glasses. Here is a sample muvee made using the "Cube Twist in 3D" style -

Monday, August 10, 2009

How to overlay an image

The style example S10000_ImageOverlay shows how to overlay a simple image atop your whole muvee by modifying the definition of muvee-global-effect. The relevant part of the code is close to trivial and is reproduced here -

(define spider
(effect "PictureQuad" ()
(param "Path" (resource "spider.png"))))

(define muvee-global-effect
(layers (A)
A
spider))

With the muvee-global-effect defined as above, the muvees you create will have a giant spider spanning the whole screen ... just for kicks :P

Here are sample 4:3 and 16:9 videos of what you'll get with the above code -

4:3 version


16:9 version


Notice that the spider is presented in the correct aspect ratio in both cases even though we didn't say anything about the scaling to be performed in each case. This is because the coordinate system of the scene is setup to preserve the aspect ratio of entities placed in the scene. For a 4:3 muvee, the x coordinate spans [-4/3,4/3] and the y coordinate spans [-1,1]. Similarly for the 16:9 muvee, the x coordinate spans [-16/9,16/9] and the y coordinate spans [-1,1]. The spider image is 150x150 - i.e. it has 1:1 aspect ratio - which fits within the unit square.

Selecting different images based on output aspect ratio

Suppose you have two images frame-4by3.png and frame-16by9.png, you can select one of them based on the aspect ratio for which your muvee is being constructed ... like so -

(define ar-suffix
(if (< (fabs (- render-aspect-ratio 4/3)) 0.01)
"-4by3"
"-16by9"))

(define spider
(effect "PictureQuad" ()
(param "Path" (resource (format "frame" ar-suffix ".png")))))

The render-aspect-ratio symbol gives you the aspect ratio for which the muvee is being constructed. We use its value to pick the suffix string we need to use with "frame" in order to select the correct file. If you consistently use "-4by3" and "-16by9" as a convention, then the above suffix code can be reused to select more than one overlay image based on the render aspect ratio within your style.

Modifying an existing muvee-global-effect

If you're looking at a complex muvee-global-effect expression like
(define muvee-global-effect ....)
, you can mechanically add the overlay by first renaming the original definition to, say, muvee-global-effect-original and then adding the following new definition after the original one.

(define muvee-global-effect-original ....) ; Renamed definition.

(define muvee-global-effect
(effect-stack
(layers (A)
A
spider)
muvee-global-effect-original))

Monday, July 27, 2009

All style code is now open

We're now opening up the code for ALL muvee Reveal styles. If you have a style - free or purchased - you can get the unencrypted data.scm for them by re-downloading the respective style installers from your Self Serve account, as of today.

We see style authoring as more like film-making than rocket science. You can usually tell how a style is built by watching the muvees it makes, but unencrypting all of our styles gives you the equivalent of a detailed "making of" DVD that you can learn from. It also makes it clear that you too can create styles using the same effects and composition framework that we use to make our shipping styles. Taking that further, if you find that we haven't documented something you see us using in the muSE code, just let us know and we'll fill the gap.

In line with the new license terms, we've posted a complete list of open styles for immediate access to all their code on muvee-style-authoring.googlecode.com. Just point your muveeStyleBrowser to http://muvee-style-authoring.googlecode.com/svn/trunk/styles/. Those styles for which only the code (i.e. the data.scm file) has been posted there will appear in the muveeStyleBrowser with "[code only]" in their names.

Have fun!

More open and clearer license terms

Based on questions that some of you asked, we figured we needed to clarify the license terms under which our toolkit is published. Here's a summary of what's new on that front -
  1. We've lifted the "non-commercial" constraint on the usage. So go ahead and make money creating muvee Reveal styles.
  2. All the stuff on muvee-style-authoring.googlecode.com (and only the stuff there) is made available under the posted license terms. Specifically ...
    1. All code posted there continues to be available under the same liberal New BSD License.
    2. All content (i.e. style art work) posted there is free for re-use in your work as long as you give us attribution.

For a more precise description of the new license terms, see License.

Sunday, May 3, 2009

Ten styles to draw from

The muSE scripts for all the ten core styles that ship with muvee Reveal are now available to style authors. For ease of browsing this code base,

  1. Download the muveeStyleBrowser helper tool from the downloads area.
  2. Unpack the zip file and run the muveeStyleBrowser.exe program. It will list your installed styles.
  3. Right-click on any style and select Edit data.scm ... to open its muSE script in your default editor for .scm files.
Have fun!