parseInput - function vec = parseInput(ca) %Write a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function vec = parseInput(ca) %Write a function, parseInput, that takes in a cell array of strings, %each representing a note on the piano. The function should return a %vector of half steps, up (+) or down (-), from middle C (C4). %Notes will be in one of two formats: either of length 2, with the note %name and octave (F3) or of length 3 with note name, sharp/flat, and %octave (G#4). Note names go in the following order: C,D,E,F,G,A,B. %When going from B to C, the octave number is incremented (so B3 and C4 %are 1 half step away, where E3 and F4 are an octave and a half step %away). %For the less musically inclined, here's a quick rundown of how you %should approach each piece of data. Refer to Piano Notes.jpg as you %read this: % - In this example we will compute how far away G#3 is from C4. % - First add the number of half-steps that seperate your note from % C- don't worry about octaves or sharps/flats. A half-step is one % piano key. So. .. vec = [];
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Page1 / 2

parseInput - function vec = parseInput(ca) %Write a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online