DIGITAL AUDIO WORKSTATION

CODE EDITOR

# BreakBeatCode example Day 3 lesson
# script_name: 03.fitMedia-insertMedia-makeBeat.py
# version/date: 20220426
#
# author: Fernando Sanchez
#
# description:
# - fitMedia on one track
# - fitMedia on multiple tracks
# - makeBeat
#

# Anything after a hashtag is a Comment
# It's helpful as documentation to inform the reader/coder
# Makes the code more readable but it's not executed

# It's also used to execute code "in parts" for debugging
# In these examples, you are expected to gradually uncomment some parts
# 120 BPM

from earsketch import *

init() #in latest version this is not required

mytempo = readInput("What tempo would you like to use?") #set Tempo to 120 Beats Per Minute (BPM)
a_number = int(mytempo)
setTempo(a_number)

##### Part 1:
##### A few fitMedia() examples:

start = 1
end = 9

# - A beat / drum pattern extending through track 1 (use fitMedia() for this)
beat_number = readInput("Beat 1 or Beat 2 (1 or 2)")
IMPORT TO EDIT

Welcome Students and Teachers!

Welcome to EarSketch!

Teachers: View our new curriculum guide, and visit our EarSketch Teacher Site for additional resources.

Students: Continue below to learn more about EarSketch

Here you will learn computer science and music technology side by side. You will use either Python or JavaScript to create your own music.

Musicians and programmers write computer code to create new sounds, effects, and songs.

Learning to write computer code is a skill that will be useful to you in a variety of career paths.

Maybe you’ll become a legendary music producer or the industry’s most sought-after recording engineer! We wish you good luck on your EarSketch journey.

Click on the right arrow at the top of this text to get started.

Teachers, get access to free teacher materials and community here!