Question: How can i make my code flow better on earsketch, also change the sounds if needed to make it sound better. # Import earsketch from

How can i make my code flow better on earsketch, also change the sounds if needed to make it sound better. # Import earsketch
from earsketch import *
# Function to make my intro
def intro():
# Add instruments to track
hiHat = AK_UNDOG_CLAPS_SNAPS_3
fitMedia(hiHat,1,1,7)
fitMedia(AK_UNDOG_808_1,2,1,5)
fitMedia(AK_UNDOG_STOMP_1,1,2,6)
# Make track 1 and track 2 slowly loss volume then regain the volume as verse1 approaches
setEffect(1, VOLUME, GAIN, 0,2,-30,5)
setEffect(2, VOLUME, GAIN, 0,2,-30,5)
# Instruments for the beat
closedHat = AK_UNDOG_808_1
lowTom = AK_UNDOG_808_3
openHat = OS_OPENHAT03
# Patterns for each instrument
makePattern1="0+--0+--0+--0+--"
makePattern2="0000000000000000"
makePattern3="--0+--0+--0+--0+"
# For loop to repeat the same beat from measures 5 to 12
for measure in range(6,10):
makeBeat(closedHat,3, measure, makePattern2)
makeBeat(lowTom,4, measure, makePattern1)
makeBeat(openHat,5, measure, makePattern3)
# Instruments and effects to transition into verse 1
setEffect(3, VOLUME, GAIN, 0,12,-30,13.5)
fitMedia(AK_UNDOG_LEAD_VOCALS_CHORUS, 6,9,11)
# Effects to transition into verse 1
setEffect(1, VOLUME, GAIN, -30,13.5,0,15.5)
setEffect(2, VOLUME, GAIN, -30,13.5,0,15.5)
setEffect(3, VOLUME, GAIN, -30,13.5,0,15.5)
# Function for verses
def verse1():
# Fit new instruments onto track
fitMedia(AK_UNDOG_PAD_1,2,6,41)
fitMedia(AK_UNDOG_LEAD_VOCALS_CHORUS, 1,6,23)
fitMedia(YG_NEW_HIP_HOP_CLAP_2,3,8,41)
fitMedia(AK_UNDOG_LEAD_VOCALS_BRIDGE_1,1,9,41)
# Clap to transition into the chorus
clapBeat = OS_CLAP01
transition ="0000000+"
makeBeat(clapBeat,1,24.5, transition)
# Function for chorus
def chorus():
# Fit instruments into chorus
fitMedia(ENTREP_THEME_BRASS, 1,10,16)
fitMedia(ENTREP_PERC_HIHAT, 2,10,16)
fitMedia(AK_UNDOG_LEAD_VOCALS_BRIDGE_2,5,12,14)
setEffect(1, VOLUME, GAIN, 0,10,-15,12)
setEffect(2, VOLUME, GAIN, 0,10,-15,12)
# For loop to repeat the same instruments over unique measures
for measure in range(6,10):
# Repeat only in measures that are even
if measure %2==0:
fitMedia(AK_UNDOG_LEAD_VOCALS_BRIDGE_1,5, measure, measure +1)
# Instruments for beat
kick = ENTREP_PERC_KICK_2
orchCrash = ENTREP_PERC_ORCH_CRASH
# Pattern for the first beat of chorus (measures 25-28)
pattern1="0-----0-----0--"
pattern2="--0+----0+-----"
# Create the beat from measure 25 to 28
for measure in range(28,31):
if measure %2!=0:
makeBeat(kick,3, measure, pattern1)
makeBeat(orchCrash,4, measure, pattern2)
# Pattern for 2nd beat of chorus (measures 33-37)
pattern1="00+---0-00+----"
pattern2="----0+------0+-"
# Create and repeat beat starting from measure 33 until 37
for measure in range(33,37):
makeBeat(kick,3, measure, pattern1)
makeBeat(orchCrash,4, measure, pattern2)
# Initialize song and set temp to 85 bpm
init()
setTempo(85)
# Main song. Invoke each part of song
intro()
verse1()
chorus()
# End of song
finish()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!