Week4
This week is the last week of the entire project, and the main functions of our project will be completed this week.
All tasks include the following:
1. Complete the guitar part code.
2. Use switches to control transitions between instruments.
3. Use ultrasonic sensors to control changes in pitch.
4. Complete the poster production.
First, we complete the adjustment of the ultrasonic sensor. By changing the distance, the changes in the piano's tone can be controlled.
Secondly, the code for the guitar instrument is also completed this week. Changes in chords can also be controlled by changing the distance of the ultrasonic sensor.
Then we adjusted the circuit again. Add switches to control switching between instruments.
Final version of code
Python part
Mainly used serial and pygame libraries. The core approach of the code snippet is to receive the signal sent by Arduino through serial communication and play the corresponding audio file based on the content of the signal. Audio files are divided into piano, guitar, chords and accompaniment. Functions implemented include: audio file loading, audio playback control, dynamic audio management, and serial communication.
At this point our projects are all completed.



Comments
Post a Comment