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. 21

Addditional Features of Pencil Code and ABC Notation

Thursday, April 7, 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

Important Date Reminders

Two things to be working on

People who have MaKey MaKey boards that need to be returned before we will release final grades

Mohd Anwar   Tak Lo
Greg Caldwell   John McManus
Alex Casperson       Yusuf Mulyo
Andrew Cornish   Max Nelson
Kyle Elardo   Eddie Pozo
Hannah Ewing   Rodrigo Souza
Nsoah Foster   Brad Swenson
Mat Har   Dylan Wetherald
Christian Hernandez   Zack Wong

Special Note to Kevin Goddu, Dylan Wetherald, and Daniel Lee


Class Notes

A Recommended Approach to Assignment No. 7

  1. Download and install ABC notation on your own system:

    https://sourceforge.net/projects/easyabc/

  2. Code your music in ABC notation using EasyABC.
  3. Please note:

  4. Save the music you create in a text file with an extension of .abc
    1. Open a new, blank document using any plain text editor on your computer.
    2. Copy the ABC code from WebMusicScore and paste it into your new document.
    3. Save that document with an extension of .abc.
       
  5. Open Pencil Code.
     
  6. Go to the appropriate template MultiTemplate in Jesse’s account.
    Number
    of Parts

    Code Template
    2 http://drjay.pencilcode.net/edit/MultiTemplate2
    3 http://drjay.pencilcode.net/edit/MultiTemplate3
    4 http://drjay.pencilcode.net/edit/MultiTemplate4
    5 http://drjay.pencilcode.net/edit/MultiTemplate5
    6 http://drjay.pencilcode.net/edit/MultiTemplate6
  7. As shown in the assignment write-up, click the down arrow next to the Save button and click Copy and Save As... to save a copy of the template to your own account.
    • You will have to supply the credentials for your Pencil Code account
    • Be sure to specify an appropriate name for your copy, *not* “MultiTemplate”.
       
  8. Copy the ABC code from your .abc file and paste it into Pencil Code at the bottom of the file that you just created from the template.
     
  9. Surround each line of the ABC code with:

    sing n, "your copied ABC code"

    • sing must be typed in lowercase
    • replace n with the number of the keyboard that you want the music to play on
    • n must be followed by a comma
    • enclose your copied ABC code in double quotes
       
  10. Save your Pencil Code program and test it to ensure that it plays your music as desired
    • remember that Pencil Code plays your music as if it used a Scratch broadcast
    • therefore, it can be difficult to stop the music once it starts playing
    • therefore, test part of your music at a time using the if trick that we’ll go over in class


ABC Notation Encoding  (continued)


Coding Sharps and Flats and Naturals

However, note that if you set the key properly, ABC notation will automagically sharpen or flatten notes


Directives


Example

figure source: http://www.letsplaykidsmusic.com/wp-content/uploads/2013/02/row-row-row-your-boat.jpg

Pencil Code implementation - Version 1 - using Pencil Code’s play function

Pencil Code implementation - Version 2 - using the sing function

The ABC Notation as generated by EasyABC

The ABC Notation as used in Pencil Code


Introduction to Assignment No. 7



This is document http://jesseheines.com:8080/~heines/91.212/91.212-2015-16s/212-lecs/lecture21.jsp.  It was last modified on Friday, August 26, 2022 at 4:09 PM.
Copyright © 2022 by Jesse M. Heines.  All rights reserved.  May be freely copied or excerpted for educational purposes with credit to the author.