UMass Lowell Dept. of Computer Science
COMP 2120 / MUED 2120 — Sound Thinking
Spring 2016 Semester, Section 201
Prof. Jesse M. Heines and Prof. Gena Greher
Notes for Class No. 11
Reintroduction to Scratch and Its Facilities for Recorded and MIDI Sounds (continued)
Thursday, February 25, 2016
A video of this class is (or will be) posted at:
http://echo360.uml.edu/heines2016/comp-mued2120.html
Handouts and Materials
Openings / Announcements / Reminders
A special treat for last night’s Opera Workshop performers
- Note to Gena: It Ain’t Barbershop!
2 students still have not submitted their responses to the reflective questions for Assignment No. 3
Class Notes
Review from last class ...
Using Variables and Conditional Control Structures
Note: In Scratch 2.0, the Variables category has changed to Data
Version 1
| Version 2
| Version 3
|
|
|
|
- DrumSet1-loop.sb — Scratch 1.4 (download) | Scratch 2.0 (online)
- to make this work well, I used Audacity to modify the DrumSet1.mp3 file that comes with Scratch
- see Media
->
Sounds ->
Music Loops ->
DrumSet1
- I trimmed silence from the beginning and end
- I stretched it out to exactly 2 seconds
- I named the new MP3 DrumSet1-2sec.mp3
Reminder to set Turbo Speed before running any of these programs
In Scratch 1.4, the Turbo Speed option is a suboption under Edit->
Set Single Stepping...
In Scratch 2.0, the Turbo Mode option is at the top level of the Edit menu
New material begins here ...
Working with Scratch Sprites
Editing Sprites
- renaming sprites
- setting backgrounds (the Stage)
- changing sprite icons (using Costumes)
- hiding sprite icons
Creating New Sprites
- creating new, blank sprites
- duplicating sprites (Ctrl-click an existing sprite)
Using Multiple Scripts
- understanding what’s going on when two scripts are running
- understanding local vs. global settings
- volume is local
- tempo is global
- variables can be either local or global
Structuring Scratch programs using a Main script
Main Script |
Script to play Kitten sound |
Script to play Drum sound |
|
|
|
Revisiting “Total Eclipse of the Heart”
Click here to download this starter program — Scratch 2.0 version (online)
Click here to download Prof. Greher’s version 2 — Scratch 2.0 version (online)
Jesse’s version 3 — Scratch 2.0 version only (online, see Sprite5)
MIDI Note Concepts
MIDI stands for Musical Instrument Digital Interface
- “MIDI is an extensive set of ‘musical commands’ which electronic instruments use to control each other.” (Jeff Glatt)
- “MIDI is an industry-standard protocol that enables electronic musical instruments (synthesizers, drum machines), computers and other electronic equipment (MIDI controllers, sound cards, samplers) to communicate and synchronize with each other.” (Wikipedia)
- we will only be using only the part of MIDI needed to play notes
MIDI Note Numbers
- each note is simply assigned a number
- middle C has MIDI number 60
- this is note C4 on a piano keyboard, the C in the 4th octave
- each step from MIDI note N to MIDI note N+1 or N-1 is a half-tone
- thus, C# has MIDI number 61
- there are 12 half-tones in an octave
- therefore, the C above middle C has number 60 + 12 = 72
- and the C below middle C has number 60 - 12 = 48
- don’t make it any harder than that!
- all you have to do is use the play note block
Tempo
- the duration of a beat is determined by tempo
- the default tempo is 60 beats per minute (bpm)
- to Scratch, tempo is like volume
- there is a tempo variable
- you can set that variable or you can change that variable
- but unlike volume, tempo is global
Sprite1 |
|
Sprite2 |
|
|
|
Enhanced Version
Main |
|
Init |
|
|
|
|
|
|
Script1 |
|
Script2 |
|
|
|
Stage |
|
|
|
|
|
Downloads for Above Examples
One last Sound block: set instrument
- there are 128 instruments
- some are very realistic, others are not
- to manually set the instrument, click the down arrow
- to set the instrument under program control, drag a variable into the number area