summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-01 19:38:40 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-01 19:38:40 +0100
commit89adce51567e5875eb285f4ded1638d3aba2b58f (patch)
treeb4f0dbe106b6d3f1c3fe6ae30d75277fcf5c3986
parent1c0e52c4afe93029b6b45ec53cd60b4addae4401 (diff)
Resolve some of the TODOs.
-rw-r--r--sampling_alg_lac2020/LAC-20.tex20
1 files changed, 18 insertions, 2 deletions
diff --git a/sampling_alg_lac2020/LAC-20.tex b/sampling_alg_lac2020/LAC-20.tex
index 52eb740..285323e 100644
--- a/sampling_alg_lac2020/LAC-20.tex
+++ b/sampling_alg_lac2020/LAC-20.tex
@@ -283,10 +283,26 @@
\todobent{Talk about loudness computation of samples.}
\todo{Mathematical basics (if there are any important ones).}
\todo{Formalize the setting, i.e.\ what is the input/output of our algorithm?}
+\todoandre{Make terminology and notation clear and check for consistency in the document.}
+
+\subsection{Notation and Terminology}
+We use the following notation throughout this article. An \emph{instrument} is considered to be one of the drums of the drum kit that we sampled. A \emph{sample} (denoted by $s, s', \dots$) is recording of one hit on a specific instrument. The \emph{power} of a sample (denoted by $p, p', \dots$) is the perceived loudness and can be expressed by any common loudness measure of an audio clip. With the term \emph{velocity} (denoted by $v, v', \dots$), we refer to the attack velocity of a MIDI note and it is thus between 0 and 127. We consider time in a discretized way and thus a \emph{time point} is an integer value intuitively referring to the number of time steps passed since the beginning of time. For a sample $s$, we refer with $t_s$ to the time point at which the sample was played last.
\section{Requirements}
-\todoandre{Intuitively discuss the requirements of a good sampling algorithm.}
-\todoandre{List the requirements one by one and discuss them. Try to formalize them in some way.}
+
+% \todoandre{Intuitively discuss the requirements of a good sampling algorithm.}
+We now discuss which requirements a good sampling algorithm intuitively has to fulfill. Such an algorithm has a tradeoff between two main objectives: choosing a sample which is close to the requested power value, while not choosing the same sample too close to the previous time it was used. Note that if we just want to be as close as possible to the requested power value, then we would always just choose the closest sample. However, if we now play a sequence of the same instrument at the same power level, then we play the same sample and thereby obtain a robotic sound. Thus, we want to find other samples that are not too far.
+
+% \todoandre{List the requirements one by one and discuss them. Try to formalize them in some way.}
+More concretely, we aim to fulfill the following requirements with our proposed algorithm.
+\begin{description}
+ \item[Close Sample:] The chosen sample should be reasonably close to the requested power value, such that the listener perceives it as being played at the same velocity.
+ \item[Avoid Same Samples:] When we have multiple samples to choose from we should always take one that was last played far enough in the past to avoid a robotic sound.
+ \item[Randomization:] Furthermore, to avoid patterns (like e.g. in round robin, where exactly every $n$th hit sounds the same when we have $n$ samples in our velocity group), we want some randomization.
+ \item[Locality:] If two samples have a very similar power value, they should also be treated similarly by the algorithm. In other words, locally, samples should have almost the same probability of being chosen.
+\end{description}
+
+We now formalize the requirements stated above. Let $p, p'$ be two power levels. We define their dissimilarity to simply be their distance $\abs{p - p'}$. Thus, if $p$ is the input power value and $p'$ is the power value of the chosen sample, we want to minimize the above term. Let $s$ be a sample and $t_s$ the time point it was played last. When we are now queried for a sample at time $t'$, then for $s$ to be a good sample, we want $\abs{t_s - t'}$ to be reasonably high. Again, we just use the distance between the current time step and the last time step a sample was used. Randomization is difficult to formalize in a simple way in this context, thus, we simply require that for the same history, different outcomes of choosing a sample should be possible. The last requirement we also state in a more intuitive than formal way. Assume we are requested a sample for the power value $p$ and the two samples $s, s'$ have a very similar power value. Then, if we exchange $t_s$ and $t_{s'}$, the probability of choosing $s$ over $s'$ should be roughly the same as if we don't exchange them.
\section{Algorithm}
\todoandre{We have a multi-criteria optimization!}