---
title: musicvideo-leblon
date: 2026-12-05
---

# Using a Custom Piston Triptych in 100% Code-based Editing

> For scene transitions in a music video made in an editing engine that is Agent-First and entirely driven by Typescript, AI developed a custom "Piston Triptych" transition effect which is loud and theatrically performative. Here's a look behind the scenes.

For this particular music video, the plan was to generate video covering each of the song's 3 verses spread over 3 distinct acts taking place in 3 different locations and 3 different times of times: Morning, afternoon and evening.  

Moving from one to the next required a clear and distinct transition, which needed emphasis in a performative and theatric way.  The solution was inspired by the multiple panels of a late 1960s and early 1970s movie montage, and was written in code as a **Piston Triptych** just for this assembly.

![leblon to copacabana 17 piston 2 t127.600](images/content/musicvideo-leblon/leblon-to-copacabana-17-piston-2-t127.600.jpg)

*Pistons just before aligning*

To watch the final result, skip directly to the end of this article.

## Piston Triptych specifications

The custom piston triptych splits the frame in 3 equial parts, angles them, and pushes the old plate vertically out of the frame while simultaneously pulling the new clip vertically into the frame. In the left-most and right-panel, the new arrives from the top, pushing the old out of the frame through the bottom. In the center panel, this direction inverts: Old arrives bottom-up, new leaves the screen through the top. This creates a one-turn piston effect. When they meet in the middle, the transition is complete.

By editing exclusively in code (in this case, Typescript) every variable became a knob that can be dialed into the exact setting the film's editor wants: The angle of the triptych slant, the speed of movement and length of the transition, and which beats it lands on in the song.

## Color grading experimentation

Because of the different time of day in each of the song's verses, it meant a distinct color grade for each Act, and this is where MasterGrade made the work easy. Out of the box,  ==MasterGrade comes complete with an extensive database of color profiles already built in==, and that compensates to a large extent for the only 8 bits per channel in the source material that can currently be generated by AI.

This film used 3 profiles which each attempted to overcome the native absence of precise color grading capabilities and the lack of being able to work professionally with LUTs:
* **Act I, neighborhood "Leblon"**: Cold light of early dawn.
* **Act II, neighborhood "Ipanema"**: Warm afternoon, sunny.
* **Act III, neighborhood "Copacabana"**: Blue hour / early evening.

Each one had a MasterGrade prompt enhancement applied before still image generation, which was merged with the rest of the prompt by MasterGrade's AI tooling.

![leblon to copacabana 05 t62.757](images/content/musicvideo-leblon/leblon-to-copacabana-05-t62.757.jpg)

*Cold light of early dawn*

![leblon to copacabana 12 t107.227](images/content/musicvideo-leblon/leblon-to-copacabana-12-t107.227.jpg)

*Warm afternoon, sunny*

![leblon to copacabana 23 t195.409](images/content/musicvideo-leblon/leblon-to-copacabana-23-t195.409.jpg)

*Blue hour / early evening*

## Example standalone color guidance 

 The look for Act II ("Copacabana") was achieved with this prompt direct from MasterGrade:
 

Apply magic hour / blue hour lighting. The 20-minute window after sunset, deep blue twilight sky, last ambient light. Cerulean shadows, ethereal calm, rich blue-magenta horizon.

 

![leblon to copacabana 11 t91.183](images/content/musicvideo-leblon/leblon-to-copacabana-11-t91.183.jpg)

*Real Ipanema backdrop*

## Hybrid AI film using real backdrops

Because the lyrics in the song covers real, existing Rio de Janeiro neighborhoods, it was important to create the 3 sets depicting these actual places.  To do so, the production began with stock photos of Rio de Janeiro and the 3 actual neighborhoods. After sorting these photos in 3 groups, each original, real-life photo then had its color profile changed, which was done using MasterGrade and AI regeneration until each matched the correct look for the others in its group. 

![leblon to copacabana 19 t141.088](images/content/musicvideo-leblon/leblon-to-copacabana-19-t141.088.jpg)

*On Av Atlantica, in Copacabana*

Based on these images, the I2V model and the lip-sync model then generated plates, which meant that actual color grading in post was limited to a remastering processs. This fairly light color grading meant that the end-result looked more natural. 

Placement of synthetic people in real environments also added to the perception of realism.  This approach was experimental. It worked fine for this film, but ==it is the opposite of what hybrid filmmaking is currently doing most of, which is placing real people in synthetic enviroments.==

### MODELS 
* Images: Nano Banana 2.1
* Main clips: Omni 1.2
* Lip-sync: Minimax H3

### FINAL CUT

24 fps, 768p resolution, 3:51 runtime

[Video](https://astridvanderlei.com/media/video/leblon-to-copacabana.mp4)

