hdf: HDF: Uniform Rate Audio Signal Processing in Haskell

[ deprecated, library, sound ] [ Propose Tags ] [ Report a vulnerability ]
Deprecated
Versions [RSS] 0.7, 0.11, 0.14, 0.15
Dependencies base (>=4 && <5), directory, fgl, fgl-visualize, filepath, hosc (>=0.15 && <0.16), hsc3 (>=0.15 && <0.16), murmur-hash, process, split, transformers [details]
Tested with ghc ==7.8.2
License LicenseRef-GPL
Copyright (c) Rohan Drape, 2006-2014
Author Rohan Drape
Maintainer rd@slavepianos.org
Category Sound
Home page http://rd.slavepianos.org/t/hdf
Source repo head: darcs get http://rd.slavepianos.org/sw/hdf/
Uploaded by RohanDrape at 2014-10-12T10:22:30Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2948 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hdf-0.15

[back to package description]
hdf - haskell data flow
-----------------------

[Haskell][hs] library for uniform rate audio signal processing.

It generates [C][c] code that requires either
`RDL` (from [sc3-rdu][sc3-rdu]) or `jack-dl` (from [rju][rju]).

The [SC2][sc2] [analog bubbles][ab] graph can be written:

~~~~
  let o = lf_saw (mce2 8.0 7.23) 0.0 * 3.0 + 80.0
      m = lf_saw 0.4 0.0 * 24.0 + o
      s = sin_osc (midi_cps m) 0.0 * 0.04
      c = comb_n [0,1] 0.4 s 0.2 4.0
  in out c
~~~~

The data flow graph this generates is:

![](sw/hdf/svg/analog-bubbles.svg)

The generated C-code (for `jack-dl`) is [c/gen/analog-bubbles.c](sw/hdf/c/gen/analog-bubbles.c).

Slightly more elaborate, the [berlin 1977][b7] graph can be written:

~~~~
    let clock_rate = 9
        clock_time = 1 / clock_rate
        clock = impulse clock_rate 0 -- sequencer trigger
        tr = trigger clock
        note = sequ 0 [55,60,63,62,60,67,63,58] tr -- midi note pattern sequencer
        tr_16 = pulse_divider tr 16 0 -- divide tr by 16
        note' = sequ 1 [-12,-7,-5,0,2,5] tr_16 + note -- transpose
        freq = midi_cps note' -- convert midi note to cycles per second
        env = decay2 clock (0.05 * clock_time) (2 * clock_time)
        amp = env * 0.1 + 0.02 -- amplitude envelope
        filt = env * (sin_osc 0.17 0 * 800) + 1400 -- filter frequency
        pw = sin_osc (mce2 0.08 0.09) 0 * 0.45 + 0.5 -- pulse width LFO(s)
        s = lf_pulse freq 0 pw * amp -- not bandlimited
    in out (comb_n [0,1] 0.2 (rlpf s filt 0.15) (mce2 0.2 0.17) 1.5)
~~~~

The data flow graph this generates is:

![](sw/hdf/svg/berlin-1977.svg)

The generated C-code (for `jack-dl`) is [c/gen/berlin-1977.c](sw/hdf/c/gen/berlin-1977.c).

<!-- These are from the small set of example [graphs][ix]. -->

hdf implements `text-dl` for testing.

[hs]: http://haskell.org/
[c]: http://c2.com/cgi/wiki?CeeLanguage
[sc3-rdu]: http://rd.slavepianos.org/?t=sc3-rdu
[rju]: http://rd.slavepianos.org/?t=rju
[ab]: sw/hsc3-graphs/gr/analog-bubbles.scd
[b7]: sw/hsc3-graphs/gr/berlin-1977.scd
[sc2]: http://audiosynth.com/
[ix]: http://rd.slavepianos.org/?t=hdf&e=md/ix.md

© [rohan drape][rd], 2006-2014, [gpl]

[rd]: http://rd.slavepianos.org/
[gpl]: http://gnu.org/copyleft/