A digital sound synthesizer platform on FPGA and associated full-stack toolchain written in VHDL, C, Python and NodeJS. The system is implemented on the Altera Cyclone V FPGA fabric of the Terasic DE1-SoC development kit board.
The project includes the softcore system design and control software, Python meta-scripts for scalable and configurable generation of its VHDL code, a compact low-level music abstraction library in C to represent a subset of the MIDI protocol as composable macros, and a MIDI file parser written in NodeJS to translate existing MIDI files to the C representation.
The technical report can be found in report/AlexandreChau_LoicDroz_FPGASoundSynthesizer.pdf
The demo video and slides can be found at the following Google Docs link: https://go.epfl.ch/fpga-sound-synthesizer-slides
The current softcore design includes 16 oscillators (allowing up to 16-voices polyphony), each able to generate sawtooth, square or triangle waves for the note range A0 (27.5 Hz) to C8 (4186 Hz) by digitally computing real-time pulse-code modulation samples at a rate of 96 KHz and 32-bit depth. The sound generation unit interprets a subset of the MIDI protocol through messages on an Avalon bus, sent by a softcore NIOS II processor. The system offers playback, volume and tone selection controls through the physical switches and buttons of the board, and provides real-time visual feedback by implementing a VU-meter approximation on the LEDs.
src/hw/de1soc_sound_synthesizer.qpf
project file with Quartussrc/hw/quartus/pin_assignment_DE1_SoC.tcl
script through Tools > Tcl scriptssrc/hw/output_files/de1soc_sound_synthesizer.sof
, check the "Program/Configure" box and hit "Start", which should program the DE1-SoC Altera Cyclone V FPGA core with the softcore designsrc/sw/nios/application
and name it fpga_sound_synthesizer
.src/sw/nios/fpga_sound_synthesizer_bsp
and name fpga_sound_synthesizer_bsp
fpga_sound_synthesizer_bsp
project and hit Nios II > Generate BSP. Then, Build All projects again.src/sw/nios/application/music.h
by replacing the pieces
array and includes above with the code snippets in other music header files.src/hw/hdl
.src/hw/hdl/sound_gen.py
file to your liking (make sure to read the technical report for the specification).make
in the src/hw/hdl
folder. The VHDL files should now be freshly regenerated and ready to be compiled.midi-parser/
npm install
(only once) to fetch the required dependenciesnode parse <MIDI file path> <C variable name> [Transpose shift (ex. -1)] [Duration scaling factor (ex: 0.8)]
. Make sure to read the technical report for limitations and advanced usage..h
file in the midi-parser
folder, which can be included in src/sw/nios/application/music.h
.This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for more information.
FPGA sound synthesizer
Copyright (C) 2020 Alexandre CHAU, Loïc DROZ
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.