AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Master reboot piano1/14/2024 ![]() The software keeps track of which sensors are covered (within 10cm) and which are not. See the video attached to this step for a full demonstration of the project, including how the gesture controls work. If you are curious, the "-release" flag tells Rust to compile the code as efficiently as possible, as opposed to the default "-debug" setting. If not, then skip to the troubleshooting section at the end of this instructable. ![]() As you move your hand over the sensors, you should see data being generated. This will read data from the sensors and translate them into MIDI notes that are then printed out on the console. Use the following command to run the application. Compile the source code cd UltrasonicPiPianoīefore we move onto making music in the next step, let's make sure that the software runs and that we can read valid data from the sensors. If you are familiar with git and github, you can clone the repo: git clone you can download a zip file of the latest code. There are two options for getting the code. The source code for the Ultrasonic Pi Piano source code is hosted on github. export RUSTUP_USE_HYPER=1curl -sSf | sh Download the Ultrasonic Pi Piano source code If you would like that, please contact me. I am working on creating an image that people can download and burn onto an SD card. Bad timing :-/ but I have modified the command below to workaround the issue. NOTE: Since posting this instructable, there are some issues with installing Rust on the Raspberry Pi. You can accept the default answers to any questions during the install. To save you time, the instructions are to run this one command. It's what all the cool kids are using these days.įollow the instructions at to install Rust. The Ultrasonic Pi Piano is implemented in the Rust Programming Language from Mozilla (it's like C++ but without the bad bits). You can install it from the command-line with this command: sudo apt-get install fluidsynth Install the Rust Programming Language Install FluidSynthįluidsynth is an amazing free software MIDI synth. It is also important to reboot the Pi after enabling SPI for it to take effect. ![]() You must enable SPI on the Raspberry Pi for this project to work! Use the Raspberry Pi Configuration utility to do this. Start with a clean install of Raspbian Jessie, then update it to the latest version: sudo apt-get update HC-SR04 require 5V and the Raspberry Pi is only 3.3V, so this is why we also need the logic level converter that will connect the Raspberry Pi to the Octasonic breakout board. This board connects to all of the sensors and has a dedicated microcontroller that monitors the sensors and then communicates with the Raspberry Pi over SPI. This is where the Octasonic breakout board comes in. Typically, Trigger and Echo are connected to separate pins on a microcontroller or Raspberry Pi but that means you would need to utilize 16 pins to connect 8 sensors, and this is not practical. HC-SR04 ultrasonic sensors have 4 connections - 5V, GND, Trigger, and Echo. It can work fine with a Raspberry Pi 2 with a little tweaking but I would not attempt to use the original Raspberry Pi for this project. I would recommend using a Raspberry Pi 3 if possible since it has more computing power, resulting in a more responsive and pleasing sound.
0 Comments
Read More
Leave a Reply. |