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. 19
Introduction to Pencil Code, ABC Notation, and Assignment No. 7
Thursday, March 31, 2016
A video of this class is (or will be) posted at: http://echo360.uml.edu/heines2016/comp-mued2120.html
Handouts and Materials
Assignment No. 7: Programming Multiple Parts in Pencil Code
Pencil Code and ABC Notation Cheat Sheet
Openings / Announcements / Reminders
Important Date Reminders
- Monday, April 4: official Faculty Advising Period for the Fall 2016 semester begins
- Wednesday, April 6: last day for students to withdraw from courses with a grade of ”W”
- Thursday, April 7: Invitation to test student projects in Jesse’s GUI Programming class
- this class starts at 12:30 PM and goes until 1:45 PM, but you don’t have to be there the entire time
- there will be free pizza!
- Saturday, April 9: Hawkettes Concert, Cumnock Hall (North Campus)
- Saturday, April 30: Hawkapella Concert, Durgin Concert Hall (South Campus)
Class Notes
Related reading for this class: Cheat Sheet
Pencil Code
A First Look: Happy Birthday
Blocks mode vs. Text mode
The Sound Blocks
ABC Notation
Coding Note Values
- octaves go from C to B
- without additional notation, capital letters refer to octave 4
- an apostrophe after a note transposes that note up to the next higher octave
- lowercase letters can also be used for octave 5
- a comma after a note transposes it down to the next lower octave
adapted from: http://www.guitarsite.de/pics/clef.gif
Coding Note Durations
- a quarter note has a duration of 1 beat
- therefore, a letter all by itself is a quarter note
- G = G1
- the 1 is optional
- an eighth note has a duration of 1/2 of a quarter note
- therefore, a letter followed by /2 is an eighth note
- A/ = A/2
- the 2 is optional
- a sixteenth note has a duration of 1/4 of a quarter note
- therefore, a letter followed by a /4 is a sixteenth note
- B/4
- there is nothing optional here
- a half note has a duration of 2 quarter notes
- therefore, a letter followed by a 2 is a half note
- C2
- there is nothing optional here
- a whole note has a duration of 4 quarter notes
- therefore, a letter followed by a 4 is whole note
- D4
- there is nothing optional here
- dotted notes have a duration of 1-1/2 times the normal value of the note
- these are coded a a letter followed by 3/2 or 3/4 (as appropriate)
- E3/2
- note that you cannot write E1.5
Coding Sharps and Flats and Naturals
- to sharpen a note, precede it with a carat: ^
- to flatten a note, precede it with an underscore: _
- to naturalize a note, precede it with an equals sign: =
Example
figure source: http://www.letsplaykidsmusic.com/wp-content/uploads/2013/02/row-row-row-your-boat.jpg
Pencil Code implementation