An automatic melody-to-model music box generator
VoxBox AUTO is a C Group Project Extension in First Year Computing at Imperial College London. The project ran from May to June 2026. The project takes a user's sung or played melody and automatically generates a 3D-printable music box mechanism to play that exact tune.
As an independent extension (not using any pre-provided code from the department), this repository contains the pipeline: frontend, conversion, and modelling.
Award: Selected as a group of top 12 extensions to present at Imperial College London Open Days and to Arm Holdings.
Ordered in alphabetical order by last name
- Bert Chun Chang (lead)
- Isaac Chi
- Wania Siddiqui
- Derek Wen
├── Makefile // Build rules for compilation
├── conversion.c // Sample conversion routines used by pipeline
├── conversion.h // Header for conversion.c
├── dywapitchtrack.c // Pitch tracking implementation
├── dywapitchtrack.h // Header for dywapitchtrack.c
├── frontend.py // Logic for Python frontend
├── metronome.c // Logic for timing/metronome
├── metronome.h // Header for metronome.c
├── savefile.c // Functions to write out .wav file
├── savefile.h // Header for savefile.c
├── stl_generator.c // Generates STL file with input CSV file
├── stl_generator.h // Header for stl_generator.c
├── tempo.c // Logic for changing the recording tempo
├── tempo.h // Header for tempo.c
├── tinywav.c // Utilises tinywav library to read .wav files
├── tinywav.h // Header for tinywav.c
└── voxbox_auto.py // Describes the UI for the Python frontend
Our pipeline is broken down into several modular components spanning audio capture, signal processing, and 3D generation:
- PyQt5 application to record user input melodies.
- Stores the captured microphone data as a
.wavfile. - Converts the
.wavfile into a.csvfile (note,angle), utilising C libraries (see below). - Uses vector arithmetic to convert the
.csvfile into a.stlmusic box cylinder model. - Logic linking the
.stlfile with the 3D printing software. - Designing the hardware and music box mechanism.
Note that you need a 3D printer using BambuLab to print the model.
- Clone the repository.
- Run
voxbox_auto.py.
During VoxBox AUTO development, we used the Git services on the GitLab website provided by Imperial College London. As a result, the commit history is not detailed on GitHub.
This project uses the following open-source libraries for audio processing:
- dywapitchtrack (Antoine Schmitt)
- Real-time dynamic wavelet algorithm (dywa) pitch tracking to determine note frequencies.
- Distributed under the MIT License.
- TinyWav (Martin Roth)
- Reading and writing
.wavaudio files directly from and to memory. - Distributed under the ISC License.
- Reading and writing