GithubHelp home page GithubHelp logo

vulcu / dahlia Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 458 KB

Waveshaping Polyphonic Synthesis for the Heavy Compiler Collection

License: GNU General Public License v3.0

Shell 100.00%
audio-synthesizer daisy-seed dpf hvcc puredata waveshaper webaudio

dahlia's Introduction

User Interface

Dahlia - Waveshaping Synthesis for HVCC

Dahlia is an implementation of the Waveshape-Synth polyphonic synthesizer written in PureData and intended for use with the Heavy Compiler Collection. Possible applications include the Daisy Audio Platform (using pd2dsy), the Distrho Plugin Framework, and Javascript (using WebAudio).

Table of Contents

General Info

The original Waveshape-Synth is an 8-voice polyphonic audio synthesizer with per-voice oscillator waveshaping created as a collection of Pure Data subpatches. It was inspired by wavedist and uses the same waveshaping algorithms. Dahlia is an evolution of this concept, refactored to work with HVCC and capable of a simplified control scheme accomodating the limited Daisy Pod UI. Dahlia can also be used directly from within Pure Data, see main_puredata.pd for an example.

The synthesizer itself relies on a handful of waveshaping algorithms to produce differing kinds of overdrive and distortion from the oscillators of each synthesizer voice, and then applies an ADS-envelope low-pass filter to each voice on an individual basis. The harmonic ratios and the balance between even and odd harmonics varies by algorithm, with some sounding better than others for certain oscillator and envelope combinations. There's no hard-and-fast rules here, so just use your ears.

The goal of this project is to provide a quick and simple way for a user to dial in rich, complex synth sounds without needing to know much about synthesizers. Unlike the wavedist plugin, all the waveshapers are active at once here, allowing for some truly wild harmonic ratios.

Features

  • Monophonic (1 Voice) and Polyphonic (8-voices)
    • Polyphonic version easily adaptable to N number of voices based on system resources
    • Monophonic version has midi-adjustable portamento control
    • Lightweight |miniphonic| monophonic voice for resource-constrained applications
  • 7 Oscillators, 1 ADSR, and 2 ADS envelopes per-voice
  • Oscillators selectable between Sine, Saw, and a PWM with a 5%-50% automatable duty-cycle
  • 6 different waveshaping algorithms and a Gain control
  • Unison control (oscillator de-tune)
  • Bit depth control/crush range of 1-12 bits

To Do

  • Pre-development planning
  • General
    • Refactor PD source for HVCC compatibility
    • Update docs with details of UI functions/feedback
    • Include separate install/build documentation for each Dahlia target
  • Daisy
    • Refactor main_daisy.pd to target Daisy build
    • Redesign UI for Daisy Pod
      • Daisy Pod UI simulator
    • Build scripts targeting Daisy (HVCC and pd2dsy)
    • Design a new voice for the Daisy platform with lower complexity
  • Distrho Plugin Framework
    • Refactor main_dpf.pd to target a DPF build
    • Build script targeting DPF (HVCC)
  • Javascript
    • Refactor main_js.pd to target a Javascript/WebAudio build
    • Build script targeting Javascript/WebAudio (HVCC)

Status: Project feature development is on hiatus, but it is actively maintained.


(C) 2021-2023, Winry R. Litwa-Vulcu

dahlia's People

Contributors

reiniiriarios avatar vulcu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

dahlia's Issues

Javascript/WebAudio generation requires editing HVCC python source

Note: this may not be true for all systems/OS, but is true on Windows under the following conditions:

  1. HVCC is run in a virtual environment. The virtual environment is dedicated to the Dahlia project only, and only contains HVCC and its dependent packages.
  2. Only a single Python instance is installed on the system. The PATH contains only a single .../Python/Python<ver> and .../Python/Python<ver>/Scripts directory entry.
  3. The system Python version is 3.12

If HVCC returns Error c2js: [WinError 193] %1 is not a valid Win32 application when running source ./dahlia.sh js, the existing documentation suggests a hotfix by opening the Python script c2js.py located in dahlia/.venv/Lib/site-packages/hvcc/generators/c2js/. Find the three instances where subprocess.check_output() is called in that script, and append shell=True as a second argument to all of those calls. Example:

# First instance, around Line 101 in HVCC v0.9
subprocess.check_output(cmd, shell=True)

# Second instance, around Line 108 in HVCC v0.9
subprocess.check_output(cmd, shell=True)

# First instance, around Line 140 in HVCC v0.9
subprocess.check_output(  # WASM
    cmd + [  # type: ignore
        "-s", "WASM=1",
        "-s", f"EXPORT_NAME='{output_name}_Module'",
        "-o", wasm_js_path
    ], shell=True)

It may be possible to debug the issue further by adding a traceback call in an except block following the first call to subprocess.check_output(), as follows:

# First call to 'subprocess.check_output()', around Line 101 in HVCC v0.9
try:
    subprocess.check_output(cmd)  # run emscripten
except Exception:
    print(traceback.format_exc())
    return

HVCC-generated user interfaces for DPF and Javascript/WebAudio output lack visual feedback

The default DPF and Javascript user interfaces have no meaningful visual feedback (e.g. LEDs), and an improved UI that is more performance/instrument friendly could be developed to replace it. Unlike the Daisy Pod, the DPF and Javascript user interfaces are theoretically not limited in number of user controls or visual feedback elements.

This is probably more feasible for the Javascript/WebAudio output, as the user interface is defined/configured by the index.html file. Since the DPF version is transpiled to C++ and then directly to binary, modifying that UI would likely be more involved. In either case, creating a UI with more sliders would mean less reliance on customized visual feedback, similar to how the user interface for the Pure Data version of Dahlia is realized.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.