<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>MedleyAssistant - A system for personalized music medley creation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Zhengshan Shi</string-name>
          <email>kittyshi@ccrma.stanford.edu</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gautham J. Mysore</string-name>
          <email>gmysore@adobe.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Adobe Research</institution>
          ,
          <addr-line>San Francisco</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>CCRMA, Stanford University</institution>
          ,
          <addr-line>Stanford</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present MedleyAssistant, a system to assist in the creation of music medleys from segments of existing music. Our goal is to make medley creation more accessible to novices, while still allowing them to express their own creative style. Our system addresses two key challenges in medley creation - determining which segments of music sound natural when transitioning to which other segments of music, and determining specific transition points between two given segments of music. This constrains the problem so that medleys created with our system tend to sound natural while allowing the user to be creative with music selection. We also provide a music visualization that helps users understand the musical principles of medley creation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Author Keywords
music medley; creative MIR; personalized music creation.
INTRODUCTION AND MOTIVATION
A music medley is a piece of music that is composed or
arranged from a series of songs or musical segments. In a high
quality medley, each segment tends to naturally flow into the
next segment, and the transitions typically sound seamless.
Medleys provide a way to create new variations of music
starting from existing music. They can be used for music
playback by itself or as backing tracks for media such as videos
and video games. They provide a way to customize a piece
of music so that different sections of the media correspond to
different segments of music.</p>
      <p>Manual creation of high quality medleys can be a challenging
task and typically requires a background in music and audio
editing. They are often created by musicians and DJs. The
typical sequence of steps to create a medley is as follows:
1. Select a number of candidate musical segments from various
pieces of music.
2. Determine a musically natural sequence of segments for the
proposed medley from the above candidate set of segments.
©2018. Copyright for the individual papers remains with the authors.
Copying permitted for private and academic purposes.</p>
      <p>MILC ’18, March 11, 2018, Tokyo, Japan</p>
      <p>
        RELATED WORK
Recent advances in Music Information Retrieval (MIR)
techniques have given rise to intelligent musical interfaces [
        <xref ref-type="bibr" rid="ref3 ref9">3, 9</xref>
        ],
making certain aspects of music creation more accessible to
non-experts. This includes applications such as an automatic
DJ [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], a song mixing tool [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], an automatic mashup system
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], and a loop creation system [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. All of these applications
help reuse parts of existing music to create new music.
To the best of our knowledge, the work that is most closely
related to our proposed medley creation system is Music Cut
and Paste [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ], a personalized music-cut-and-paste system,
which is also used to create medleys. The key difference is
that this system only allows users to specify the sequence of
segments in terms of vocal and instrumental sections, whereas
our system provides the user with significantly more flexibility
in terms of choosing and adjusting segments.
      </p>
      <p>SYSTEM OVERVIEW
In this section, we describe the workflow and interface of
MedleyAssistant. A user creates a medley using our system as
follows:
1. The user provides a number of candidate songs based on
their preference in music.
2. Our system provides a visualization of these songs as shown
in Figure 1. Specifically, it visualizes the chord structure
and tempo. This visualization could help guide the user in
the subsequent steps.
3. The user chooses the first segment of the medley based
on the music that they would like to be the introduction.
This forms the foundation of the medley because it in turn
dictates subsequent segments. The user can choose this first
segment based on listening as well as using the visualization
as a guide. The beginning and end of the selection snaps to
the nearest beat.
4. Based on the first segment, the system assists in choosing
the second segment. It estimates multiple potential
candidates for the second segment (over all songs) and highlights
them, as shown in Figure 2. The opacity of each gray box
indicates a confidence level of how good the segment will
sound. The system attempts to choose candidate segments
that will musically flow well from the first segment based on
chord structure, tempo, and timbre. The chosen segments
will be 16 beats or less. We use a relatively small size so
that the user can adjust the length to whatever they desire
in the next step. The user can choose to use one of these
segments, and the system will then perform the low level
edits to concatenate the two segments. However, the user
can alternatively choose any part of any song (even if it is
not highlighted) and use that as the second segment.
5. After choosing a segment, the user can drag the segment
ending boundary to adjust the length of the segment.
6. The user chooses the next segment as outlined in the
previous two steps and continues this process until the medley is
complete.</p>
      <p>The interface in our system is realized as a web application
using wavesurfer1, an API built on top of Web Audio API2
and HTML5 Canvas.</p>
      <p>Visualization
As shown in Figure 1, our system visualizes both the chord
structure as well as the tempo for each song. This visualization
provides a tool for users to better understand the segments
highlighted by the system, helps users choose new segments
that are not highlighted, and can serve as an educational tool
to better understand the music theoretical principals of medley
creation.</p>
      <p>
        We visualize the chord structure of each song by overlaying
the waveform on colored blocks where each color corresponds
to a different chord. We use only Major and Minor chords,
1https://wavesurfer-js.org/
2https://www.w3.org/TR/webaudio/
so we have a total of 24 chords. The color scheme we used
in visualizing each chord is inspired by Alexander Scriabin’s
“Clavier à lumières" (“keyboard with lights") [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], a keyboard
instrument with colors assigned to different keys. For example,
we use intense red for C and orange for G. We utilize this
color scheme because similar color produces a desirable chord
progression, such as the proximity in RGB color value of the
chord C and G. The color mapping of the chords are shown in
a chord visualization colormap in Figure 1.
      </p>
      <p>We visualize tempo below the waveform, with a bar
representing rhythmic density of the music as a function of time. For
the rhythmic feature, we first extract the dynamic tempos of
the song, and then group the dynamic tempos into different
sections. We use color interpolation to indicate the tempo
density (i.e: deeper color for a faster tempo).</p>
      <p>Our system demonstrates the visualization of two features
(chord structure and tempo), but this can be extended to various
other features. We think that different kinds of musical features
could be used to assist in different forms of medley creation
styles.</p>
      <p>ALGORITHMS
In this section, we describe the algorithms that we use for
visualization and automatic segment selection (as described in
steps 2 and 4 of the workflow in the previous section).
We start with a pre-processing step in which we extract
features at each beat of each song. These features are used both
in the visualization and computation of the cost function
described below.</p>
      <p>Given a specific segment of the medley, which we refer to as
the query segment, the goal of our algorithm is to estimate
potential candidates for the next segment. We select the next
candidate segment based on specific criteria as follows:
1. Acoustically smooth and seamless transitions between
consecutive segments. We compute this smoothness based on
a cost function between the query segment and every other
segment in every song based on a sliding window.
2. Consecutive segments should conform to a harmonic
progression specified by music theory rules. Based on the
acoustically smooth candidates (as determined by the
previous step), we select a subset of candidate segments based
on a harmonic progression factor.</p>
      <p>
        Feature Extraction
We first estimate beat locations in each song by applying
beat tracking on the onset envelope of the audio signal. At
every beat of every song, we compute timbral features
(Melfrequency cepstrum coefficients), signal energy level (root
mean square), and harmonic features (chroma vectors). We
also compute tempo over a window around each beat. We
compute these features using librosa [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Additionally, we
estimate the chords in each song using the chordino plugin
based on NNLS Chroma [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. We compute this in the VamPy
+ b
+ g
+ d
      </p>
      <p>Dt (S1; S2)
st
sm
sr
Acoustic Smoothness
Given the query segment, S1 of length N, and the potential
candidate segment S2 of length M = 16, our goal is to compute
the optimal transition point from S1 to S2. We do this by
computing a cost function between four-beat windows sliding
over both S1 and S2. We define the optimal transition point
by the location of the sliding windows with the lowest cost,
which we refer to as the highest acoustic smoothness.
We consider four beat sliding windows starting from beat 14 N
to beat N 3 of S1, and beat 1 to beat 34 M of S2. We do not
consider the beginning of S1 and the ending of S2 in order to
ensure that the resulting combination of S1 and S2 retain at
least a part of each segment.</p>
      <p>Our cost function over a four-beat sliding window of S1 to S2
is:</p>
      <p>3
C(S1i; S2 j) = a å Dc(CS1 [i + k];CS2 [ j + k])
k=0</p>
      <p>3
åk=0 Dm(MS1 [i + k]; MS2 [ j + k])
Dr(RS1 [i 4 : i 1]; RS2 [ j : j + 3])
(1)
Host. These estimated chords are used in the visualization
under the waveform.</p>
      <p>Where Dc denotes the cosine distance of the chroma features,
Dm denotes the Euclidean distance of the timbre features, Dr
denotes the difference of root mean square energy, and Dt
denotes the tempo difference. a, b , g, and d are tuning factors,
whereas sm, sr, and st represents the standard deviations.
Figure 3 illustrates the computation of the cost function.
We compute our tuning factors apriori as follows. The goal is
to define the tuning factors that help indicate acoustic
smoothness. By definition, the transitions between consecutive
segments of a given song are maximally smooth. Therefore we
compute the cost function between all consecutive segments of
a number of songs using a number of different combinations
of tuning factors (each tuning factor can vary from 0 to 1:0).
We choose the combination of tuning factors that on average
yields the lowest cost.</p>
      <p>When we compute the cost function for segments S1 and S2,
we choose the optimal transition point between S1 and S2
based on the i and j that yield the lowest cost. Given the
optimal i and j, the optimal transition between the segments
is to go from beat i 1 of S1 to beat j of S2.</p>
      <p>The query segment S1 has a cost with respect to each segment
S2 (associated with the optimal transition point) of each song.
We choose all of the segments S2 that have a cost under a
threshold as candidate segments for the next step.</p>
      <p>Harmonic Progression Factor
After obtaining a set of candidate segments with acoustically
smooth transition points from S1, we determine which of these
candidates yield a music theoretically valid harmonic
progression when transitioning from S1.</p>
      <p>Given candidate beat b1 in S1 that connects to beat b2 in S2, we
analyze the four-beat harmonic progression from S1[b1 1 :
b1] to S2[b2 : b2 + 1], namely the last two beats of the transition
point in S1 and the first two beats in transition point in S2,
as well as the two-beat harmonic progression from S1[b1] to
S2[b2]. We assign a score Qb1;b2 as:
(2)
+ Ppop(S1[b1</p>
      <p>
        1 : b1]; S2[b2 : b2 + 1])
Where P5th is the chord transition probability from the last
beat of the transition point in S1 to the first beat of the transition
point in S2 based on a circle of fifth, and Ppop is the four-beat
harmonic transition probability from the last two beats of the
transition point in S1 to the first two beats of the transition
point in S2, trained from the SALAMI dataset [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
We choose all segments with a score Qb1;b2 above a threshold
as candidate segments that are displayed as gray boxes in the
interface, as shown in Figure 2. The confidence value of a
given segment is based on the score Qb1;b2 of that segment and
mapped to an opacity value of the corresponding gray box in
the interface.
      </p>
      <p>CONCLUSION
We present medleyAssistant, an interactive music medley
creation system that enables users to create personalized music
medleys. Our informal pilot study showed that our interface
makes medley creation significantly easier for novices. We
believe that it could be a useful tool for experts as well as it
could help them create medleys more quickly.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Matthew</surname>
            <given-names>EP Davies</given-names>
          </string-name>
          , Philippe Hamel, Kazuyoshi Yoshii, and
          <string-name>
            <given-names>Masataka</given-names>
            <surname>Goto</surname>
          </string-name>
          .
          <year>2014</year>
          .
          <article-title>AutoMashUpper: Automatic creation of multi-song music mashups</article-title>
          .
          <source>IEEE/ACM Transactions on Audio, Speech, and Language Processing</source>
          <volume>22</volume>
          ,
          <issue>12</issue>
          (
          <year>2014</year>
          ),
          <fpage>1726</fpage>
          -
          <lpage>1737</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Tatsunori</given-names>
            <surname>Hirai</surname>
          </string-name>
          , Hironori Doi, and
          <string-name>
            <given-names>Shigeo</given-names>
            <surname>Morishima</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>MusicMixer: Computer-aided DJ system based on an automatic song mixing</article-title>
          .
          <source>In Proceedings of the 12th International Conference on Advances in Computer Entertainment Technology. ACM</source>
          ,
          <volume>41</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Eric</surname>
          </string-name>
          J Humphrey, Douglas Turnbull, and Tom Collins.
          <year>2013</year>
          .
          <article-title>A brief review of creative MIR</article-title>
          .
          <source>In Proceedings of the International Conference on Music Information Retrieval</source>
          , Late Breaking Demo.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Hiromi</given-names>
            <surname>Ishizaki</surname>
          </string-name>
          , Keiichiro Hoashi, and
          <string-name>
            <given-names>Yasuhiro</given-names>
            <surname>Takishima</surname>
          </string-name>
          .
          <year>2009</year>
          .
          <article-title>Full-Automatic DJ mixing system with optimal tempo adjustment based on measurement function of user discomfort</article-title>
          .
          <source>In ISMIR</source>
          .
          <volume>135</volume>
          -
          <fpage>140</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Yin-Tzu Lin</surname>
          </string-name>
          ,
          <string-name>
            <surname>I-Ting</surname>
            <given-names>Liu</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jyh-Shing Roger Jang</surname>
          </string-name>
          , and
          <string-name>
            <surname>Ja-Ling Wu</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Audio musical dice game: A user-preference-aware medley generating system</article-title>
          .
          <source>TOMCCAP</source>
          <volume>11</volume>
          (
          <year>2015</year>
          ),
          <volume>52</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>52</lpage>
          :
          <fpage>24</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>I-Ting</surname>
            <given-names>Liu</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yin-Tzu Lin</surname>
          </string-name>
          , and
          <string-name>
            <surname>Ja-Ling Wu</surname>
          </string-name>
          .
          <year>2013</year>
          .
          <article-title>Music Cut and Paste: A personalized musical medley generating system</article-title>
          .
          <source>In ISMIR</source>
          .
          <volume>463</volume>
          -
          <fpage>468</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Matthias</given-names>
            <surname>Mauch</surname>
          </string-name>
          and
          <string-name>
            <given-names>Simon</given-names>
            <surname>Dixon</surname>
          </string-name>
          .
          <year>2010</year>
          .
          <article-title>Approximate Note Transcription for the Improved Identification of Difficult Chords</article-title>
          . In ISMIR.
          <volume>135</volume>
          -
          <fpage>140</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Brian</surname>
            <given-names>McFee</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Colin</given-names>
            <surname>Raffel</surname>
          </string-name>
          , Dawen Liang, Daniel PW Ellis,
          <string-name>
            <surname>Matt</surname>
            <given-names>McVicar</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Eric</given-names>
            <surname>Battenberg</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Oriol</given-names>
            <surname>Nieto</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>librosa: Audio and music signal analysis in python</article-title>
          .
          <source>In Proceedings of the 14th Python in Science Conference</source>
          .
          <volume>18</volume>
          -
          <fpage>25</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Markus</given-names>
            <surname>Schedl</surname>
          </string-name>
          , Emilia Gómez, Julián Urbano, and others.
          <source>2014</source>
          .
          <article-title>Music information retrieval: Recent developments and applications</article-title>
          .
          <source>Foundations and Trends® in Information Retrieval 8</source>
          ,
          <fpage>2</fpage>
          -
          <lpage>3</lpage>
          (
          <year>2014</year>
          ),
          <fpage>127</fpage>
          -
          <lpage>261</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Aleksandr</given-names>
            <surname>Scriabin</surname>
          </string-name>
          and
          <string-name>
            <given-names>Leonid</given-names>
            <surname>Sabaneev</surname>
          </string-name>
          .
          <year>1913</year>
          .
          <article-title>Prométhée, le poème du feu pour grand orchestre et piano avec orgue, choeurs et clavier à lumières</article-title>
          .
          <source>Op</source>
          .
          <volume>60</volume>
          .
          <article-title>Transcription pour 2 pianos à quatre mains par L. Sabaneiew</article-title>
          . (
          <year>1913</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>Zhengshan</given-names>
            <surname>Shi</surname>
          </string-name>
          and
          <string-name>
            <surname>Gautham J Mysore</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>LoopMaker: Automatic creation of music loops for pre-recorded music</article-title>
          .
          <source>In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. ACM.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Jordan Bennett Louis Smith</surname>
            , John Ashley Burgoyne, Ichiro Fujinaga, David De Roure, and
            <given-names>J Stephen</given-names>
          </string-name>
          <string-name>
            <surname>Downie</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Design and creation of a large-scale database of structural annotations.</article-title>
          .
          <source>In ISMIR</source>
          , Vol.
          <volume>11</volume>
          .
          <fpage>555</fpage>
          -
          <lpage>560</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>