DecibelsChallenge_SpaceLaunches

DecibelsChallenge_SpaceLaunches

Sonification of Regional Space Launch Frequencies

Space Launches and frequencies

For the Second Decibels Challenge, the dataset provided was from OurWorldInData

IllestPreacha · Space Launch Frequencies

Sonification Steps

  • While cleaning the data in Python, I decided to make 8 CSV Files

    • 1 for each of the 6 Continents

    • 1 for the Space Agencies

    • 1 for the total launches in the world

  • For the Sonification in Sonic Pi, I decided to track the frequency of all the countries and agencies that participated in a launch during a single year. With the earlier cleaning, this was done per region and in intervals of four years (simulating the Olympics), with each year in a cycle being represented by a different sound.

    • There are three distinct sounds in the 8 Sonifications

      • Originally the sounds included the bd dub sound

      • Then for the next set, that sound was replaced with a drone-type sound

      • For the world launches, the sounds are still in intervals but they are also pitched to represent the higher frequency of launches per year

SonicPi Code

Set 1 ( African, Asian & European Launches)

require 'csv'

#reading the csv fields
AfricanSpaceLaunch = CSV.parse(File.read("C:/Creatuve Code Challenges/Sonification Challenges/Febuary 2023/African_SpaceObject.csv"),headers: true)
#AsianSpaceLaunch = CSV.parse(File.read("C:/Creatuve Code Challenges/Sonification Challenges/Febuary 2023/Asian_SpaceObject.csv"),headers: true)
#making a counter
i = 0

live_loop :ASL do
  with_fx :flanger do
    with_fx :reverb do

      puts AfricanSpaceLaunch[i]['Year']
      #now going to give distinct sounds to the year based on a 4 year sound
      #giving decay effect to show how some years it lingers more

     #case is set to the interval of four years
      case AfricanSpaceLaunch[i]['Year'].to_f % 4
      when 0
        sample :bd_808, decay: AfricanSpaceLaunch[i]['yearly_launches'].to_f
      when 1
        sample :ambi_dark_woosh, decay: AfricanSpaceLaunch[i]['yearly_launches'].to_f
      when 2
        sample :drum_snare_hard, decay: AfricanSpaceLaunch[i]['yearly_launches'].to_f
      when 3
        sample :elec_bell, decay: AfricanSpaceLaunch[i]['yearly_launches'].to_f
      else
        sample :elec_ping, decay: AfricanSpaceLaunch[i]['yearly_launches'].to_f
      end
      #counter based on the amount of rows
      if i >= 27
        i = 0
      end
      i += 1
      sleep 0.5
    end
  end
end

Set 2 ( Oceanic, Agencies, North American & South American Launches)

require 'csv'

#reading the csv fields
OSL = CSV.parse(File.read("C:/Creatuve Code Challenges/Sonification Challenges/Febuary 2023/Oceanic_SpaceObject.csv"),headers: true)
#making a counter
i = 0

#after first three swapped out the bd_dub for a drone sound

live_loop :OSL do
  with_fx :flanger do
    with_fx :reverb do
      puts OSL[i]['Year']
      #now going to give distinct sounds to the year based on a 4 year sound
      #giving decay effect to show how some years it lingers more

    #case is set to the interval of four years
      case OSL[i]['Year'].to_f % 4
      when 0
        sample :ambi_drone, decay: OSL[i]['yearly_launches'].to_f
      when 1
        sample :ambi_dark_woosh, decay: OSL[i]['yearly_launches'].to_f
      when 2
        sample :drum_snare_hard, decay: OSL[i]['yearly_launches'].to_f
      when 3
        sample :elec_bell, decay: OSL[i]['yearly_launches'].to_f
      else
        sample :elec_ping, decay: OSL[i]['yearly_launches'].to_f
      end
         #counter based on the amount of rows
      if i >= 25
        i = 0
      end
      i += 1
      sleep 0.5
    end
  end
end

Set 3 ( World Launches)

require 'csv'

#reading the csv fields
W = CSV.parse(File.read("C:/Creatuve Code Challenges/Sonification Challenges/Febuary 2023/World_SpaceObject.csv"),headers: true)
#making a counter
i = 0

#for the world decided to do something a little different
#it still follows the dividing the data into intervals of 4 but uses notes to describe the intensity

live_loop :AOSL, amp: 6 do
  with_fx :flanger do
    with_fx :reverb do

      puts W[i]['Year']
#case is set to the interval of four years
      case W[i]['Year'].to_f % 4
      when 0
        use_synth :piano
        play W[i]['yearly_launches'].to_f / 10
      when 1
        use_synth :chipnoise
        play W[i]['yearly_launches'].to_f / 10
      when 2
        use_synth :chiplead
        play W[i]['yearly_launches'].to_f / 10
      when 3
        use_synth :pretty_bell
        play W[i]['yearly_launches'].to_f / 10
      else
        use_synth :piano
        play W[i]['yearly_launches'].to_f / 10
      end
      #counter based on the amount of rows
      if i >= 65
        i = 0
      end
      i += 1
      sleep 1
    end
  end
end

Python Data Cleaning Code

#reading the csv file

import pandas as pd
df = pd.read_csv("SpaceObjects.csv")
print(df)

Entity Code Year yearly_launches 0 Algeria DZA 2002 1 1 Algeria DZA 2010 1 2 Algeria DZA 2016 3 3 Algeria DZA 2017 1 4 Angola AGO 2017 1 ... ... ... ... ... 1114 World OWID_WRL 2018 453 1115 World OWID_WRL 2019 586 1116 World OWID_WRL 2020 1274 1117 World OWID_WRL 2021 1810 1118 World OWID_WRL 2022 2163

[1119 rows x 4 columns]

#getting information on the type of columns and the amount
df.info()

<class 'pandas.core.frame.DataFrame'> RangeIndex: 1119 entries, 0 to 1118 Data columns (total 4 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Entity 1119 non-null object 1 Code 981 non-null object 2 Year 1119 non-null int64 3 yearly_launches 1119 non-null int64 dtypes: int64(2), object(2) memory usage: 35.1+ KB

#getting information from the csv
df.describe()
Yearyearly_launches
count1119.0000001119.000000
mean2001.11528225.587131
std16.517192124.276918
min1957.0000001.000000
25%1991.0000001.000000
50%2005.0000002.000000
75%2015.0000006.000000
max2022.0000002163.000000
df.Entity.unique()

array(['Algeria', 'Angola', 'Arabsat', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bangladesh', 'Belarus', 'Belgium', 'Bhutan', 'Bolivia', 'Brazil', 'Bulgaria', 'Canada', 'Chile', 'China', 'Colombia', 'Costa Rica', 'Czechia', 'Denmark', 'EUMETSAT', 'Ecuador', 'Egypt', 'Estonia', 'Ethiopia', 'European Space Agency', 'European Union', 'Eutelsat', 'Finland', 'France', 'Germany', 'Ghana', 'Greece', 'Guatemala', 'Hungary', 'India', 'Indonesia', 'Inmarsat', 'Intelsat', 'Intersputnik', 'Iran', 'Israel', 'Italy', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya', 'Laos', 'Latvia', 'Lithuania', 'Luxembourg', 'Malaysia', 'Mauritius', 'Mexico', 'Moldova', 'Monaco', 'Mongolia', 'Morocco', 'NATO', 'Nepal', 'Netherlands', 'New Zealand', 'Nigeria', 'North Korea', 'Norway', 'Pakistan', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Poland', 'Portugal', 'Qatar', 'RASCOM', 'Romania', 'Russia', 'Rwanda', 'Saudi Arabia', 'Sea Launch', 'Singapore', 'Slovakia', 'Slovenia', 'South Africa', 'South Korea', 'Spain', 'Sri Lanka', 'Starsem', 'Sweden', 'Switzerland', 'Taiwan', 'Thailand', 'Tunisia', 'Turkey', 'Turkmenistan', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States', 'Uruguay', 'Venezuela', 'Vietnam', 'World'], dtype=object)

'''
African Countries

'Algeria', 'Angola', 'Ethiopia', 'Ghana', 'Egypt', 'Morocco', 'Mauritius', 'Nigeria', 'South Africa'.

European Countries:
'Austria', 'Belarus', 'Belgium', 'Bulgaria', 'Czechia', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', 
'Greece', 'Hungary', 'Italy', 'Lithuania', 'Luxembourg', 'Monaco', 'Netherlands', 'Norway', 'Poland', 
'Portugal', 'Romania', 'Russia', 'Slovakia', 'Slovenia', 'Spain', 'Sweden', 'Switzerland', 'Ukraine', 'United Kingdom'

North American Countries:
'Canada', 'Costa Rica', 'Mexico', 'United States'.

South American Countries:
'Argentina', 'Bolivia', 'Brazil', 'Chile', 'Colombia', 'Ecuador', 'Paraguay', 'Peru', 'Uruguay', 'Venezuela'.

Asian Countries:
'Arabsat', 'Bangladesh', 'Bhutan', 'China', 'India', 'Indonesia', 'Iran', 'Israel', 'Japan', 
'Jordan', 'Kazakhstan', 'Laos', 'Malaysia', 'North Korea', 'Pakistan', 'Philippines', 'Singapore', 
'South Korea', 'Taiwan', 'Thailand', 'Turkey', 'Turkmenistan', 'Vietnam'.

Oceanic Countries:
'Australia', 'New Zealand'.

The non-countries in the list are:
'Arabsat', 'EUMETSAT', 'European Space Agency', 'European Union', 'Eutelsat', 'Inmarsat', 
'Intelsat', 'Intersputnik', 'NATO', 'RASCOM', 'Sea Launch', 'Starsem', 'World'.

'''

"\nAfrican Countries\n\n'Algeria', 'Angola', 'Ethiopia', 'Ghana', 'Egypt', 'Morocco', 'Mauritius', 'Nigeria', 'South Africa'.\n\nEuropean Countries:\n'Austria', 'Belarus', 'Belgium', 'Bulgaria', 'Czechia', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', \n'Greece', 'Hungary', 'Italy', 'Lithuania', 'Luxembourg', 'Monaco', 'Netherlands', 'Norway', 'Poland', \n'Portugal', 'Romania', 'Russia', 'Slovakia', 'Slovenia', 'Spain', 'Sweden', 'Switzerland', 'Ukraine', 'United Kingdom'\n\nNorth American Countries:\n'Canada', 'Costa Rica', 'Mexico', 'United States'.\n\nSouth American Countries:\n'Argentina', 'Bolivia', 'Brazil', 'Chile', 'Colombia', 'Ecuador', 'Paraguay', 'Peru', 'Uruguay', 'Venezuela'.\n\nAsian Countries:\n'Arabsat', 'Bangladesh', 'Bhutan', 'China', 'India', 'Indonesia', 'Iran', 'Israel', 'Japan', \n'Jordan', 'Kazakhstan', 'Laos', 'Malaysia', 'North Korea', 'Pakistan', 'Philippines', 'Singapore', \n'South Korea', 'Taiwan', 'Thailand', 'Turkey', 'Turkmenistan', 'Vietnam'.\n\nOceanic Countries:\n'Australia', 'New Zealand'.\n\nThe non-countries in the list are:\n'Arabsat', 'EUMETSAT', 'European Space Agency', 'European Union', 'Eutelsat', 'Inmarsat', \n'Intelsat', 'Intersputnik', 'NATO', 'RASCOM', 'Sea Launch', 'Starsem', 'World'.\n\n"

#making new dataframes by breaking the it into Continents and Agencies

African = df[df["Entity"].isin(['Algeria', 'Angola', 'Ethiopia', 'Ghana', 'Egypt', 'Morocco', 'Mauritius', 'Nigeria', 'South Africa'])]

NorthAmerican = df[df["Entity"].isin(['Canada', 'Costa Rica', 'Mexico', 'United States'])]

SouthAmerican = df[df["Entity"].isin(['Argentina', 'Bolivia', 'Brazil', 'Chile', 'Colombia', 'Ecuador', 'Paraguay', 'Peru', 'Uruguay', 'Venezuela'])]

European = df[df["Entity"].isin(['Austria', 'Belarus', 'Belgium', 'Bulgaria', 'Czechia', 'Denmark', 'Estonia', 'Finland', 'France', 'Germany', 
'Greece', 'Hungary', 'Italy', 'Lithuania', 'Luxembourg', 'Monaco', 'Netherlands', 'Norway', 'Poland', 
'Portugal', 'Romania', 'Russia', 'Slovakia', 'Slovenia', 'Spain', 'Sweden', 'Switzerland', 'Ukraine', 'United Kingdom'])]

Asian = df[df["Entity"].isin(['Bangladesh', 'Bhutan', 'China', 'India', 'Indonesia', 'Iran', 'Israel', 'Japan', 
'Jordan', 'Kazakhstan', 'Laos', 'Malaysia', 'North Korea', 'Pakistan', 'Philippines', 'Singapore', 
'South Korea', 'Taiwan', 'Thailand', 'Turkey', 'Turkmenistan', 'Vietnam'])]

Oceanic = df[df["Entity"].isin(['Australia', 'New Zealand'])]

Agencies = df[df["Entity"].isin(['Arabsat', 'EUMETSAT', 'European Space Agency', 'European Union', 'Eutelsat', 'Inmarsat', 
'Intelsat', 'Intersputnik', 'NATO', 'RASCOM', 'Sea Launch', 'Starsem'])]

World = df[df["Entity"].isin(['World'])]
#sorted by year
African = African.sort_values(by=['Year'],ascending=True)
NorthAmerican = NorthAmerican.sort_values(by=['Year'],ascending=True)
SouthAmerican = SouthAmerican.sort_values(by=['Year'],ascending=True)
European = European.sort_values(by=['Year'],ascending=True)
Asian = Asian.sort_values(by=['Year'],ascending=True)
Oceanic = Oceanic.sort_values(by=['Year'],ascending=True)
Agencies = Agencies.sort_values(by=['Year'],ascending=True)
World = World.sort_values(by=['Year'],ascending=True)
African.head()
EntityCodeYearyearly_launches
218EgyptEGY19981
814South AfricaZAF19991
219EgyptEGY20001
663MoroccoMAR20011
0AlgeriaDZA20021
World.describe()
Yearyearly_launches
count66.00000066.000000
mean1989.500000216.378788
std19.196354357.906725
min1957.0000002.000000
25%1973.250000108.250000
50%1989.500000134.500000
75%2005.750000158.000000
max2022.0000002163.000000
African.describe()
Yearyearly_launches
count28.00000028.000000
mean2012.6071431.285714
std7.5637500.762896
min1998.0000001.000000
25%2008.5000001.000000
50%2015.0000001.000000
75%2018.0000001.000000
max2022.0000004.000000
NorthAmerican.describe()
Yearyearly_launches
count118.000000118.000000
mean1994.36440762.991525
std18.664682219.515103
min1958.0000001.000000
25%1978.2500002.000000
50%1996.00000018.000000
75%2011.00000035.750000
max2022.0000001796.000000
SouthAmerican.describe()
Yearyearly_launches
count61.00000061.000000
mean2009.3606561.852459
std10.1259281.930769
min1985.0000001.000000
25%2000.0000001.000000
50%2013.0000001.000000
75%2017.0000002.000000
max2022.00000013.000000
#saving each dataframe to a csv

African.to_csv('African_SpaceObject.csv')
SouthAmerican.to_csv('SouthAmerican_SpaceObject.csv')
NorthAmerican.to_csv('NorthAmerican_SpaceObject.csv')
Asian.to_csv('Asian_SpaceObject.csv')
European.to_csv('European_SpaceObject.csv')
World.to_csv('World_SpaceObject.csv')
Oceanic.to_csv('Oceanic_SpaceObject.csv')
Agencies.to_csv('Agencies_SpaceObject.csv')