summaryrefslogtreecommitdiff
path: root/doc/layering/layering.tex
blob: 317aaeae43a8909dd5f7c38e04cb2f164153c72b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
\documentclass{article}
\title{Region Layering}
\author{}
\date{}

\usepackage{graphicx}
\begin{document}
\maketitle

\section{Introduction}

When regions overlap in time, we need to decide which one should be
played.  Ardour has a few options to set how this decision is made.


\subsection{Layers}

Each region on a playlist is on a \emph{layer}.  All overlapping regions
are on a unique layer, and when overlaps exist the highest-layered
region is played.  This is illustrated in Figure~\ref{fig:basic-layering}.

\begin{figure}[ht]
\begin{center}
\includegraphics{basic-layering.pdf}
\end{center}
\caption{Basic region layering}
\label{fig:basic-layering}
\end{figure}

Here we see that region $A$ overlaps $B$, $B$ overlaps $C$, and
$D$ overlaps nothing.  There are several ways in which these regions
could be arranged; in the drawing, $A$ is on layer~2, $B$ on layer~1,
$C$ and $D$ on layer~0.  If this area is played back, region $A$ will
play in its entirety, followed by the end part of region $B$, followed
by the end part of region $C$, followed by the whole of region $D$.
This follows the basic rule that, at any given point, the region on
the highest layer will be played.


\section{Choice of layering}

There are two main decisions to be made with regards to how a playlist should be layered:

\begin{itemize}
\item Given overlapping regions, what order should they be layered in?
\item When should layering be changed?
\end{itemize}


\subsection{Layering order}

Ardour provides three-and-a-half ways to decide on the order in which
regions are layered.  The most basic choice is:

\begin{itemize}
\item \emph{Later is higher} --- regions which are later in time will
  be on higher layers.
\item \emph{Most recently added is higher} --- regions which were more
  recently added to the playlist will be on higher layers.
\item \emph{Most recently edited or added is higher} --- regions which
  were more recently edited or added to the playlist will be on
  higher layers.
\end{itemize}

This choice can be set per-session from the \emph{Session Properties} dialogue
box.

\subsubsection{Explicit ordering}

There are also cases when none of these rules should apply.  If, for
example, you want to put a given region at the top of the stack (on
the highest layer), this is possible using the region `raise to top'
command.  Following such a command (called an `explicit layering'),
the regions on the playlist may no longer obey any of the standard
ordering rules.

This situation also arises when editing tracks using the `stacked' layer mode.
In this mode, almost all layering is explicit.  When starting a region drag,
the other regions on a track spread apart vertically to allow the dragged
region to be dropped in any position within the region stack.  The normal
layering rules will only be followed if a region is dropped on top of another;
in all other cases, explicit layering will be used to put the region wherever
it was dropped.

\subsection{When to update layering}

There are two distinct approaches to updating layering:

\begin{itemize}
\item Update whenever any region edit is performed.
\item Update only when a region is edited such that a new overlap has been set up.
\end{itemize}

The approach to use is optional, and can be set in \emph{Session Properties}.

This decision only has consequences when an explicit layering command has
been used.  Consider the case in Figure~\ref{fig:explicit-layering1}.

\begin{figure}[ht]
\begin{center}
\includegraphics{explicit-layering1.pdf}
\end{center}
\caption{Explicit layering: stage 1}
\label{fig:explicit-layering1}
\end{figure}

Given that arrangement, imagine that we perform a `raise to top' on region $C$.
This results in the arrangement in Figure~\ref{fig:explicit-layering2}.

\begin{figure}[ht]
\begin{center}
\includegraphics{explicit-layering2.pdf}
\end{center}
\caption{Explicit layering: stage 2}
\label{fig:explicit-layering2}
\end{figure}

Imagine now that region $C$ is moved very slightly to the left, so
that it still overlaps both $A$ and $B$.  If we are updating whenever
any region edit is performed, this will result in a relayer; the
regions' arrangement will go back to that in
Figure~\ref{fig:explicit-layering1}.

If, on the other hand, we only relayer when a new overlap is set up,
the region layering will remain as in
Figure~\ref{fig:explicit-layering2}.  Before the edit, regions $A$,
$B$ and $C$ overlapped; after the edit, the situation is the same, so
no relayering is performed.

Another, more complex, example is shown in Figure~\ref{fig:tricky-explicit-layering}.

\begin{figure}[ht]
\begin{center}
\includegraphics{tricky-explicit-layering.pdf}
\end{center}
\caption{More complex explicit layering}
\label{fig:tricky-explicit-layering}
\end{figure}

% XXX: this makes no sense

Here, imagine that $C$ has been moved to the top of the stack with an explicit
`raise to top' command.  Now consider an extension of $C$ so that its
right-hand edge overlaps $D$.  If we are relayering only on new overlaps, this
case presents one new overlap (that of $C$ with $D$).  In this case, $C$ is
moved according to the current layering rules so that it is correct with
respect to $D$.  In addition, $A$ and $B$ are re-layered so that the relation
of $C$ to $A$ and $B$ is preserved.

\end{document}