Table of Contents
This is a sound player for architectural model and can be used in any other application as well. At the end it became a part of the model for master thesis: Sonic relation as a design tool.
The idea of a sound player is to imitate acoustics in the designed spaces. User can touch a membrane which is a potentiometer. Produced analog value is then converted by MCP3008 to digital and used in the application. Based on reading's location, a particular, characteristic to the area sound is played. Additionally, there is algorithm implemented which plays and stops a sound of footsteps if the user is moving on the membrane. Mind that only one direction of movement (forward) is supported.
Main part of the system is Raspberry Pi. It works as a microcontroller which gets readings from two MCP3008s and plays a sound through audio port. Wiring between RPi and MCPs is shown on the picture below.
Note that wiring is missing pull-down resistors. These resistors are not needed if regular potentioneters are connected to the MCP. Pull-down resistors are used with ultraflat membrane potentiometer because when the membrane is not pressed, the end of MCP is floating thus these resistors are needed.
General idea of the system is pretty simple: read the values from the potentiometers and play the sound according to the configuration.
if __name__ == "__main__":
sliderScanner = SliderScanner()
soundPlayer = SoundPlayer()
while True:
try:
sliderScanner.readValues()
zone, move = sliderScanner.evaluateValues()
soundPlayer.playSounds(zone, move)
except KeyboardInterrupt:
print('Interrupted')
sys.exit(0)
See the diagram below to visualize execution of functions over time.
- First prototype board
- Extending the board with pull-down resistors
- Making a custom connector to connect with raspberry pi
- Full prototype with different types of membrane stripes
- Working on the model
- Connecting the board to the model
- Final result
This chapter contains all information to easily and fast start the application.
For the software point of view, only python packages are needed to run the application.
- execute this command to install all required python packages
python -m pip install -r requirements
To run the application, simply execute the command below:
python ./main.py
Distributed under the MIT License. See LICENSE
for more information.
Mateusz Dyrdol - @Mateusz Dyrdol - [email protected]
Project Link: https://github.com/Fysek/ArchSound/