Mercurial > hg > syncopation-dataset
diff SMC2015latex/section/framework.tex @ 59:79ce0dd91946
updating intro
author | christopherh <christopher.harte@eecs.qmul.ac.uk> |
---|---|
date | Mon, 27 Apr 2015 12:51:49 +0100 |
parents | 093ad287e130 |
children | e2b9ccb92973 |
line wrap: on
line diff
--- a/SMC2015latex/section/framework.tex Mon Apr 27 12:27:12 2015 +0100 +++ b/SMC2015latex/section/framework.tex Mon Apr 27 12:51:49 2015 +0100 @@ -6,7 +6,27 @@ \caption{Module hierarchy in the synpy toolkit: The top-level module provides a simple interface for the user to test different syncopation models. Musical constructs such as bars, velocity and note sequences, notes and time signatures are defined in the `music objects' module while support for common procedures such as sequence concatenation and subdivision is provided in `basic functions'. Models and file reading components can be interchanged as required by the user.\label{fig:framework}} \end{figure} -The architecture of the toolkit is relatively simple (see Figure~\ref{fig:framework}). At the top level, syncopation values can be calculated for each bar in a given source of rhythm data; the user specifies which model to use and supplies any special parameters that are required. Sources of rhythm data can be a bar object or a list of bars (detailed below in section\ref{sec:musicobjects}) or, alternatively, the name of a file containing music data. Where a model is unable to calculate a value for a given rhythm pattern, a “None” value is recorded for that bar and the indices of unmeasured bars reported in the output. Output can optionally be saved directly to XML or JSON files. +The architecture of the toolkit (shown in Figure~\ref{fig:framework}) provides a simple interface to the user. Syncopation values can be calculated for each bar in a given source of rhythm data; the user specifies which model to use and supplies any special parameters that are required. Sources of rhythm data can be a bar object or a list of bars (detailed below in section~\ref{sec:musicobjects}) or, alternatively, the name of a file containing music data. Where a model is unable to calculate a value for a given rhythm pattern, a “None” value is recorded for that bar and the indices of unmeasured bars reported in the output. Output can optionally be saved directly to XML or JSON files. An example of usage in the Python interpreter is shown in Figure~\ref{ta:example}. + +\begin{figure} +\footnotesize{ +\begin{minted}[frame=single,framesep=10pt]{python} +>>>from synpy import * +>>>import synpy.PRS as model +>>>calculate_syncopation(model, "clave.rhy") +{'bars_with_valid_output': [0, 1], + 'mean_syncopation_per_bar': 8.625, + 'model_name': 'PRS', + 'number_of_bars': 2, + 'number_of_bars_not_measured': 0, + 'source': 'clave.rhy', + 'summed_syncopation': 17.25, + 'syncopation_by_bar': [8.625, 8.625]} +\end{minted} +} +\caption{To use the toolkit, the top level \code{synpy} module is imported along with a model (in this example Pressing \cite{Pressing97}). Calling \code{calculate\_syncopation()} then gives the syncopation results as shown. +\label{ta:example} } +\end{figure} \subsection{Music objects} \label{sec:musicobjects} @@ -37,25 +57,6 @@ \subsection{Plugin architecture} The system architecture has been designed to allow new models to be added easily. Models have a common interface, exposing a single function that will return the syncopation value for a bar of music. Optional parameters may be supplied as a Python dictionary if the user wishes to specify settings different from the those given in the literature for a specific model. -\begin{figure} -\footnotesize{ -\begin{minted}[frame=single,framesep=10pt]{python} ->>>from synpy import * ->>>import synpy.PRS as model ->>>calculate_syncopation(model, "clave.rhy") -{'bars_with_valid_output': [0, 1], - 'mean_syncopation_per_bar': 8.625, - 'model_name': 'PRS', - 'number_of_bars': 2, - 'number_of_bars_not_measured': 0, - 'source': 'clave.rhy', - 'summed_syncopation': 17.25, - 'syncopation_by_bar': [8.625, 8.625]} -\end{minted} -} -\caption{To use the toolkit, the top level \code{synpy} module is imported along with a model (in this example Pressing \cite{Pressing97}); calling \code{calculate\_syncopation()} gives the syncopation results as shown. -\label{ta:example} } -\end{figure}