On this page:
6.4.1 Segment duration pattern
6.4.2 Segment duration scaling factor
6.4.3 Transition duration scaling factor
6.4.4 Time warping
6.4.5 Music descriptors

6.4 Controlling a style’s music response

The Constructor sets up the timing for each portion of the input media given by the user. That is, it selects clips from the video material and arranges pictures into a timeline with many aspects of this construction driven by music characteristics. A style can specify how the constructor goes about doing this by setting several controls, which we describe here.

6.4.1 Segment duration pattern

You can give a looping sequence of segment lengths which the constructor will try to obey when placing pictures and video into the timeline. You do this using the segment-durations operator. For example -

(segment-durations 2.0 4.0)

will cause segments 1, 3, 5, etc. to be half as long as segments 2, 4, 6, etc. The units of these duration values are beats which relate to the tempo of the music. You can give as many of these duration values to loop through. Such a loop is useful to create some variety in the edit.

6.4.2 Segment duration scaling factor

A (human) music video editor will tend to make slower edits when the music is quiet and faster edits when the music becomes energetic. You can simulate the same effect using what we call a segment duration transfer curve. This curve derives a scaling factor for segment durations as determined by the segment duration pattern depending on the music’s loudness value at the time of the edit.

This transfer curve is specified as follows -

;                    loudness-level  scaling-factor
(segment-duration-tc 0.0             scale0
                     level1          scale1
                     level2          scale2
                     ....
                     1.0             scaleN)
where levelk is greater than levelk-1.

What an expression like that specifies is a piece-wise linear curve connecting the music loudness in the range 0.0-1.0 to a scaling factor. For instance, if you want to say that “cutting speed at loudness=1.0 should be 4 times faster than the cutting speed at loudness=0.0”, you would define the transfer curve like this -
(segment-duration-tc 0.0 1.0
                     1.0 0.25)
The scaling factor for loudness values like 0.5 will be determined by proportional (linear) interpolation between the values for the nearby points - which are in this case 0.0 and 1.0.

Note that you can expressions based on, say, style parameters to calculate the level values as well as the scaling factor values. For example -
(style-parameters
 (continuous-slider SPEED 0.0 -2.0 2.0)
 ....)
 
(segment-duration-tc 0.0 (/ 3.0 (pow 2 SPEED))
                     1.0 (/ 0.8 (pow 2 SPEED)))

6.4.3 Transition duration scaling factor

Similar to the segment duration scaling factor transfer curve, you can specify that transition durations should be longer when the music is soft and shorter when the music is louder using, for instance -
(transition-duration-tc 0.0 2.0
                        0.65 0.3
                        1.0 0.3)

If you want to specify cuts, you can use a value of 0.0.

(preferred-transition-duration dur-secs)  void
  dur-secs : number
The value of the transition duration transfer curve is a scaling factor which is applied to the preferred-transition-duration setting.

(min-segment-duration-for-transition dur-secs)  void
  dur-secs : number
Specifies a cut off duration below which you only get cuts. You can use this to introduce transitions only when you think the duration of segments is long enough for your transitions to make editing sense.

6.4.4 Time warping

You get an emotionally appealing edit when you introduce slow motion video when the music is soft, speeding up to normal motion when the music activity picks up. You specify such behaviour using the time warp transfer curve.

For example, the transfer curve -
(time-warp-tc 0.0 1/4
              0.5 1.0
              1.0 1.0)
will cause video to be played back in 4x slow motion when the music loudness is 0.0, gradually speeding up to normal speed (1.0) when the music loudness gets to 0.5 and staying at 1.0 for more energetic music levels. You can also specify values beyond 1.0 to cause video to play fast forward.

6.4.5 Music descriptors

Several descriptors are made available as normal muSE functions.

(loudness t)

loudness is a function of time (expressed in seconds since the start of the muvee) and evaluates to the loudness of the mixed music at the given time. It will always yield a value in the range 0.0 to 1.0 and can therefore be used with the with-descriptor function (see About effects and transitions).

(cut-hint t) and (flash-hint t)

Evaluates to a time-value pair (t . v) if a cut hint or a flash hint is present at the given time t, or to () if there’s no such hint at the given time.

(cut-hints t1 t2) and (flash-hints t1 t2)

These give you the respective hints as a list of (t . v) pairs where the times fall within the given interval [t1,t2).

(cut-hint t pref-dur-beats) and (flash-hint t pref-dur-beats)

These give you a cut or flash hint as a (t . v) pair that is somewhere around (t + (beats->secs pref-dur-beats)) and has a maximal value v among the hints near that time.

(set-additional-music-hints hint-type list-of-time-value-conses)

(New in Reveal X!)

A style can use this to provide additional hints about edit timing to the muvee engine. (The additional hints provided via this function do no affect the cut-hints and flash-hints functions.

hint-type should either be 'cut-hints or 'flash-hints. The list-of-time-value-conses is a list in exactly the same format as the data returned by cut-hints and flash-hints functions. The "value" part of the time-value pairs is expected to be in the range 0 to 1, but it is not necessary for it to conform to that range though less than 0 would not be of much use. It can be greater than 1 though.