关键词 > ECE4163/ECE6183

ECE 4163 / ECE 6183 DSP Lab Demo 18 Exercise: Keyboard Audio Control

发布时间:2022-10-28

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Demo 18 Exercise: Keyboard Audio Control

DSP Lab (ECE 4163 / ECE 6183)

2019

Exercise

Write a program that plays a different note for different keys on the keyboard. The program can be based on keyboard_demo_06 .py, but instead of just a single note, it should enable a whole octave of notes (12 notes).

The notes should play overlappingly (if a note is played before the previous notes have become silent, then both notes should be heard at the same time).  There should be a difference equation (filter) to implement each note. Each difference equation should have its own input and output signal. The output signals of the separate lters should be added together to give the total output signal.  The total output signal should be written to the output audio device (loudspeaker/headphones).

For a full octave (twelve notes), adjacent notes on a piano keyboard are related via

fk  = 2k/12f0 .        k = 0. 1. 2. y y y

You can set f0  = 440 Hz which is middle A.