Table of Contents
- Audio Synth #1 - The project
- Audio Synth #2 - Board introduction and IDE setup
- Audio Synth #3 - Arduino to CmodS7 COMM Test
- Audio Synth #4 - Use PWM to control LED
- Audio Synth #5 - Testing the I2S PCM5102 DAC Decoder Board
- Audio Synth #6 - Sound generation with CmodS7
- Audio Synth #7 - Design challenge ends, project continues
===========================================================
Introduction
A quick online search reveals a number of audio processors and synthesizer designs (both academic and commercial) that use FPGAs for sound generation and audio processing. While some of these projects are open source, the vast majority lack in documentation or come with licenses that are not very permissive.
Presentation
The purpose of this project is the development of a test bench and a collection of Verilog modules for a FPGA-based, musical synthesizer that uses subtractive synthesis for sound generation.
Subtractive synthesis is a classic method of synthesizing musical sounds. The idea is that a waveform with lots of harmonic content is processed using filters that subtract unwanted frequencies.
The signal path for a simple subtractive synth consists of an audio oscillator, a filter and an amplifier. The audio oscillator can generate sine waves, saw waves, square waves or other forms of waves with different harmonic components. To create more interesting sounds, low frequency oscillators are used as modulation sources. The amplitude of the signals can be controlled with amplitude shapers. Signals can be mixed or further processed in dedicated blocks along signal paths.
The next figure depicts the block diagram of a synth that uses an Arduino board for implementing functionality related to user interface and controls and a Cmod S7 board for audio generation and processing.
Objective
The object of the project that makes the subject of this blog is not the development of the synthesizer itself but rather the implementation of a test bench environment and a collection of general, reusable Verilog modules that would facilitate the development of such a synthesizer. Although I will be touching at times on the communication between Arduino and Cmod S7, this blog will be focused on my experience developing Verilog code using Cmod S7.
Because I don’t have significant experience in implementing designs using Verilog, an important item for me to investigate is the benchmarking of the Cmod S7 board. In simpler terms this can be rephrased as: “I would like to find out if Cmod S7 is suitable for this specific audio application or if a more powerful board (in terms of FPGA, RAM memory, etc.) is needed”.
The project is developed on two platforms (Arduino and Verilog), so another item to consider in the long run are system configuration tools (graphical or text-based) that would allow dynamic configuration and inter-connection of Arduino with Verilog modules both at compile and run time.
Design Principles
Since I have limited practical digital design experience and I will be working in “exploratory mode”, I am going to list here a few guiding principles:
- all UIs and user controls are implemented on Arduino
- Cmod S7 is responsible for all audio generation and processing
- audio signal blocks (oscillators, filters, LFOs, mixers, amplitude shapers, audio processing blocks) are implemented in Verilog
- each synth block is controlled by an Arduino module that can set, change or modify synth block parameters
- all Arduino development is done (if possible!) using Arduino IDE rather than embedded C
In the course of the project, based on my acquired experience, I will revisit the Design Principles section to update and comment.
Note1:
There is a XADC core within the Spartan-7 which is a dual-channel 12-bit analog-to-digital converter capable of operating at 1 MSPS. In theory, this A/D converter could be used to read values of parameters from potentiometers (in conjunction with a simple mux logic with inputs from potentiometers driven from the FPGA). The FPGA could also be used to display parameter values on LED displays (one digit 7 segments), in which case there is no need for Arduino. This might work for simple designs (e.g. square wave PWM tone generation), and I will take the time to look into it.
Changelog:
01/30/2022 - added Note1