HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Synthesizer

Categories: Music | Packages

1 Introduction

In the late 1990ies I (Henning Thielemann) developed a graphical audio signal synthesis and analysis application called Assampler for Amiga. However it turned out that graphical programming does not scale well. Thus some years later I started to rewrite much of its functionality in plain Haskell. There is both a low-level interface and a high-level framework for automatical inference of sample rate and use of physical units in a sound processing network. This generalizes the usual restricted splitting into audio rate and control rate signals. Routines are now also suitable for real-time processing using Storable Vector library, a Stream like data type and aggressive inlining. There is an interface for using synthesized sounds for rendering Haskore music. The library uses the Numeric Prelude library and its numerical type class hierarchy.

2 Overview

The aim of this project is audio signal processing using pure Haskell code. The highlights are:

We have checked three approaches, where the last one is the most promising.
  • Explicitly maintain a dictionary of signal parameters in a Reader-Writer-State monad, which must be computed completely before any signal processing takes place. This forces all signal parameters to share the same type and prohibits infinitely many signal processors to be involved (e.g., concatenation of infinitely many short noises).
  • Simulation of logic programming by lazy cycles of function applications (i.e., tied knots, fixed points). The main problems are quadratical computation complexity and a cumbersome and error-prone application. Namely, for each input you have to handle a parameter output, and vice versa for propagation of parameters through the network. You need combinators (infix operators) for combining these functions, but you will easily run into cases where you must plug manually, which is a nightmare.
  • Unify only the sample rate. Use a Reader functor/monad. Amplitude is propagated from inputs to outputs only. This is a bit conservative, but is simple and comprehensive and fulfils our needs so far.
A combination of the last two approaches seems to be a good choice so far. However, maintaining all code versions for comparison purposes led to much code duplication in the meantime.


3 Links

Retrieved from "http://www.haskell.org/haskellwiki/Synthesizer"

This page has been accessed 477 times. This page was last modified 13:57, 20 October 2008. Recent content is available under a simple permissive license.