From 6304261b980419eaafde84bc32ff5e8f1c7aa236 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Dec 2011 01:42:49 +0000 Subject: Re-work layering in possibly debatable ways. Sketchy docs in doc/layering. git-svn-id: svn://localhost/ardour2/branches/3.0@11088 d708f5d6-7413-0410-9779-e7cbd77b26cf --- doc/layering/.gitignore | 3 + doc/layering/basic-layering.svg | 322 +++++++++++++++++++++++++++++ doc/layering/build.sh | 9 + doc/layering/explicit-layering1.svg | 322 +++++++++++++++++++++++++++++ doc/layering/explicit-layering2.svg | 322 +++++++++++++++++++++++++++++ doc/layering/layering.tex | 150 ++++++++++++++ doc/layering/tricky-explicit-layering.svg | 323 ++++++++++++++++++++++++++++++ 7 files changed, 1451 insertions(+) create mode 100644 doc/layering/.gitignore create mode 100644 doc/layering/basic-layering.svg create mode 100644 doc/layering/build.sh create mode 100644 doc/layering/explicit-layering1.svg create mode 100644 doc/layering/explicit-layering2.svg create mode 100644 doc/layering/layering.tex create mode 100644 doc/layering/tricky-explicit-layering.svg (limited to 'doc') diff --git a/doc/layering/.gitignore b/doc/layering/.gitignore new file mode 100644 index 0000000000..debc120c45 --- /dev/null +++ b/doc/layering/.gitignore @@ -0,0 +1,3 @@ +*.aux +*.pdf +*.log diff --git a/doc/layering/basic-layering.svg b/doc/layering/basic-layering.svg new file mode 100644 index 0000000000..e8b1e64f17 --- /dev/null +++ b/doc/layering/basic-layering.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + time + + + + + A + B + C + D + + layer + + 0 + + 1 + + 2 + + diff --git a/doc/layering/build.sh b/doc/layering/build.sh new file mode 100644 index 0000000000..5abaaa5721 --- /dev/null +++ b/doc/layering/build.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +for f in basic-layering explicit-layering1 explicit-layering2 tricky-explicit-layering; do + inkscape -z --export-area-drawing -f $f.svg --export-pdf $f.pdf +done + +pdflatex layering.tex +pdflatex layering.tex + diff --git a/doc/layering/explicit-layering1.svg b/doc/layering/explicit-layering1.svg new file mode 100644 index 0000000000..2a5c921ce7 --- /dev/null +++ b/doc/layering/explicit-layering1.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + time + + + + + A + B + C + D + + layer + + 0 + + 1 + + 2 + + diff --git a/doc/layering/explicit-layering2.svg b/doc/layering/explicit-layering2.svg new file mode 100644 index 0000000000..4f71a40eb9 --- /dev/null +++ b/doc/layering/explicit-layering2.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + time + + + + + A + B + C + D + + layer + + 0 + + 1 + + 2 + + diff --git a/doc/layering/layering.tex b/doc/layering/layering.tex new file mode 100644 index 0000000000..317aaeae43 --- /dev/null +++ b/doc/layering/layering.tex @@ -0,0 +1,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} diff --git a/doc/layering/tricky-explicit-layering.svg b/doc/layering/tricky-explicit-layering.svg new file mode 100644 index 0000000000..f4e89f6f92 --- /dev/null +++ b/doc/layering/tricky-explicit-layering.svg @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + time + + + + A + B + + C + D + + layer + + 0 + + 1 + + 2 + + -- cgit v1.2.3