Skip to content

dSalazar10/Project-Embedded_Musical_Instrument_Classification

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded Machine Learning

The Music Box is stand-alone platform built around the Beaglebone Black to record live music and classify the instrument that is playing in real-time. The software is able to receive input with an integrated button, record audio clips using an integrated mic, and display the resulting classification in seconds with an integrated LCD screen. This is all housed neatly in a 3D printed case.

Table of Contents

Hardware

Beaglebone Black

  • The Beagle Bone Black (BBB) was utilized as this projects embedded platform.

Tactile Button

  • A tactile button was integrated for user input.
  • Pins used for Button:
    • Button Data = P8[17]
    • Button 3V = P9[3]
    • Button GND = P9[1]

Microphone

  • A microphone was integrated for audio input.

LCD Screen

  • A 1602A LCD screen was integrated for user output.
  • Pins used for LCD:
    • LCD Data = P8[12, 14, 16, 18]
    • LCD 5V = P9[8]
    • LCD GND = P9[2]

3D Printed Parts

  • A 3D Printed case was made to house the components
  • A 3D Printed bridge was made to support the button

Post Wiring

  • This is the result of soldering all the components and wiring them to the BBB

Software

  • The main program, main.py, connects to the USB mic and prompts the user to press the button to start recording.
  • When the button is pressed, an audio stream is opened up and the user is prompted to press the button to stop recording.
  • The program will record audio samples into a buffer until the button is pressed.
  • After the button is pressed a second time, the file is:
    • filtered
    • processed
    • converted to a .wav file
    • passed into the Support Vector Machine model
  • The resulting instruments are displayed on the LCD screen.

Built With

  • Adafruit Char LCD - this is used to interface with the 1602A LCD screen
  • Adafruit BBIO - this is used to interface with the Beaglebone Black's GPIO pins
  • PyAudio - this is used to handle our audio I/O
  • DateTime - this is used to add dates and times to recorded audio file's names
  • Wave - this is used for audio file processing, setting sample rates, setting channels, and setting sample size
  • Pickle - this is used to convert the Machine Learning model into a byte stream to be saved to disk
  • LibROSA - this is used for audio analysis, trimming, onset detection, and collecting the Mel-frequency Cepstrum Coefficients (MFCC)
  • NumPy - this is used for manipulating the MFCC values
  • Scikit Learn - this is used for the Support Vector Machine supervised learning model for classification of musical instruments
  • 1602A LCD Case - this was used to house the hardware
  • Button Bridge - this was used to hol up the button inside the case

Authors

  • Daniel Salazar

    • Hardware Analysis, Integration, and Soldering
    • 3D Printing
    • LCD Software
    • Machine Learning model selection, analysis, and training/testing
  • Thomas Martin

    • Mic Software
    • Audio Preprocess Software
    • Button Software
    • Conversion of Machine Learning model to the embedded version and training/testing

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to Adafruit for providing the hardware driver code
  • Thanks to Rodger Doering for his insight into the intricacies of Digital Signal Processing.
  • Thanks to Inés Thiebaut for her insight into Musical Instrument Classification.

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 93.9%
  • Python 6.1%