DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

Score Editor

Introduction

We are beginning the score editor program that will allow the user to create, edit, save, load, and render scores. Rendering a score is converting it into a WAV file. Saving and loading are using a custom text format. Editing will allow changing instruments, notes, and mixers.

Assignment

The score editor is a new program, similar in structure to the instrument designer program. It will reuse some commands from the menu test and instrument designer programs, and create many new commands. Here are the commands that are required for this assignment.

Command Prefixable? Function Description
help no menuUI Display help message.
menu no menuUI Display help message.
# yes commentUI Skip to end of line (comment).
comment no commentUI Skip to end of line (comment).
echo no echoUI Echo back the arguments given.
quit no quitUI Terminate the program.
score-list-waveforms no listScoreWaveformsUI List waveforms in the score.
score-add-waveform no addScoreWaveformUI Add waveform to the score.
score-edit-waveform no editScoreWaveformUI Edit waveform in the score.

Example Session

$ ./program-score-editor/score_editor 
Choice? menu
Options are:
  # - Skip to end of line (comment).
  comment - Skip to end of line (comment).
  echo - Echo back the arguments given.
  help - Display help message.
  menu - Display help message.
  quit - Terminate the program.
  score-add-waveform - Add waveform to the score.
  score-edit-waveform - Edit waveform in the score.
  score-list-waveforms - List waveforms in the score.

Choice? score-add-waveform
Waveform name: sin1
Waveform type: sine
Amplitude: 0.80
Choice? score-add-waveform
Waveform name: squ1
Waveform type: rectangle
Unable to create a waveform of type 'rectangle'.
Choice? score-edit-waveform
Waveform name: sin1
Amplitude(0.8): 0.90
Choice? score-edit-waveform
Waveform name: squ1
Unable to find a waveform with name 'squ1'.
Choice? score-list-waveforms
sin1 : sin1 sine 0.9
Choice? quit

Programming Requirements

Update library-waveform/Waveform.h

Create library-score/MusicalScore.{h,cpp}

We will start the MusicalScore class by adding the Waveforms collection. Future assignments will add more to the class.

MusicalScore Class

This class will store all of the information for a piece of music.

Data Members:

public Methods:

Create library-score/Makefile

This file is responsible for making a library named libscore.a, and installing it and its header files.

Create library-score-io/ScoreReader.{h,cpp}

We will start the ScoreReader class by adding the ability to read Waveform objects. Future assignments will add more to the class.

ScoreReader Class

This class will eventually read all of the information for a piece of music from the .score file format.

Data Members:

No data members are required.

public Methods:

Create library-score-io/Makefile

This file is responsible for making a library named libscore-io.a, and installing it and its header files.

Update library-application/ApplicationData.{h,cpp}

We will update the ApplicationData class to have a MusicalScore member.

ApplicationData Class

Note there is no need to change the constructor, as the MusicalScore default constructor will create an empty MusicalScore object, just fine.

Data Members:

public Methods:

Create library-commands/score_editor_aux.{h,cpp}

Commands created for the score editor program will go here. We’ll make a few in this assignment, and add more in future assignments.

Functions:

Create program-score-editor/score_editor.cpp

Functions:

Create program-score-editor/Makefile

This file must contain rules such that any of the following commands will build the score_editor program:

Create program-score-editor/.gitignore

The file needs to store one line of text:

score_editor

This will prevent the executable program from being committed to the repository. It is a derived file.

Update Makefile

Additional Documentation

Grading Instructions

To receive credit for this assignment:

Extra Challenges (Not Required)

TBA

Last Updated 03/27/2025