Project Name : Acoustic Drum Machine


Project Functional Description :

The Acoustic Drum Machine (ADM) is intended to be an additional learning tool for drum beginners and has the functionality to potentially replace a drummer in studio settings and during practices, in the unfortunate event that a drummer could not show up to a session. The ADM is a machine that is connected to servo motors attached to a drumstick, that is put on top of an adjustable stand. To control the machine, allong with the user interface, memory, motors, file input and execute other tasks of the ADM, a STM32 Microcontroller will be used to communicate to different components.


Power Specifications

The ADM requires power to LCD Display, multiple servo motors, and a microcontroller to run the program. Due to these bulky requirements, the ADM will be wall powered through a 110/220V AC source. This will be connected using a pre-built AC adapter, which will convert the AC power to 12V DC / 16.7A. This voltage level will supply power to the servo motors From the 12V supply, there will be a buck converter that will step down the voltage to 5V / 2.6A to set the high side of the logic level shifter. This logic level shifter is nececary to translate the 3.3V signals of the microcontroller to the 5V control signal accepting servo motors. From the 5V supply there will be a voltage step-down regulator to bring the voltage to 3.3V with 2A of current. This will be used to power the microcontroller, LCD, and USB-UART IC As for the thermal considerations, the motor's power components will be placed in one corner with the power supply coming in from another corner, the servos will be detached from the PCB, placed on standsabove each drum part. and the microcontroller will have some distance from all of these parts. The usage of heat sinks, along with PCB packaging accounting for continuous airflow should mitigate overheating issues caused by the motors and buck converters.


USB driver

The ADM is intended to take in two types of music files: a MIDI file and a user input. The MIDI file is a preprocessed file the user downloads and inputs into their computer. The computer will communicate it to the microcontroller via the USB driver and UART interface. The user input file is a music file that the user can generate using the 4x4 matrix keypad, another feature of the ADM.


LCD Display

All files will be displayed onto an LCD display, communicating via SPI interface with the microcontroller. These files will be represented in "grid patterns" and will be a user-friendly interface to display the music sheet. On the X-axis of the grid, the beat or time division of the rhythm is organized over time. On the Y-axis of the grid, the different instruments are organized. Each entry determines if a certain instrument is played, and each block determines if that instrument is being played at a certain time step in the rhythm. A BPM and music dynamic will also be displayed on the top left corner of the program to indicate for how fast and how strong the notes will be hit. To further assist the explanation, a figure has been attached below.

Figure1
Figure 1 : Beat editor in FL Studio

Along with these features, the LCD display will accompany for the different modes set by the software program. These modes and how they will be displayed onto the LCD screen are as followed:

  • Loading mode: A pre-organized beat, retrieved from a MIDI file the user has downloaded
    • When this mode is selected, the microcontroller will access the file from the computer connected via USB
    • The microcontroller will start the preprocessing procedure, and retrieve information for only the drum parts
    • The information, will then be displayed in a grid pattern onto the LCD display
  • Beat editing mode: An empty grid pattern, in which beats can be selected by the user to play
    • When this mode is selected, the microcontroller creates an empty grid for the user
    • The user can select each block/beat and toggle it to play or keep it silent
  • Playing mode: Play the grid pattern that is displayed on the screen
Motors

For the physical task of striking the percussion, different servo motors will be set on adjustable stands, each attached with one drumstick, and will be responsible for striking the assigned piece. These motors will communicate to the microcontroller via UART interface. Due to cost of production and overloading of the microcontroller, there will only be one drumstick per part, which could potentially lead to a reduced learning experience with the diversity of having two drumsticks per part. An example mechanical design of these motors are shown in the figure below.

Figure2
Figure 2 : Mechanical Design of the ADM Stands

Keypad

To input onto the display during the editing mode, the user can do so by utilizing the keypad. The keypad will be connected to the microcontroller via GPIO pins and will use matrix communication and debouncing to communicate with the microcontroller. Each button in the keypad will serve a different purpose, with 13 keys reserved to be able to perform a different task. For the purpose and time constraints of this project, there will be at most four keys that will be assigned to a drum, with the objective to have at least two different drum parts to be able to be controlled. The following demonstrates an example of the functionalities of each key:

  • Keys 1 through 4 will be reserved to control the different servo motors that will strike the drum parts
  • Keys 8 and 9 will control the speed of the piece
  • Keys A and B will control the intensity of the hits
  • Keys 7 and C will traverse through the beat editor
  • Key * will pause the play mode and go back to editing
  • Key # will confirm selection and turn on play mode
  • Key 0 will reset the beat editor
The following is an example mapping of each button:
  • Key 1 = Snare Drum #1
  • Key 2 = Snare Drum #2
  • Key 3 = Tom Drum #1
  • Key 4 = Crash Cymbal #1
  • Key 9 = Lower BPM
  • Key 8 = Increase BPM
  • Key A = Weaker Hit
  • Key B = Stronger Hit
  • Key 7 = Go Left
  • Key C = Go Right
  • Key * = Edit
  • Key # = Play
  • Key 0 = Reset
Software Program

The software program will be responsible for pre-processing MIDI files, to only obtain the necessary information. It will also be responsible for the interactive toggling of the blocks. Additionally, it will be responsible for traversing through the different modes and performing the functionalites of each mode as previously described in the display section. Below the functional diagram of the project is attached to provide a brief overview of the ADM:

Figure3
Figure 3 : Functional Block Diagram of ADM

Additional Features

There are some features of the project not adequately expressed by our PSDRs and others which we plan to do if we have time. The main features not fully represented by our PSDRs are the interface between the microcontroller and a matrix keypad with software debouncing, the creation of a stand to stably hold each drumstick, the use of feedback in motor control to keep it stable and the ease of use with any drum set. One additional feature under consideration is the ability to control the playing speed by adjusting the beats per minute. This would act as a zoom function on the GUI such that the user can determine what time scale each beat is associated with. Another additional feature under consideration is the ability to play 4 drums instead of just 2. The potential for this will be integrated into the PCB design by adding extra ports for the motors and managing the power and the software will be integrated later in the semester if time permits. Another additional feature that is being considered is the ability to rotate the upper part of a stand to account for the hitting of different parts of the drums. This will be included with the usage of rotary actuators that will be attached to the middle of the stand, which will allow for the upper part to rotate freely to hit any part of the top of the drum, rather than just the center, to increase the range of produceable sound.


  • KICAD Schematics
  • KICAD PCB Layout
  • Project Specific Design Requirements (PSDRs):

    • PSDR #1 (Hardware): An ability for the microcontroller to communicate with the LCD display through the SPI interface
    • PSDR #2 (Hardware): An ability for the microcontroller to control two servo motors through the serial - half duplex UART interface
    • PSDR #3 (Hardware): An ability for the microcontroller to communicate with a USB driver through the UART interface
    • PSDR #4 (Software): An ability to provide a graphical user interface of the user inputs through the software program
    • PSDR #5 (Software): An ability to preprocess MIDI files such that the drum portion can be uploaded to the microcontroller and further processed into a format of beats that can be used to decide when to swing the drumsticks
    • Stretch #1 (Software): An ability to control the playing speed of the ADM by adjusting the BPM
    • Stretch #2 (Hardware): An ability to convert a 12V DC input into a 3.3V output to supply the microcontroller