Project 03 |
Goals
|
|---|---|
Setup |
SetupStart with your code from Lab 3 that determines which button is pressed using an analog input and plays a note using the tone library. Save it as a new Arduino project titled Notes on Variable Types
Waveforms.h
|
Timers |
TimersYou will be creating a phase correct PWM at the nominal frequency of 31372.549. Videos and Datasheet ReadingIntroduction to RegistersIntroduction to External Interrupts Introduction to Timer Interrupts Review 16.9-16.11.8 of the ATmega328P Datasheet Create your C++ file Waveforms.cpp
Notes on Bitwise ShiftingSet Registers in Setup()
Timer Overflow Interrupt
Replace Tone() with an Oscillator
|
Parallel Piano |
Additive SynthesisYou will use additive synthesis to play two notes at once. Save part 1 as a new Arduino project titled Suggested Readings from Physical Audio Signal Processing For Virtual Musical Instruments and Audio Effects by Julius O. Smith III Detect 2 Keys PressedModify your code so if two buttons are pressed at the same time, it prints the name of the note associated with both buttons. Use the equation you derived for Vout when two buttons are pressed at the same time to calculate the expected A0 readings. Parallel PianoModify your code to be able to play two notes at once.
Inside your loop, update your oscillator's volume and phase step dependent on the button or buttons pressed. You can use your rolling average struct for smoothing the signal with a short window if needed, though if it is too long it may create a glissando between notes. |
Submission |
Submit your code on FilerSubmit your arduino code in a folder titled Submit your report and video on Google ClassroomUpload a 1-3 min Documentation Video of your keyboard, showing that each note works and each pair of notes work. Describe what is happening. Attach a Google Doc Report which includes:
|