% -----------------------------------------------
% Template for SMAC SMC 2013
% adapted and corrected from the template for SMC 2012, which was adapted from that of SMC 2011
% -----------------------------------------------

\documentclass{article}
\usepackage{smacsmc2013}
\usepackage{times}
\usepackage{ifpdf}
\usepackage[english]{babel}
\usepackage{cite}
\usepackage{caption}
\usepackage{subcaption}

%%%%%%%%%%%%%%%%%%%%%%%% Some useful packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%% See related documentation %%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{amsmath} % popular packages from Am. Math. Soc. Please use the 
%\usepackage{amssymb} % related math environments (split, subequation, cases,
%\usepackage{amsfonts}% multline, etc.)
%\usepackage{bm}      % Bold Math package, defines the command \bf{}
%\usepackage{paralist}% extended list environments
%%subfig.sty is the modern replacement for subfigure.sty. However, subfig.sty 
%%requires and automatically loads caption.sty which overrides class handling 
%%of captions. To prevent this problem, preload caption.sty with caption=false 
%\usepackage[caption=false]{caption}
%\usepackage[font=footnotesize]{subfig}



%allowing the users to undertake an engaging form of citizen science
%Mobile apps provide a new and unique opportunity for collecting data Ôin the wildÕ.  This allows for a greater reach, and the ability to collect greater amounts of data than would be possible in traditional experimental scenarios.
%they generally serve to combine the input from many individuals to find commonalities and trends; eliciting a kind of Ôwisdom of the crowdsÕ.
% Such ÔcrowdsourcedÕ data collection is an increasingly common methodology in the research community, and can provide insights that would not be possible to achieve in any other way. For example in the creative sector, the evaluation of broad classification of musical aesthetics requires many individuals to make personal choices to produce robust patterns of data. 
%


%user defined variables
\def\papertitle{How Predictable Do We Like Our Music? Eliciting Aesthetic Preferences With The Melody Triangle Mobile App }
\def\firstauthor{Henrik Ekeus}
\def\secondauthor{Samer A. Abdallah}
\def\thirdauthor{Peter W. McOwan}
\def\fourthauthor{Mark D. Plumbley}

% adds the automatic
% Saves a lot of ouptut space in PDF... after conversion with the distiller
% Delete if you cannot get PS fonts working on your system.

% pdf-tex settings: detect automatically if run by latex or pdflatex
\newif\ifpdf
\ifx\pdfoutput\relax
\else
   \ifcase\pdfoutput
      \pdffalse
   \else
      \pdftrue
\fi

\ifpdf % compiling with pdflatex
  \usepackage[pdftex,
    pdftitle={\papertitle},
    pdfauthor={\firstauthor, \secondauthor, \thirdauthor},
    bookmarksnumbered, % use section numbers with bookmarks
    pdfstartview=XYZ % start with zoom=100% instead of full screen; 
                     % especially useful if working with a big screen :-)
   ]{hyperref}
  %\pdfcompresslevel=9

  \usepackage[pdftex]{graphicx}
  % declare the path(s) where your graphic files are and their extensions so 
  %you won't have to specify these with every instance of \includegraphics
  \graphicspath{{./figures/}}
  \DeclareGraphicsExtensions{.pdf,.jpeg,.png}

  \usepackage[figure,table]{hypcap}

\else % compiling with latex
  \usepackage[dvips,
    bookmarksnumbered, % use section numbers with bookmarks
    pdfstartview=XYZ % start with zoom=100% instead of full screen
  ]{hyperref}  % hyperrefs are active in the pdf file after conversion

  \usepackage[dvips]{epsfig,graphicx}
  % declare the path(s) where your graphic files are and their extensions so 
  %you won't have to specify these with every instance of \includegraphics
  \graphicspath{{./figures/}}
  \DeclareGraphicsExtensions{.eps}

  \usepackage[figure,table]{hypcap}
\fi

%setup the hyperref package - make the links black without a surrounding frame
\hypersetup{
    colorlinks,%
    citecolor=black,%
    filecolor=black,%
    linkcolor=black,%
    urlcolor=black
}

\usepackage{tools} 
\newcommand{\colfig}[2][1]{\includegraphics[width=#1\linewidth]{figs/#2}}
\newcommand\past[1]{\overset{\rule{0pt}{0.2em}\smash{\leftarrow}}{#1}}
\newcommand\fut[1]{\overset{\rule{0pt}{0.1em}\smash{\rightarrow}}{#1}}

% Title.
% ------
\title{\papertitle}

% Authors
% Please note that submissions are NOT anonymous, therefore 
% authors' names have to be VISIBLE in your manuscript. 
%
% Single address
% To use with only one author or several with the same address
% ---------------
\oneauthor
   {\firstauthor \textsuperscript{1}, \secondauthor \textsuperscript{2}, \thirdauthor \textsuperscript{1}, \fourthauthor \textsuperscript{1}} {\textsuperscript{1}Centre for Digital Music, Queen Mary University of London \\\textsuperscript{2}Department of Computer Science, University College London\\%
     {\tt \href{mailto:hekeus@eecs.qmul.ac.uk,peter.mcowan@eecs.qmul.ac.uk,mark.plumbley@eecs.qmul.ac.uk,s.abdallah@ucl.ac.uk}{\{hekeus,peter.mcowan,mark.plumbley\}@eecs.qmul.ac.uk}}\\
      {\tt \href{mailto:hekeus@eecs.qmul.ac.uk,peter.mcowan@eecs.qmul.ac.uk,mark.plumbley@eecs.qmul.ac.uk,s.abdallah@ucl.ac.uk}{s.abdallah@ucl.ac.uk}}}

%Two addresses
%--------------
% \twoauthors
%   {\firstauthor} {Affiliation1 \\ %
%     {\tt \href{mailto:author1@smcnetwork.org}{author1@smcnetwork.org}}}
%   {\secondauthor} {Affiliation2 \\ %
%     {\tt \href{mailto:author2@smcnetwork.org}{author2@smcnetwork.org}}}

% Three addresses
% --------------
% \threeauthors
%   {\firstauthor} {Affiliation1 \\ %
%     {\tt \href{mailto:author1@smcnetwork.org}{author1@smcnetwork.org}}}
%   {\secondauthor} {Affiliation2 \\ %
%     {\tt \href{mailto:author2@smcnetwork.org}{author2@smcnetwork.org}}}
%   {\thirdauthor} { Affiliation3 \\ %
%     {\tt \href{mailto:author3@smcnetwork.org}{author3@smcnetwork.org}}}


% ***************************************** the document starts here ***************
\begin{document}
%
\capstartfalse
\maketitle
\capstarttrue
%
\begin{abstract}
The Melody Triangle is a smartphone application for Android that lets users easily create musical patterns and textures.  
%The user creates melodies by specifying positions within a triangle, and these positions directly map to the information theoretic properties of the generated output sequences. 
The user creates melodies by specifying positions within a triangle, and these positions correspond to the information theoretic properties of generated musical sequences.
 A model of human expectation and surprise in the perception of music, \emph{information dynamics}, is used to `map out' a musical generative system's parameter space, in this case Markov chains.  This enables a user to explore the possibilities afforded by Markov chains, not by directly selecting their parameters, but by specifying the subjective \emph{predictability} of the output sequence.
As users of the app find melodies and patterns they like, they are encouraged to press a `like' button, where their setting are uploaded to our servers for analysis.  Collecting the `liked' settings of many users worldwide will allow us to elicit trends and commonalities in aesthetic preferences across users of the app, and to investigate how these might relate to the information-dynamic model of human expectation and surprise.  
We outline some of the relevant ideas from information dynamics and how the Melody Triangle is defined in terms of these.  We then describe the Melody Triangle mobile application, how it is being used to collect research data and how the collected data will be evaluated.
\end{abstract}
%

\section{Introduction}\label{sec:introduction}
The use of generative stochastic processes in music composition has been widespread for
decades---for instance Iannis Xenakis applied probabilistic mathematical models
to the creation of musical materials\cite{Xenakis:1992ul}.  However it can sometimes be difficult for a composer to find desirable parameters and navigate the possibilities of a generative algorithm intuitively.  

\sloppy The Melody Triangle is an interface for the discovery of melodic content where the parameter space of a stochastic generative musical process, the Markov chain, is `mapped out' according to the \emph{predictability} of the output.  The Melody Triangle was developed in the context of \emph{information dynamics}\cite{Abdallah:2009p4089}; an information theoretic approach to modelling human expectation and surprise in the perception of music. 
Users of the Melody Triangle do not select the parameters to generative processes directly, rather they provide input in the form of a position within a triangle, and this maps to the information theoretic properties of an output melody.  
 For instance one corner of the triangle returns completely random melodies, while an other area yields entirely predictable and periodic patterns, the entirety of the triangle covering a spectrum of predictability of the output melodies.  

\fussy In section \ref{s:Intro} we review the concepts and ideas behind information dynamics, and outline the information measures that lead to the development of the Melody Triangle, which have been described in greater detail in our previous work \cite{Abdallah:2009p4089}.  In section \ref{makingthetriangle} we describe how these information measures are used to construct the Melody Triangle, and how the triangular interface is used to retrieve patterns of symbols that are then mapped to notes or percussive sounds.  The Melody Triangle has in previous work been implemented as an interactive installation and as a desktop application, these implementations are described and evaluated in \cite{ekeusmt1}.
In section \ref{theapp} we describe the Melody Triangle mobile app for Android, which is the main contribution of this paper.   We outline its features, how it allows users to share their settings with each other, and how it is currently being used to collect data for research. We then describe how the collected data will be interpreted to identify trends and commonalities in aesthetic preferences across users of the app, and to determine if parallels between these preferences and the information dynamics models can be made.

\section{Information Dynamics}
\label{s:Intro}
	The relationship between
	Shannon's \cite{Shannon48} information theory and music and art in general has been the
	subject of some interest since the 1950s 
	\cite{Youngblood58,CoonsKraehenbuehl1958,Moles66,Meyer67,Cohen1962}. 
	The general thesis is that perceptible qualities and subjective states
	like uncertainty, surprise, complexity, tension, and interestingness
	are closely related to information-theoretic quantities like
	entropy, relative entropy, and mutual information.

Music is an inherently dynamic process.  %The idea that the musical experience is strongly shaped by the generation
	%and playing out of strong and weak expectations was put forward by, amongst others, 
	%music theorists L. B. Meyer \cite{Meyer:1967} and Narmour \cite{Narmour:1977}.
	%Music theorists L.B. Meyer  \cite{Meyer:1967} and Narmour \cite{Narmour:1977}
	An essential aspect of this is that music is experienced as a phenomenon
	that unfolds in time, rather than being apprehended as a static object
	presented in its entirety. Meyer \cite{Meyer67} and Narmour \cite{Narmour77} argued that the experience depends
	on how we change and revise our conceptions \emph{as events happen}, on
	how expectation and prediction interact with occurrence, and that, to a
	large degree, the way to understand the effect of music is to focus on
	this `kinetics' of expectation and surprise.

 Prediction and expectation are essentially probabilistic concepts
  and can be treated mathematically using probability theory.
  We suppose that when we listen to music, expectations are created on the basis 
	of our familiarity with various styles of music and our ability to
	detect and learn statistical regularities in the music as they emerge.
	There is experimental evidence that human listeners are able to internalise
	statistical knowledge about musical structure 
	\cite{SaffranJohnsonAslin1999}, and also
	that statistical models can form an effective basis for computational
	analysis of music 
	\cite{ConklinWitten95,PonsfordWigginsMellish1999,Pearce2005}.

Information dynamics considers several different kinds of predictability in musical patterns, how these might be quantified using the tools of information theory, 
and how they shape or affect the listening experience.  Our working hypothesis is that listeners maintain a dynamically evolving probabilistic belief state that enables them to make predictions about how a piece of music will continue.  

They do this using both the immediate context of the piece as well as using previous musical experience, such as a familiarity with musical styles and conventions.  As the music unfolds, listeners continually revise this belief state, which includes predictive
	distributions over possible future events.    These changes in probabilistic beliefs can be associated with
quantities of information; these are the focus of information dynamics.

In this next section we briefly describe the information measures that we use to define the Melody Triangle, however a more complete overview of information dynamics and some of its applications can be found in \cite{Abdallah:2009p4089} and \cite{CIP}.

\subsection{Sequential Information Measures}\label{sec:Sequential_Information_Measures}

Consider a sequence of symbols from the viewpoint of an observer at a certain time, and split the
sequence into a single symbol in the \emph{present} ($X_t$), an infinite \emph{past} ($\past{X}_t$) and the 
infinite \emph{future} ($\fut{X}_t$).  The symbols arrive at a constant, uniform rate.

The \emph{entropy rate} of a random process is a well-known, basic measure of its randomness or
unpredictablity. The entropy rate is the entropy, \emph{H}, of the \emph{present} given the \emph{past}:
\begin{equation}
		\label{eq:entro-rate}
		h_\mu = H(X_t|\past{X}_t).
\end{equation}
\sloppy that is, it represents our average uncertainty about the present symbol \emph{given}
that we have observed everything before it. Processes with zero entropy rate can
be predicted perfectly given enough of the preceding context.

\fussy The \emph{multi-information rate} $\rho_\mu$ \cite{Dubnov2004}
	is the mutual
	information, \emph{I}, between the `past' and the `present':
\begin{equation}
	\label{eq:multi-info}
			\rho_\mu  =  I(\past{X}_t;X_t) = H(X_t) - H(X_t|\past{X}_t).
\end{equation}

Multi-information rate can be thought of as measures of \emph{redundancy}, quantifying the extent to which the same information is to be found in all parts of the sequence.
It is a measure of how much the predictability of the process depends on knowing the
preceding context. It is the difference between the entropy of a single element of the
sequence in isolation (imagine choosing a note from a musical score at random with your 
eyes closed and then trying to guess the note) and its entropy after taking into account
the preceding context:
If the previous symbols reduce our uncertainty about the present symbol a great deal, then 
the redundancy is high. For example, if we know that a sequence consists of a repeating
cycle such as \ldots b, c, d, a, b, c, d, a \ldots, but we do not know which was the first
symbol, then the redundancy is high, as $H(X_t)$ is high (because we
have no idea about the present symbol in isolation), but $H(X_t|\past{X}_t)$
is zero, because knowing the previous symbol immediately tells us what the present symbol is.

The \emph{predictive information rate} (PIR) \cite{Abdallah:2009p4089} brings in our uncertainty about the future. It is a
measure of how much each symbol reduces our uncertainty about the future as it is
observed, \emph{given} that we have observed the past:
\begin{equation}
\label{eq:PIR}
		b_\mu = I(X_t;\fut{X}_t|\past{X}_t) = H(\fut{X}_t|\past{X}_t) - H(\fut{X}_t|X_t,\past{X}_t).
\end{equation}
\sloppy It is a measure of the mutual information between the `present' and the `future' given the `past'.  In other words, it is a measure of the \emph{new} information in each symbol.

\fussy The behaviour of the predictive information rate make it interesting from a compositional point of view. The definition 
of the PIR is such that it is low both for extremely regular processes, such as constant
or periodic sequences, \emph{and} low for extremely random processes, where each symbol
is chosen independently of the others, in a kind of `white noise'. In the former case,
the pattern, once established, is completely predictable and therefore there is no
\emph{new} information in subsequent observations. In the latter case, the randomness
and independence of all elements of the sequence means that, though potentially surprising,
each observation carries no information about the ones to come.
\begin{fig}{wundt}
    \raisebox{-4em}{\colfig[0.43]{wundt}}
    {\ {\large$\longrightarrow$}\ }
    \raisebox{-4em}{\colfig[0.43]{wundt2}}
    \caption{
      The Wundt curve relating randomness/complexity with
      perceived value. Repeated exposure sometimes results
      in a move to the left along the curve \cite{Berlyne71}.
    }
  \end{fig}
Processes with high PIR maintain a certain kind of balance between
predictability and unpredictability in such a way that the observer must continually
pay attention to each new observation as it occurs in order to make the best
possible predictions about the evolution of the sequence. This balance between predictability
and unpredictability is reminiscent of the inverted `U' shape of the Wundt curve (see \Figrf{wundt}), 
which summarises the observations of Wundt \cite{Wundt1897} that stimuli are most
pleasing at intermediate levels of novelty or disorder, where there is a balance between
`order' and `chaos'. 

\begin{fig}{tranmatrix}
\centering
\includegraphics[width=0.49\linewidth]{figs/PeriodicMatrix.pdf}
\includegraphics[width=0.49\linewidth]{figs/NonPeriodicMatrix.pdf}
\caption{Two transition matrixes representing Markov chains.  The shade of grey represents the probabilities of transition from one symbol to the next (white=0, black=1). The current symbol is along the bottom, and the next symbol is along the left.  The left hand matrix has no uncertainty; it represents a periodic pattern (a,d,c,b,a,d,c,b,a,d,c,b,a\dots). The right hand matrix contains unpredictability but nonetheless is not completely without perceivable structure (we know for instance that any `b' will always be followed by an `a' and preceded by a `c'), it is of a higher entropy rate. \label{TransitionMatrixes}}
\end{fig}
  
  
 \begin{fig}{mtriscat}
 	\centering
	\begin{subfigure}[b]{0.5\textwidth}
		\centering
		\includegraphics[width=\textwidth]{./figs/meltriplot_diag3_cropped.pdf}
		\caption{}
		\label{mtriscat_diag}
	\end{subfigure}
	\begin{subfigure}[b]{0.5\textwidth}
		\centering
		\includegraphics[width=0.66\textwidth]{./figs/meltriplot_top3_cropped.pdf}
		\label{mtriscat_top}
		\caption{}
	\end{subfigure}
	\caption{The population of hundreds of randomly generated 8-state transition matrices in the 3D space of 
	entropy rate ($h_\mu$), redundancy ($\rho_\mu$) and predictive information rate ($b_\mu$), 
	all in bits.  As can be seen in (a) the distribution as a whole makes a curved sheet, with the highest PIR values found at intermediate entropy and redundancy.  Although
	not visible in this plot, it is largely hollow in the middle. 
	 As can be seen in (b), the same plot with the PIR dimension projected out forms a right angled triangle, this is the triangle which corresponds to the interface of the Melody Triangle.   
	%The concentrations of points along the redundancy axis correspond
	%to Markov chains which are roughly periodic. 
	% with periods of 2 (redundancy 1 bit),
	%3, 4, \etc all the way to period 7 (redundancy 2.8 bits). The dotted line outlines the Wundt-like curve in the plot of PIR values,  
	}

 \end{fig}
  
  
% \begin{fig}{mtriscat}
%	\colfig[1]{meltriplot_diag3_cropped}
%	\colfig[0.66]{meltriplot_top3_cropped}
%	\caption{The population of 12-state transition matrices in the 3D space of 
%	entropy rate ($h_\mu$), redundancy ($\rho_\mu$) and predictive information rate ($b_\mu$), 
%	all in bits.  Note that the distribution as a whole makes a curved triangle. Although
%	not visible in this plot, it is largely hollow in the middle. 
%	The concentrations of points along the redundancy axis correspond
%	to Markov chains which are roughly periodic with periods of 2 (redundancy 1 bit),
%	3, 4, \etc all the way to period 7 (redundancy 2.8 bits). The dotted line outlines the Wundt-like curve in the plot of PIR values, note that the highest PIR values are found at intermediate entropy
%	and redundancy.  \label{InfoDynEngine}}
%\end{fig}



A similar shape is visible in the upper envelope of the plot in \Figrf{mtriscat}a, which is a 3-D scatter plot of the information measures for hundreds of first-order, eight state Markov chain transition matrices.%generated by a random sampling method.
The coordinates of the `information space' are entropy rate ($h_\mu$), redundancy ($\rho_\mu$), and
predictive information rate ($b_\mu$). The matrices are generated by % a random sampling method. 
a hierarchical Dirichlet sampling method\cite{Teh2006} to increase the probability of generating very sparse transition matrices, and get a good spread that reaches the edges and corners of the space.  The points along the `redundancy' axis correspond
to periodic Markov chains. Those along the `entropy' axis produce uncorrelated sequences
with no temporal structure. Processes with high PIR are to be found at intermediate
levels of entropy and redundancy.
 

These observations led us to construct the `Melody Triangle'.







\section{The Melody Triangle}\label{makingthetriangle}

The Melody Triangle is an interface that is designed around this natural distribution of Markov chain transition
matrices in the information space of  entropy rate ($h_\mu$), redundancy ($\rho_\mu$) and predictive information rate ($b_\mu$), as illustrated in \Figrf{mtriscat}a.

The distribution of transition matrices in this space forms a relatively thin
curved sheet.  Thus, it is a reasonable simplification to project out the 
third dimension (the PIR) and present an interface that is just two dimensional, resulting in a right-angled triangle, as can be seen in \Figrf{mtriscat}b.

The right-angled triangle is rotated and stretched to form an equilateral triangle with
the `redundancy'/`entropy rate' vertex at the top, the `redundancy' axis down the left-hand
side, and the `entropy rate' axis down the right, as shown in \Figrf{TheTriangle}.
This is our `Melody Triangle' and
forms the interface by which the system is controlled. 



\subsection{Usage}
The user selects a point within the triangle, this is mapped into the 
information space and the nearest transition matrix is used to generate
a sequence of values which are then sonified either as pitched notes or percussive
sounds. 
	
Though the interface is 2D, the third dimension (predictive information rate) is implicitly present, as 
transition matrices retrieved from
along the centre line of the triangle will tend to have higher PIR.
\begin{fig}{TheTriangle}
	\colfig[0.75]{TheTriangle.pdf}
	\caption{The Melody Triangle}
\end{fig}
As shown in \Figrf{TheTriangle}, the corners correspond to three different extremes of predictability and
unpredictability, which could be loosely characterised as `periodicity', `noise'
and `repetition'.  Melodies from the `noise' corner (high $h_\mu$, low $\rho_\mu$
and low $b_\mu$) have no discernible pattern;
those along the `periodicity'
to `repetition' edge are all cyclic patterns that get shorter as we approach
the `repetition' corner, until each is just one repeating note. Those along the 
opposite edge consist of independent random notes from non-uniform distributions. 
Areas between the left and right edges will tend to have higher predictive information rate ($b_\mu$), 
and we hypothesise that, under
the appropriate conditions, these will be perceived as more `interesting' or `melodic.'
These melodies have some level of unpredictability, but are not completely random.
Or, conversely, are predictable, but not entirely so.

 Given coordinates corresponding to a point in the triangle, we select from a pre-built
library of random processes, choosing one whose entropy rate and redundancy match the desired
values.  The implementations discussed in this paper use first order Markov chains as the content generator,
since it is easy to compute the theoretically exact values of entropy rate, redundancy and predictive
information rate given the transition matrix of the Markov chain. However, in principle, any generative system could be used to create the library of sequences, given an appropriate probabilistic listener model supporting
the estimation of entropy rate and redundancy.

\sloppy The Markov chain based implementation generates streams of symbols in the abstract; the alphabet of symbols is then mapped to a set of distinct sounds, such as pitched notes in a scale or a set of percussive sounds. By layering these streams, intricate musical textures can be created.
  %The Melody Triangle does not take into account the statistical experience of our exposure to tonal music.  Even if a particular stream of symbols is periodic and predictable, in mapping to the chromatic scale there is a chance that the melody may conflict with culturally defined expectations.  A mapping to the diatonic scale however is less likely to lead to such conflicts, and mappings to the pentatonic scale even less so.  
%The symbols can also be mapped to a set of percussive sounds, 
The number of states in the generated Markov chains corresponds to the number of audio samples used, however the output of the Melody Triangle could even be mapped to non sonic outputs such as visible shapes, colours, or movements.     %Further by layering these streams, intricate musical textures can be created.

\fussy The information measures that define the Melody Triangle assume a constant rate of symbols, and thus the output sequences proceed at a constant, uniform rate.  Although the placing of events in time and rhythm has a strong effect on expectations, surprise and satisfaction in music, the system does not, as yet, address this temporal dimension.   Additionally the system does not address the culturally defined expectations of melodic structure that result from our exposure to tonal music; all symbols are considered equal, regardless of what note in a scale they are mapped to. 

 %nto the expectations thataccount statistical experience of our exposure to tonal music and of consonance or melodic structure.     

\section{The Mobile App}
\label{theapp}
The Melody Triangle has been implemented as an interactive multi-user installation, as a desktop composition tool, and most recently as a mobile app for the Android platform.  It was launched on 28th March 2013, and is free to download from the Google Play app store.\footnote{The download link and some sample audio can be found at \href{http://melodytriangle.eecs.qmul.ac.uk/}{http://melodytriangle.eecs.qmul.ac.uk/}}  A description of the interactive installation and the desktop versions of the Melody Triangle, as well as some user trials can be read in \cite{ekeusmt1}.   

\begin{fig}{screenshot.png}
	\colfig[1]{screenshot.png}
	\caption{Screenshot of the Melody Triangle mobile app for Android.  The letters on the tokens correspond to the instrument they are currently assigned to. P=piano, B=bass, D=drums. }
\end{fig}
To support the crowdsourcing of data, the app needs to provide enough musical variety to engage users. A simple implementation (with for instance, one single concurrent melody, at one single rate and timbre), would make data analysis easier and more straight forward, however the limit musical appeal would make it difficult to collect data from the public.  In the next sections we outline the features of the app, describe how the data is collected, and how it will be analysed.

\subsection{Features}
As seen in \Figrf{screenshot.png}, the app provides three tokens that can be dragged in to the triangle using the touch screen.  It is with these tokens that the user selects the points in the triangle that will generate sequences, and thus three sequences can be played simultaneously.  Each token can be assigned to one of three instruments: piano, bass, drums.  The user can change what instrument is assigned to each token by pressing on the token's holder position on the top left.  In addition to changing the instrument, the user can also change the register of the instrument; the piano has three octaves, the bass has two.  Additionally the user can select the number of notes per beat, as well as specifying whether this token's notes should be delayed to come on the off-beat, allowing for syncopation between the sequences generated by the tokens.     
  
 There are also some global controls; the master beats-per-minute can be changed with the `+/-' buttons on the left, and there is an additional settings menu were the user can choose between the diatonic scale, harmonic scale or the pentatonic scale.  

The mobile app is pre-populated with two sets of over 8000 matrixes that densely cover the triangular interface.  For the diatonic and harmonic scale (and for the drums samples) the transition matrixes contain 8 states, and for the pentatonic scale 6 states.  Whenever a transition matrix is selected by placing a token in the triangle, the symbol-to-note mapping is shuffled.  This allows the same transition matrix to correspond to multiple melodies.  One state for each of the matrixes is mapped to a rest, allowing for some rhythmic variety and to increase the musicality of the output.  When a user taps one of the tokens in the triangle it re-shuffles the symbol-to-note mapping while keeping the same transition matrix. 

The current transition matrices, settings of each token and the global settings constitute the `state' of the system.  A user can save their favourites states locally as presets or share them with the world by pressing the `like' button.
 
\subsection{Collecting Data - `Likes' and the Melody Triangle `Radio'}
Onscreen notifications encourage users of the app to press the `like' button (the heart icon on the right of the screen) whenever they enjoy what they are hearing.  When they do so, the current state of the system is stored and assigned a unique 6 character hash code, referred to as a `song id'.  The users are given the option to enter a username, or may choose to remain anonymous. This state is encoded into a small file and uploaded to our servers at Queen Mary, University of London.  Geographical information is also stored.  

%Uploaded states become available to other users of the app. 
It is possible for users of the app to share settings with each other. 
By pressing the cloud icon on the right of the screen, the user can type in any song id.  When they do so the app downloads the state file from the server and loads the state on to the user's phone.  
Additionally the app can go into `radio mode', where the users can quickly and easily audition other users' uploaded states.  Upon entering radio mode, the app downloads a randomly selected uploaded state.  An additional button appears on the interface, a `skip' button, which whenever it is pressed the app downloads another randomly selected state.  Again the users are encouraged (via on screen notifications) to whenever they enjoy one of the downloaded states, to press the `like' button.  This allows us over time to build a kind of crowdsourced ranking of the uploaded states, as more popular states get more likes.   Users can modify downloaded states and then `like' those, hence states can evolve from other states, and so any uploaded state keeps a history of previous states so that we may track their evolution.   

 To further encourage uploads and participations, there is a `Hall of Fame' (see \Figrf{halloffame.png}) available at the project website.  It shows a list of the users who have contributed the most by uploading many states, as well as chart of most popular songs when `liked' in radio mode.
 
\begin{fig}{halloffame.png}
	\colfig[1]{halloffame.png}
	\caption{The Melody Triangle `Hall of Fame' as of 9th of June 2013.  The top list shows the most prolific users who have shared the most settings by pressing the `like' button.  The lower list shows the top ranked songs based on the number of `likes' a state has received by other users while in `Radio Mode'. The hall of fame can be found at \href{http://melodytriangle.eecs.qmul.ac.uk/}{http://melodytriangle.eecs.qmul.ac.uk/}}
\end{fig}
 
 In previous work \cite{ekeusmt1} we attempted to carry out a lab study to find links between the information theoretic measures of the Melody Triangle and aesthetic preferences, however it quickly became clear that lab conditions were not practical to get significant amounts of data.  The Melody Triangle mobile phone app provides an alternative means of collecting data, while engaging crowds with a unique citizen science project.  


\subsection{Interpreting Crowdsourced Data}
  
By collecting many liked settings from users all over the world, it may be possible to identify trends and commonalities across these settings.  A submitted setting contains all the information relating to the current state of the app, this forms a feature vector that includes the information measures of the currently playing Markov chains, the current note-to-symbol mappings, instrument/register choices, scale, notes per beat for every token and master BPM.  Given a submitted state we can extract a number of additional features that are not explicitly stored in the data representing the state of the system, but that are implicitly available by observing the output.  This includes the frequencies of notes and melodic intervals for each melody, and by looking across concurrent melodies, inter-melody intervals allowing us to extract harmonic information.  
  
 We can look for clusters in the feature space to answer a variety of questions.  For instance we can identify what the most common intervals are, both within a melody, and across concurrent melodies, and whether these correspond to the more consonant intervals.   We can look for the average information values of the Markov chains, and see how these vary based on the number of concurrent tokens, the rate at which notes are output, or register for instance.  We can see if the states that receive the greatest like-to-download ratio in `Radio mode' have similar information properties to each other.
  
We are in the active state of research\footnote{As of June 9th 2013, there have been 173 submitted settings.  The collected data is being made available to researchers at the project website: \href{http://melodytriangle.eecs.qmul.ac.uk/data}{http://melodytriangle.eecs.qmul.ac.uk/data}.}and a full analysis is yet to be carried out.  However it is already clear from data collected so far that the more `predictable' half of the triangle (the half with lower entropy rate and higher redundancy) is preferred to the `unpredictable' half of the triangle.  Additionally it has been observed that the visual layout of the interface has an influence on the parameter choices; a number of states contain tokens lined up in rows or columns.  Approximately 20\% of states submitted so far contain only the drum sounds, and these may lend themselves to a more straight-forward information theoretic analysis as these are not subject to cultural melodic expectations.  

 Clusterings in the state-space of the data may provide us with the means to link the information dynamic models and its measures to aesthetic preferences.  Additionally if we get enough entries, the geographical information may allow us to determine if there are any cultural differences between users based on countries or continents. 
 
  

\section{Conclusion}
We presented the Melody Triangle; an interface for the discovery of melodic content where the input --- positions within a triangle --- corresponds to the predictability of the output melodies. The Melody Triangle is contextualised in \emph{information dynamics}; an information theoretic approach to modelling human expectation and surprise.
We outlined the relevant ideas behind information dynamics and described three key information theoretic measures; entropy rate, redundancy and a measure of \emph{predictive information rate}, which describes the gain in information made by current observations about the future, but which are not already known from past observations. We described how the natural distribution of randomly generated Markov chains in terms of these measures lead us to design the Melody Triangle. 

We described the Melody Triangle mobile app, a free app for Android, and outlined how it collects data for research by uploading the `liked' settings of users to our servers.  We describe the app's `radio mode' that enables users to quickly audition other uploaded states provide feedback to form a crowd-sourced rankings table of most popular settings.  Finally we outline how the collected data will be used to look for trends and commonalities in the uploaded settings, and to help identify any relationship between the information-dynamic model of human expectation and aesthetic preference.

\begin{acknowledgments}
This work is supported by an EPSRC Doctoral Training Centre EP/G03723X/1 (HE), GR/S82213/01 and \\EP/E045235/1(SA), an EPSRC Leadership Fellowship, \\EP/G007144/1 (MDP) and EPSRC IDyOM2 EP/H013059/1. The Melody Triangle mobile app was developed with QApps and supported by impactQM, funded by the EPSRC.
\end{acknowledgments} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%bibliography here
\bibliography{all,c4dm,all3}

\end{document}
