7.11 Getting into deep waters
The other sections under About effects and transitions describe how to use primitive effects and combine them to create complex compositions. This section is about how the effect combinators work. We’ll be stepping into the rabbit hole.
TODO: ShowTime needs more documentation.
To gain a full understanding of the innards of the effect combinators, you need to understand some basics of ShowTime and Shows.
7.11.1 What is an effect?
An effect may be defined as an operator that works on a given set of input Shows over a time interval to produce a modified Show. In conventional editing literature, the term effect is usually used to refer to one-input effects and the term transition is used for two-input effects. For the purpose of this section, we’ll simply use the term effect to mean either kind .. and in fact include more kinds such as the zero-input effect which we otherwise refer to using the term layer.
Effects are instances of effect specifications. i.e. an effect specification when applied to a set of inputs over a specific time interval yields an effect as a Show.
(fn (start stop inputs) ; Something that produces a Show. ....)
(effect "Translate" (A) ; <- '(A)' is the input pattern. ....)
(fn (start stop (A)) ....)
Therefore, the symbols start, stop and A are automatically made available in the body of the effect specification to compute any aspect of the effect.
7.11.2 Rolling your own effects
As of this writing, you cannot create your own primitive effects. However, you can write any function that has the above signature and evaluates to a Show and use it as an effect (almost) anywhere an effect is accepted.
(define blank (fn (start stop (A)) A))
7.11.3 The effect primitivity restriction
The effect primitivity restriction might be removed in the future.
(define muvee-segment-effect ....)
(define muvee-global-effect ....)
7.11.4 Rolling your own effect combinators
(define (two-part-effect a b) (fn (start stop (A)) (let ((mid-point (math (start + stop) / 2))) (b mid-point stop (list (a start mid-point (list A)))))))
We’ll leave the analysis of how that works as an exercise. A hint is to remember that a and b are one-input effect specifications and to go back to the definition of an effect specification above to understand what you get when you apply them to specific time intervals and inputs.
You need to be aware of the The effect primitivity restriction when designing your own effect combinators.