Distance From Home
Translating four decades of global refugee movement to song

This song was generated using refugee data from the United Nations from 1975 to 2012. The quantity, length, and pitch of the song's instruments are controlled by the volume of refugee movement and distance traveled between their countries of origin and asylum.

The Song

Listen to the song by using the player above, or check out the song on Soundcloud if you prefer no visuals or would like to comment on a specific part of the song. Read further down to learn more about how the song was constructed.


The song composition is entirely algorithmic and is composed of the following building blocks:

  • Each year between 1975 and 2012 correlates to a 4-second segment in the song.
  • The annual global aggregate volume of refugee migration controls the quantity of instruments playing. The higher the volume of refugee migration, the more instruments are added to the song.
  • The annual average distance of refugee migration controls the duration and pitch of the instruments. Longer distances yield instruments that play longer and lower-pitch notes (e.g. long distances: , short distances: ).
  • The annual amount of countries with 1000+ refugees control the variety of instruments playing, where the more countries with 1000+ refugees, the more variety of instruments are playing in the song.

I decided to limit the song to these components and not add additional context (i.e. the reasons for displacement) since I believed trying to include such context would add too much complexity to the resulting song and visualization. Instead, the intended result is for the listener to intuitively and viscerally experience the sheer volume of displaced populations and the distance they travel from their home country. I provide more detail in the next section if you are looking for contextual information.

Data Used & Prior Work

This piece was largely inspired by The Refugee Project, an impressive interactive web project and map of refugee migrations since 1975. If you would like to explore more of the context behind some of the numbers for each year, I suggest you head over to The Refugee Project website and click through their interactive temporal map.

This song shares the same data sources as The Refugee Project: United Nations High Commissioner for Refugees (UNHCR) Refugee Data and UN Population Data spanning from 1975 to 2012. UNHCR seeks to contribute to informed decision-making and public debate by providing accurate, relevant and up-to-date refugee statistics. They state that their populations of concern are: "refugees, asylum-seekers, returned refugees, internally displaced persons (IDPs) protected/assisted by UNHCR, returned IDPs, stateless persons, and others of concern to UNHCR, in more than 180 countries."

The data that the UNHCR provides is essentially a large spreadsheet containing the following columns: country of asylum, country of origin, year, number of refugees and people in refugee-like situations. With this data, I calculate:

  • The annual volume of refugee migration per origin-asylum country pair
  • The annual global aggregate volume of refugee migration
  • The annual average distance of refugee migration (in combination with country geographical coordinates from Google Public Data)
  • The annual amount of countries with 1000+ refugees

These calculations and resulting values were the basis of the song and visualization.

Style & Sounds Used

The song's style and sounds were primarily inspired by the Radiolab podcast Songs that Cross Borders, where Aaron Fox, an anthropologist of music at Columbia University, explains the phenomenon of American country music's popularity in places like Zimbabwe, Thailand, and South Africa. Fox suggests American country music appeals to disparate global populations due to the genre's lyrical content often associated with migration, longing, loneliness, and nostalgia for home (excerpt .) He also describes country's signature instrument, the steel guitar, as iconic of the crying human voice, also known as "crying steel" (excerpt .) I thought this instrument and genre would fit well with the subject of refugee movement, where large populations of people are displaced from their home country. The sources of all samples are listed below:

Tools & Process

This song was algorithmically generated in that I wrote a computer program that took data and music samples as input and generated the song as output. I did not manually compose any part of this song.

For those interested in replicating, adapting, or extending my process, all of the code and sound files is open source and can be found here. It also contains a comprehensive README to guide you through the setup and configuration. The following is a brief outline of my process:

  1. Based on the project's objective, I decided upon a stylistic and compositional approach.
  2. I identified and downloaded the relevant data from the UN and Google Public Data.
  3. I extracted individual instrument samples from relevant sources.
  4. Using Python, a widely used programming language, I:
    1. Calculated the annual volume of refugee migration per origin-asylum country pair
    2. Calculated the annual global aggregate volume of refugee migration
    3. Calculated the annual average distance of refugee migration
    4. Calculated the annual amount of countries with 1000+ refugees
    5. Assigned instruments to each year based on the the calculations from the first 4 steps.
    6. Generated a sequence of sounds based on the instrument assignments of the previous step.
  5. The sequence of sounds from the previous step was fed into ChucK, a programming language for real-time sound synthesis and music creation. I used ChucK because it is really good at generating strongly-timed sequences. The output would then be an audio file that I could listen to.
  6. I then repeated the previous steps numerous times, tweaking the sounds and the algorithms until I was satisfied with the result
  7. I used Processing to generate the visualization using the data above.

If you happen to use my code and create something new, please shoot me an email at hello@brianfoo.com. I'd love to see and share your work!

Questions & Feedback

I'd love to hear from you. I'm sure I've also made some erroneous statements somewhere, so please correct me. You can use the widget below or email me at hello@brianfoo.com.

Data-Driven DJ is a series of music experiments that combine data, algorithms, and borrowed sounds.

My goal is to explore new experiences around data consumption beyond the written and visual forms by taking advantage of music's temporal nature and capacity to alter one's mood. Topics will range from social and cultural to health and environmental.

Each song will be made out in the open: the creative process will be documented and published online, and all custom software written will be open-source. Stealing, extending, and remixing are inevitable, welcome, and encouraged. Check out the FAQs for more information.

Follow Along

The approximate pulse of this project will be one song per month with a target of at least 10 songs by mid 2016. You can follow along via Twitter, Facebook, Soundcloud, Vimeo, or my mailing list.

My name is Brian Foo and I am a programmer and visual artist living and working in New York City. Learn more about what I do on my personal website.