CCSC
  • Home
    • About Us >
      • Contact Us
    • In the news
  • Research
    • Presentations
    • Podcast
    • Resources
  • CS Institute
    • 2022 CSI >
      • module1
      • module2
      • module3
      • module4
    • FAQs
    • 2021 CSI >
      • week1
      • week2
      • week3
      • 2021 CSI Resources
    • 2020 CSI Highlights
    • 2019 CSI Highlights
    • 2017 CSI Highlights
  • Design Lab
    • Updates
    • Playdates
    • Lesson Repositories
    • Reserve hardware
    • Request material
    • Reserve design lab

Code a song

Intro to EarSketch
  • Open EarSketch.
  • Click to Create a new script (give a script name & script language is Python)
  • Select all and Delete.
  • Select the Sample Music Code below and copy
  • Go back to EarSketch and paste the code
  • Click Run (you will need to click Run every time you make a change to the code)
  • Click play button and listen to your beautiful music
  • Try replacing an instrument for the variable synth1. Delete TECHNO_SYNTHPLUCK_001 and paste in new instrument, eg. synth1 = HOUSE_ACOUSTIC_PIANO_004
  • Try creating a new variable.
  • Try adding a new track.
  • When finished, download your song. Select second folder on left-hand side of screen. Select blue lines next to your script. Select Download. Select MP3.
Sample Code
#        python code
#        script_name:
#
#        author:
#        description:
#

from earsketch import *

init()
setTempo(120)

synth1 = TECHNO_SYNTHPLUCK_001
synth2 = RD_EDM_ANALOGLEAD_3
drums = TECHNO_LOOP_PART_006

#melody
fitMedia(synth1, 1, 1, 2)
fitMedia(synth2, 2, 2, 4)
fitMedia(synth1, 1, 3, 4)
fitMedia(synth2, 2, 4, 5)
fitMedia(synth1, 1, 5, 6)
fitMedia(synth2, 2, 6, 7)
fitMedia(synth1, 1, 7, 8)
fitMedia(synth2, 2, 8, 9)

#drums
fitMedia(drums, 4, 5, 9)

finish()

Celebrity Song Remix Challenge from Amazon Future Engineers
  • Remix with an Effect
  • Remix with Mood: using effects, pitch, and tempo
  • Remix with a Beat
  • Remix from Home: Uploading sounds from your community
  • Remix with Gratitude: Say thank you through code
  • Remix with Functions
Picture
Picture
Picture
Picture
Picture
Picture

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
  • Home
    • About Us >
      • Contact Us
    • In the news
  • Research
    • Presentations
    • Podcast
    • Resources
  • CS Institute
    • 2022 CSI >
      • module1
      • module2
      • module3
      • module4
    • FAQs
    • 2021 CSI >
      • week1
      • week2
      • week3
      • 2021 CSI Resources
    • 2020 CSI Highlights
    • 2019 CSI Highlights
    • 2017 CSI Highlights
  • Design Lab
    • Updates
    • Playdates
    • Lesson Repositories
    • Reserve hardware
    • Request material
    • Reserve design lab