Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth.

Overview

HexoDSP - Comprehensive DSP graph and synthesis library for developing a modular synthesizer in Rust, such as HexoSynth.

This project contains the complete DSP backend of the modular synthesizer HexoSynth.

It's aimed to provide a toolkit for everyone who wants to develop a synthesizer in Rust. You can use it to quickly define a DSP graph that you can change at runtime. It comes with a large collection of already developed DSP modules/nodes, such as oscillators, filters, amplifiers, envelopes and sequencers.

The DSP graph API also provides multiple kinds of feedback to track what the signals in the DSP threads look like. From monitoring the inputs and outputs of single nodes to get the current output value of all nodes.

Here a short list of features:

  • Runtime changeable DSP graph
  • Serialization and loading of the DSP graph and the parameters
  • Full monitoring and feedback introspection into the running DSP graph
  • Provides a wide variety of modules
  • Extensible framework for quickly developing new nodes at compile time
  • A comprehensive automated test suite

API Examples

Documentation

The development documentation with all private fields and functions can be found separately hosted: HexoDSP API Developer Documentation.

Raw NodeConfigurator API

This API is the most low level API provided by HexoDSP. It shows how to create nodes and connect them. The execution of the nodes in the audio thread is controlled by a NodeProg, which defines the order the nodes are executed in.

This only showcases the non-realtime generation of audio samples. For a real time application of this library please refer to the examples that come with this library.

use hexodsp::*;

let (mut node_conf, mut node_exec) = new_node_engine();

node_conf.create_node(NodeId::Sin(0));
node_conf.create_node(NodeId::Amp(0));

let mut prog = node_conf.rebuild_node_ports();

node_conf.add_prog_node(&mut prog, &NodeId::Sin(0));
node_conf.add_prog_node(&mut prog, &NodeId::Amp(0));

node_conf.set_prog_node_exec_connection(
    &mut prog,
    (NodeId::Amp(0), NodeId::Amp(0).inp("inp").unwrap()),
    (NodeId::Sin(0), NodeId::Sin(0).out("sig").unwrap()));

node_conf.upload_prog(prog, true);

let (out_l, out_r) = node_exec.test_run(0.1, false);

Hexagonal Matrix API

This is a short overview of the API provided by the hexagonal Matrix API, which is the primary API used inside HexoSynth.

This only showcases the non-realtime generation of audio samples. For a real time application of this library please refer to the examples that come with this library.

use hexodsp::*;

let (node_conf, mut node_exec) = new_node_engine();
let mut matrix = Matrix::new(node_conf, 3, 3);


let sin = NodeId::Sin(0);
let amp = NodeId::Amp(0);
matrix.place(0, 0, Cell::empty(sin)
                   .out(None, None, sin.out("sig")));
matrix.place(0, 1, Cell::empty(amp)
                   .input(amp.inp("inp"), None, None));
matrix.sync().unwrap();

let gain_p = amp.inp_param("gain").unwrap();
matrix.set_param(gain_p, SAtom::param(0.25));

let (out_l, out_r) = node_exec.test_run(0.11, true);
// out_l and out_r contain two channels of audio
// samples now.

State of Development

As of 2021-05-18: The architecture and it's functionality have been mostly feature complete by now. The only part that is still lacking is the collection of modules/nodes, this is the area of current development. Adding lots of nodes.

Make sure to follow Weird Constructors Mastodon account or the releases of this project to be notified of updates.

Road Map / TODO List

I have a pretty detailed TODO list in my private notebook.

Running the Jack Example:

You need nightly rust:

rustup toolchain install nightly

To run the example:

cargo +nightly run --release --example jack_demo

You might need following dependencies (Ubuntu Linux):

sudo apt install libjack0 libjack-jackd2-dev qjackctl

These might work on Debian too:

sudo apt install libjack0 libjack-dev

Running the Automated Testsuite:

There exists an automate test suite for the DSP and backend code:

cargo test

Known Bugs

  • The ones you encounter and create as issues on GitHub.

Contributions

I currently have a quite precise vision of what I want to achieve and my goal is to make music with this project eventually.

The projects is still young, and I currently don't have that much time to devote for project coordination. So please don't be offended if your issue rots in the GitHub issue tracker, or your pull requests is left dangling around for ages.

I might merge pull requests if I find the time and think that the contributions are in line with my vision.

Please bear in mind, that I can only accept contributions under the License of this project (AGPLv3 or later).

Contact the Author

You can reach me via Discord or Mastodon. I'm joined most public Rust Discord servers, especially the "Rust Audio" Discord server. I am also sometimes on freenode.net, for instance in the #lad channel (nick weirdctr).

Support Development

You can support me (and the development of this project) via Liberapay:

Donate using Liberapay

License

This project is licensed under the GNU Affero General Public License Version 3 or later.

Why (A)GPL?

The obivious reason is that this project copied and translated code from many other free software / open source synthesis projects. The sources will show the origin and license of the individual parts.

My Reasons

Picking a license for my code bothered me for a long time. I read many discussions about this topic. Read the license explanations. And discussed this matter with other developers.

First about why I write code for free at all, the reasons are:

  • It's my passion to write computer programs. In my free time I can write the code I want, when I want and the way I want. I can freely allocate my time and freely choose the projects I want to work on.
  • To help a friend or member of my family.
  • To solve a problem I have.
  • To learn something new.

Those are the reasons why I write code for free. Now the reasons why I publish the code, when I could as well keep it to myself:

  • So that it may bring value to users and the free software community.
  • Show my work as an artist.
  • To get into contact with other developers.
  • To exchange knowledge and help other developers.
  • And it's a nice change to put some more polish on my private projects.

Most of those reasons don't yet justify (A)GPL. The main point of the (A)GPL, as far as I understand: The (A)GPL makes sure the software stays free software until eternity. That the end user of the software always stays in control. That the users have the means to adapt the software to new platforms or use cases. Even if the original authors don't maintain the software anymore. It ultimately prevents "vendor lock in". I really dislike vendor lock in, especially as developer. Especially as developer I want and need to stay in control of the computers and software I use.

Another point is, that my work (and the work of any other developer) has a value. If I give away my work without any strings attached, I effectively work for free. This compromises the price I (and potentially other developers) can demand for the skill, workforce and time.

This makes two reasons for me to choose the (A)GPL:

  1. I do not want to support vendor lock in scenarios for free. I want to prevent those when I have a choice, when I invest my private time to bring value to the end users.
  2. I don't want to low ball my own (and other developer's) wage and prices by giving away the work I spent my scarce private time on with no strings attached. I do not want companies to be able to use it in closed source projects to drive a vendor lock in scenario.

We can discuss relicensing of my code or project if you are interested in using it in a closed source project. Bear in mind, that I can only relicense the parts of the project I wrote. If the project contains GPL code from other projects and authors, I can't relicense it.

License: AGPL-3.0-or-later

You might also like...
Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously

Omeglib, a portmanteau of "omegle" and "library", is a crate for interacting with omegle, simply and asynchronously. It is intended to suit one's every requirement regarding chat on omegle.

A tool and library to losslessly join multiple .mp4 files shot with same camera and settings

mp4-merge A tool and library to losslessly join multiple .mp4 files shot with same camera and settings. This is useful to merge multiple files that ar

Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.
Rust library for hardware accelerated drawing of 2D shapes, images, and text, with an easy to use API.

Speedy2D Hardware-accelerated drawing of shapes, images, and text, with an easy to use API. Speedy2D aims to be: The simplest Rust API for creating a

A library for transcoding between bytes in Astro Notation Format and Native Rust data types.

Rust Astro Notation A library for transcoding between hexadecimal strings in Astro Notation Format and Native Rust data types. Usage In your Cargo.tom

A rust library that provides pseudo-reflection for structs and enums

Treeflection treeflection_derive Treeflection runs a command stored as a string on a tree of structs, collections and primitive types. Commands A comm

A simple thread schedule and priority library for rust

thread-priority A simple library to control thread schedule policies and thread priority. If your operating system isn't yet supported, please, create

Library and proc macro to analyze memory usage of data structures in rust.
Library and proc macro to analyze memory usage of data structures in rust.

Allocative: memory profiler for Rust This crate implements a lightweight memory profiler which allows object traversal and memory size introspection.

An actors library for Rust and Tokio designed to work with async / await message handlers out of the box.

Akt An actors framework for Rust and Tokio. It is heavily inspired by Actix and right now it has very similar look and feel. The main difference is th

Rust library for scheduling, managing resources, and running DAGs 🌙

🌙 moongraph 📈 moongraph is a Rust library for scheduling, managing resources, and running directed acyclic graphs. In moongraph, graph nodes are nor

Owner
Weird Constructor
Software dev with 20+ years of experience in: Linux, Windows, networking, interpreters/compilers, games, GUIs, C/C++, Rust, Scheme/Lisp, and more.
Weird Constructor
Master Rust programming with this comprehensive roadmap

?? Master Rust programming with this comprehensive roadmap! Explore fundamental and advanced concepts, code examples, and resources.

Byansi Anthony 6 Oct 11, 2023
Rust Library for controlling divoom devices that support REST APIs, such as pixoo-64.

Divoom Rust Library for controlling divoom devices that support REST APIs, such as pixoo-64 (and from how divoom's api/doc organizes, maybe more in th

Riff 16 Dec 23, 2022
High Assurance Rust - A free book about developing secure and robust systems software.

High Assurance Rust - A free book about developing secure and robust systems software.

Tiemoko Ballo 1.1k Jan 9, 2023
A project for developing Rust applications

rust_dev This is a project for developing Rust applications. The goal of this project is to provide a solid foundation for building robust and scalabl

Harsh agarwal 4 Feb 7, 2023
🔀 Rusty flow graph processing library

flowing flowing is a flow graph processing library written in Rust. It shall serve as a general-purpose building block for all kinds of dataflow progr

Micha Hanselmann 2 Oct 4, 2022
An RPC framework developing tutorial

Mini Lust 系列教程 好奇如何从零造出来一个 RPC 框架?本教程将带你一步一步写出来一个 Rust 版 Thrift RPC 框架。 教程说明 从第二章开始每章节都会附带代码。 这个代码是在上一章节的基础上写的,文档里一般会告诉你增加了哪些东西,但是如果你想详细地对比到底哪里变动了,可以自

null 454 Dec 30, 2022
Manas project aims to create a modular framework and ecosystem to create robust storage servers adhering to Solid protocol in rust.

मनस् | Manas Solid is a web native protocol to enable interoperable, read-write, collaborative, and decentralized web, truer to web's original vision.

Manomayam 17 Oct 5, 2023
A modular implementation of timely dataflow in Rust

Timely Dataflow Timely dataflow is a low-latency cyclic dataflow computational model, introduced in the paper Naiad: a timely dataflow system. This pr

Timely Dataflow 2.7k Dec 30, 2022
bare-bones "reactive programming" (change propogation) using a central data dependency graph

mini-rx: Tiny reactive programming change propagation a la scala.rx Cargo documentation Example use mini_rx::*; fn example() { // setup let side_ef

Jakob Hain 5 Jul 31, 2022
Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Rust 标准库中文版 这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust。 如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中

wtklbm 493 Jan 4, 2023