@hackage hdf0.15
HDF: Uniform Rate Audio Signal Processing in Haskell
Categories
License
LicenseRef-GPL
Maintainer
rd@slavepianos.org
Links
Versions
Deprecated
Dependencies (11)
Dependents (1)
@hackage/acme-everything
hdf - haskell data flow
Haskell library for uniform rate audio signal processing.
It generates C code that requires either
RDL
(from sc3-rdu) or jack-dl
(from rju).
The SC2 analog bubbles 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:
The generated C-code (for jack-dl
) is c/gen/analog-bubbles.c.
Slightly more elaborate, the berlin 1977 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:
The generated C-code (for jack-dl
) is c/gen/berlin-1977.c.
hdf implements text-dl
for testing.
© rohan drape, 2006-2014, gpl