vhaudiosynth

VHSynth

Application: vhaudiosynth Author: Viktor Glebov / V01G04A81 rev: 0.0.1 Draft / Initial 2019-2022

vhaudiosynth is an experimental native C++ real-time software synthesizer focused on low-level audio processing, instrument synthesis, signal routing, effects, MIDI input and real-time visualization.

The project is implemented as a modular C++ application rather than a single synthesizer demo. Its source tree contains separate subsystems for audio buffers, channels, signal sources, instruments, effects, MIDI, runtime services, mathematical processing, audio drivers, GUI/window management and oscilloscope visualization.

The project is currently at revision 0.1 and should be considered an experimental / development-stage software synthesizer.


Features


16-bit Audio synth module

vhaudiosynth — native C++ real-time audio synthesis experiment.

img


Repository

Source code:

https://github.com/vigatron/vhaudiosynth.git


The keyboard can be used as a virtual musical keyboard.

Keyboard mapping

Key Function
Q 2 W 3 E R 5 T 6 Y 7 U Upper octave
Z S X D C V G B H N J M Standard octave

+ Select next instrument - Select previous instrument

1 2 3 4 5 6 7 8 9 10 11 12 13
C C+ D D+ E F F+ G G+ A A+ B C+
q 2 w 3 e r 5 t 6 y 7 u i

Architecture

vhaudiosynth is organized into several functional subsystems.

vhaudiosynth
│
├── Audio / DSP
│   ├── abuffer
│   ├── channel
│   ├── sigsrc
│   ├── math
│   └── effects
│
├── Instruments
│   └── instruments
│
├── Control
│   └── midi
│
├── Runtime
│   └── runtime
│
├── Hardware / Audio I/O
│   └── driver
│
├── User Interface
│   └── wnd
│
├── Visualization
│   └── osciloscope
│
└── File / Resource Handling
    └── fsys

This separation is important because it indicates that the project is structured around an audio-processing pipeline rather than around a monolithic application loop.

At the build-system level, the project explicitly collects source files from these subsystems and links them into the final vhaudiosynth executable.


Audio Processing Model

The project separates several concepts that are normally found in a real-time audio engine:

This allows an instrument to be treated as a signal-generation component while subsequent processing can operate on audio buffers and channels.

A simplified conceptual signal path can be represented as:

Keyboard / MIDI
      │
      ▼
   Instrument
      │
      ▼
 Signal Source
      │
      ▼
 Audio Buffer
      │
      ▼
   Channel
      │
      ▼
   Effects
      │
      ▼
 Audio Driver
      │
      ├──────────────► Speaker / Output
      │
      └──────────────► Oscilloscope

The exact signal-routing semantics depend on the implementation of the individual classes and modules.


Technology

Component Technology
Language C++14
Build CMake
GUI SDL2
Font rendering SDL2_ttf
Threading POSIX pthread
Audio ALSA
License GPL-3.0

The project currently targets a native Linux-style environment. The build configuration explicitly searches for SDL2 and pthread and links against ALSA and SDL2_ttf.


Notes

TODO: Fix buffer for audio over bluetooth

How to build application

Use CMake to build application
    $ mkdir build       ; Create build folder
    $ cd build          ; Change directory
    $ cmake ..          ; Run CMake
    $ make              ; Build application
    $ ./vhaudiosynth    ; Run application

Building

Dependencies

Install: SDL2 with SDL2 Fonts

On Debian / Ubuntu-based systems:

sudo apt install \
    cmake \
    build-essential \
    libsdl2-dev \
    libsdl2-ttf-dev \
    libasound2-dev

Build

Clone the repository:

git clone https://github.com/vigatron/vhaudiosynth.git
cd vhaudiosynth

Create a build directory:

mkdir build
cd build

Configure the project:

cmake ..

Build:

make

Run:

./vhaudiosynth

Project Status

vhaudiosynth is an experimental project rather than a finished commercial synthesizer.

The current repository describes the software as revision 0.1. The codebase contains a number of distinct audio-engine subsystems, but the public documentation is intentionally minimal and does not currently provide a complete specification of every instrument, DSP algorithm, audio format or routing mechanism.

One documented issue concerns audio buffering when using Bluetooth audio devices:

TODO: Fix buffer for audio over bluetooth

Therefore, the project should be regarded primarily as an engineering / development project and an experimental real-time audio platform.


Design Goals

The architecture suggests several major design goals:

  1. Native real-time processing

    Audio processing is implemented directly in C++ rather than being delegated entirely to an external synthesizer framework.

  2. Modular DSP

    Instruments, signal sources, buffers, channels and effects are represented as separate subsystems.

  3. Interactive control

    Keyboard and MIDI-oriented input provide real-time control of the synthesis engine.

  4. Visualization

    The presence of a dedicated oscilloscope subsystem indicates that audio signals can be inspected while the synthesizer is running.

  5. Extensibility

    The separation of instruments and effects makes it possible to extend the synthesizer without redesigning the entire application.


Development Notes

VHSynth is best viewed as a software audio-engine experiment.

It is particularly useful as a codebase for studying:

It is not intended to compete feature-for-feature with mature production synthesizers or DAWs.


Math / Technical Details

SINTBL 1/4 table:

uint16_t sintbl[1024];  // unsigned 16-bit array for angles [0..89] / [0..1023]

FULLTSIN class FULLTCOS class FULLRSIN class FULLRCOS class

uint16_t sinval(uint16_t angle)

License

VHSynth is released under the GNU General Public License v3.0.

See LICENSE for the complete license text.

(C) 2019-2022 Viktor Glebov / V01G04A81 / Initial Draft rev 0.0.1