SlideShare a Scribd company logo
1 of 24
Computational Music Mixing
with EarSketch
D
A
Y
3
1CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
2/32
N
Who are we ?
D
A
Y
3
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
•A Philosophy of Music Education:Bennett
Reimer
Music allows humans to encode, refine,
reflect, and sharenon-verbal thought in a
dynamic moving systemthat changesover
time.
3/32
Why Music and Programming?
D
A
Y
3
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
•Online Programming and Music Mixing Workstation
•Used at GeorgiaTech to teach Digital Music Mixing.
•Tool for Programming
•Free!
•Web based
9/32
What is EarSketch?
D
A
Y
3
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
EarSketchWebsite:WebbasedIDEandDAW
CodingWindow: Programming
Music View: Display and Playback
Documentation
and CurriculumSoundLibrary
Toggle
Views
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8 12/32CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
14/32
Go to“http://earsketch.gatech.edu/earsketch2"
and login with your EarSketch account name
and password.
MakingaccountonEarSketch
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 14/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
15/32
To listen to music examples, use the sound
browser to the left and click on the play icon.
You can browse the music clips using the
Genres and Artists buttons.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 15/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
Comments
FinishSection
}
}Setup Section
} MusicSection
}
1/16/32
SampleEarSketchProgram
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 16/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
Essential Elements wewilluse inPython:
● Comments
# This is a comment – meant for Humans
● Includes – loading preset methods ordata
from earsketch import *
● Functions– telling the computer “what to do”
fitMedia(drums, 1, 1, 5)
● Variables and data types – Namesfor information
stored by program
Beat1 = “0+++0+++0+0+0+++”
● Tabs:Enclosecode in sections
● Lists:Groups variables into one datastructure
17/32
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 17/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
18/32
SetupSection
● The import statement
sets up the basic EarSketch commands to
be used.
● is a function with no parameter, that
creates a new project in reaper.
● is the function to establish the
tempo for the project by setting the
parameter to number of the beats per
minute.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 18/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
DefiningVariables
19/32
We will now define three variables for
drums, lead, and bass: (You may pick
three sounds for yourself. Try to select a
drum part, melody, and bass)
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 19/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
20/32
● We will use fitMedia() to place the variables on tracks. Type the
following to begin placing music on track one. In this example we:
a. Locate ‘drums’ on track 1
b. Start the ‘drums’ at measure 1
c. End ‘drums’ at measure 9
● The function can take a number of values that are called
parameters. Parameters provide a way to customize a function in
order to make it do what you want.
fitMedia()Function
fitMedia(file, track, start, end)
Location of
Media
Sound
Which Track
in Reaper Start
measure.
End
measure.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 20/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
“fitMedia”Function
21/32
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 21/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
22/32
● We will now create a contrasting section of music from measures
9 to 17. Add a new comment and then select 3 or 4 more music
samples:
DefiningVariablesfotMusicSectionB
● Use fitMedia() calls for Section B from measure 9 to 17.
● Click on Run to listen to your music.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 22/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
23/32
Timetogetrandom
● One way that programming shines is being able to include
randomness into projects, meaning that the music will be different
every time the script runs.
is a simple variable that is being assigned the output from a new function
.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 23/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
24/32
Looping
For instance, let’s say that we want to insert a single, four measure
long clip of music onto a particular track three times.
● Looping can include multiple executions of some section of code
At first, you might approach this situation this way:
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 24/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
25/32
Looping
● The variable is is the index variable for the loop. As the loop
iterates, or executes the statements inside the loop, will be
assigned numbers from 1 through 12.
● The function can have either two or three parameters,
• The first parameter indicates the starting point.
• The second parameter is for ending the loop.
• The third parameter tells the loop how much to increment the index
variable every iteration.
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 25/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
For Loops: Skip Counting
fillDrum = HIP_HOP_SYNTHDRUMS2_2M
for measure in range(1, 9, 2):
fitMedia(fillDrum, 1, measure, measure +1 )
measure is the “index variable” = assigned values from the
range()
(1, 9, 2) means start counting at 1,
end before 9 [meaning 8] and skip count by 2:
(1, 3, 5, 7)
26/32
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 26/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
27/32
1- How could this code be made more manageable?
QuestionandExercise
D
A
Y
3
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 27/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
2/32
N
Description
D
A
Y
5
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 2/13
● In music production we can use effects such as
Volume, Pan, Distortion, Delay, and Pitch to change
the properties of the sounds on tracks.
● With these effects we can add color and variety to
the musical samples.
● This lesson will describe the use of the setEffect()
function and demonstrate the effects of Volume,
Pan, and Distortion.
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
2/32
N
D
A
Y
5
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 3/13
Effect: A tool to manipulate, process, shape, ad change the sound oftracks.
Parameter: The particular value of the effect changed by the envelope.
Examples include GAIN, LEFT_RIGHT,and MIX
Envelope: The values of the Effect parameter asmeasured over time.
This controls the change of effect over time.
Function for setting effects:
setEffect(track, effect, parameter, startValue, startMeasure, endValue,
endMeasure)
Example:
setEffect(1, VOLUME, GAIN, -40, 1, 5, 5)
Vocabulary
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
3/32
D
A
Y
5
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 4/13
Volume Effect
● In one example, we want track 3 to ‘fade in’ from the beginning.
Therefore we need to use VOLUME effect and parameters.
Effect: VOLUME
Parameter: GAIN
Values: -60 (all the way quiet) to 12 (all the way loud) (we
will use -40 to 5) (Note that 0 is ‘unity’ or standard volume
gain setting)
Setting Volume Effects as following:
setEffect(track, VOLUME, GAIN, level, start, level2, end)
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
4/32
Assignment
D
A
Y
5
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 5/13
Add the following code to call VOLUME effect:
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
1/5/32
Decreasing Volume
D
A
Y
5
MAGIC Presenter : Fatemeh Jamshidi. June 17-22 6/13
● Let us say we want the volume to decrease from measures 7 to
9 on track three. Write this code to decrease the volume:
CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8

More Related Content

Recently uploaded

SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Presentation

  • 1. Computational Music Mixing with EarSketch D A Y 3 1CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 2. 2/32 N Who are we ? D A Y 3 CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 3. •A Philosophy of Music Education:Bennett Reimer Music allows humans to encode, refine, reflect, and sharenon-verbal thought in a dynamic moving systemthat changesover time. 3/32 Why Music and Programming? D A Y 3 CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 4. •Online Programming and Music Mixing Workstation •Used at GeorgiaTech to teach Digital Music Mixing. •Tool for Programming •Free! •Web based 9/32 What is EarSketch? D A Y 3 CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 5. EarSketchWebsite:WebbasedIDEandDAW CodingWindow: Programming Music View: Display and Playback Documentation and CurriculumSoundLibrary Toggle Views CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8 12/32CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 6. 14/32 Go to“http://earsketch.gatech.edu/earsketch2" and login with your EarSketch account name and password. MakingaccountonEarSketch D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 14/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 7. 15/32 To listen to music examples, use the sound browser to the left and click on the play icon. You can browse the music clips using the Genres and Artists buttons. D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 15/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 8. Comments FinishSection } }Setup Section } MusicSection } 1/16/32 SampleEarSketchProgram D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 16/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 9. Essential Elements wewilluse inPython: ● Comments # This is a comment – meant for Humans ● Includes – loading preset methods ordata from earsketch import * ● Functions– telling the computer “what to do” fitMedia(drums, 1, 1, 5) ● Variables and data types – Namesfor information stored by program Beat1 = “0+++0+++0+0+0+++” ● Tabs:Enclosecode in sections ● Lists:Groups variables into one datastructure 17/32 D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 17/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 10. 18/32 SetupSection ● The import statement sets up the basic EarSketch commands to be used. ● is a function with no parameter, that creates a new project in reaper. ● is the function to establish the tempo for the project by setting the parameter to number of the beats per minute. D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 18/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 11. DefiningVariables 19/32 We will now define three variables for drums, lead, and bass: (You may pick three sounds for yourself. Try to select a drum part, melody, and bass) D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 19/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 12. 20/32 ● We will use fitMedia() to place the variables on tracks. Type the following to begin placing music on track one. In this example we: a. Locate ‘drums’ on track 1 b. Start the ‘drums’ at measure 1 c. End ‘drums’ at measure 9 ● The function can take a number of values that are called parameters. Parameters provide a way to customize a function in order to make it do what you want. fitMedia()Function fitMedia(file, track, start, end) Location of Media Sound Which Track in Reaper Start measure. End measure. D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 20/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 13. “fitMedia”Function 21/32 D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 21/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 14. 22/32 ● We will now create a contrasting section of music from measures 9 to 17. Add a new comment and then select 3 or 4 more music samples: DefiningVariablesfotMusicSectionB ● Use fitMedia() calls for Section B from measure 9 to 17. ● Click on Run to listen to your music. D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 22/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 15. 23/32 Timetogetrandom ● One way that programming shines is being able to include randomness into projects, meaning that the music will be different every time the script runs. is a simple variable that is being assigned the output from a new function . D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 23/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 16. 24/32 Looping For instance, let’s say that we want to insert a single, four measure long clip of music onto a particular track three times. ● Looping can include multiple executions of some section of code At first, you might approach this situation this way: D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 24/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 17. 25/32 Looping ● The variable is is the index variable for the loop. As the loop iterates, or executes the statements inside the loop, will be assigned numbers from 1 through 12. ● The function can have either two or three parameters, • The first parameter indicates the starting point. • The second parameter is for ending the loop. • The third parameter tells the loop how much to increment the index variable every iteration. D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 25/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 18. For Loops: Skip Counting fillDrum = HIP_HOP_SYNTHDRUMS2_2M for measure in range(1, 9, 2): fitMedia(fillDrum, 1, measure, measure +1 ) measure is the “index variable” = assigned values from the range() (1, 9, 2) means start counting at 1, end before 9 [meaning 8] and skip count by 2: (1, 3, 5, 7) 26/32 D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 26/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 19. 27/32 1- How could this code be made more manageable? QuestionandExercise D A Y 3 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 27/36CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 20. 2/32 N Description D A Y 5 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 2/13 ● In music production we can use effects such as Volume, Pan, Distortion, Delay, and Pitch to change the properties of the sounds on tracks. ● With these effects we can add color and variety to the musical samples. ● This lesson will describe the use of the setEffect() function and demonstrate the effects of Volume, Pan, and Distortion. CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 21. 2/32 N D A Y 5 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 3/13 Effect: A tool to manipulate, process, shape, ad change the sound oftracks. Parameter: The particular value of the effect changed by the envelope. Examples include GAIN, LEFT_RIGHT,and MIX Envelope: The values of the Effect parameter asmeasured over time. This controls the change of effect over time. Function for setting effects: setEffect(track, effect, parameter, startValue, startMeasure, endValue, endMeasure) Example: setEffect(1, VOLUME, GAIN, -40, 1, 5, 5) Vocabulary CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 22. 3/32 D A Y 5 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 4/13 Volume Effect ● In one example, we want track 3 to ‘fade in’ from the beginning. Therefore we need to use VOLUME effect and parameters. Effect: VOLUME Parameter: GAIN Values: -60 (all the way quiet) to 12 (all the way loud) (we will use -40 to 5) (Note that 0 is ‘unity’ or standard volume gain setting) Setting Volume Effects as following: setEffect(track, VOLUME, GAIN, level, start, level2, end) CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 23. 4/32 Assignment D A Y 5 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 5/13 Add the following code to call VOLUME effect: CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8
  • 24. 1/5/32 Decreasing Volume D A Y 5 MAGIC Presenter : Fatemeh Jamshidi. June 17-22 6/13 ● Let us say we want the volume to decrease from measures 7 to 9 on track three. Write this code to decrease the volume: CS4All Girls Presenter : Fatemeh Jamshidi. June 3-8