This is a RosNode to translate the sound signal to western notation, based on the base version from Michael.
This installation instruction has been currently verified only at the lab compute.
- Come to your project position, the build the python virtualenv:
python -m venv env_sound2note --system-site-packages && source env_sound2note/bin/activate - Build you ros workspace:
mkdir -p ws_soud2note/src && cd ws_soud2note/src - Download the code:
git clone https://github.com/yunlong-wang-cn/music_perception.git - Install the python requirements:
pip install librosa, and thepip install crepe
- Activate the ros environment on the computer:
source /opt/ros/noetic/setup.bash, or write this command into~/.bashrc - Because the
audio_commonin lab computer is out of date, so you need to download it and rebuild, thereforegit clone https://github.com/ros-drivers/audio_common.git - Try to build the package:
catkin build
- Action current built ros package:
source devel/setup.bash - Start the sound capture node:
roslaunch music_perception microphone.launch - Open a new terminal and start the note onset detection node:
roslaunch music_perception detect_onset.launch(don't forget to activate the python venv and source thesetup.bashof both ros noetic and the ros package built before) - To see the topic relationship: open new terminal and then
rqt_graph - To see the spectrum: open rviz with
rviz, and then add a display with typeimage, choose the topic/spectrogram, then you'll see something like heatmap, that is the spectrum, and you can play with it.