Keyboard Mirror Assignment

Start by familiarizing yourself with the program for shadow (shadow.cpp). It was introduced in class.

Create a new version called mirror.cpp and set up a copy of mirror.cpp and mirror.exe on your web site under a new folder called "lab2."

Instead of the computer playing a shadow note at a constant interval away from the played note, mirror should reflect a note off middle-C on the synthesizer (called C4 in standard pitch terminology or note number 60 in MIDI). If you play D4, the computer plays Bf3 (62 & 58), or if you play F3 it plays G4 (53 & 67).

You'll only need to change the equation calculating shadowNote inside the function mainloopalgorithms which in shadow.cpp looks like

shadowNote = noteMessage.p1() + shadowSide * shadowDistance;

in other words it sets

outgoing note to be the incoming note plus or minus the interval

For the mirror change this equation to

outgoing note to be mid-C minus the (incoming note minus mid-C)