If you’ve used the
_.stage.stopSaving() functionality recently added you might notice that there’s something missing. These calls save out every frame that’s drawn (either caused by an explicit
_.stage.frame() or by a window updating). This can be find for sketches that control their own flow of time on a frame-by-frame basis. But for more complete sketches that use the Field window as a timeline, it’s not quite enough — to turn all of those frames back into a movie, we need to know what the ‘frame-rate’ of that frame sequence is.
The code that’s missing is very straightforward:
There are two numbers in there that you’ll be interested in
targetFrameRate = 24 and
secondsToPixels = 24. The latter is common throughout Field and its documentation, and it sets the scale between the coordinate system that boxes are in (for things like
_.time.frame.x) and wall-clock time in seconds.
targetFrameRate asks for the frame-rate of the resulting jpeg sequence — it’s what you need to specify when you load the image sequence back into an Adobe or Apple product. 24 is enough for cinema, but you could do 12 for a low-frame-rate feel or 240 if you want to play tricks with motion blur in post-production.
The key here is that everything is being saved some constant framerate, and
_t() moves regularly because of that. This way, sound will line up with the images that you make.