What does it do?ΒΆ
Prioritizing code expressiveness, clarity and simplicity, without precluding the lazy evaluation, and aiming to be used together with Numpy, Scipy and Matplotlib as well as default Python structures like lists and generators, AudioLazy is a package written in pure Python proposing digital audio signal processing (DSP), featuring:
- A
Stream
class for finite and endless signals representation with elementwise operators (auto-broadcast with non-iterables) in a common Python iterable container accepting heterogeneous data; - Strongly sample-based representation (Stream class) with easy conversion
to block representation using the
Stream.blocks(size, hop)
method; - Sample-based interactive processing with
ControlStream
; Streamix
mixer for iterables given their starting time deltas;- Multi-thread audio I/O integration with PyAudio;
- Linear filtering with Z-transform filters directly as equations (e.g.
filt = 1 / (1 - .3 * z ** -1)
), including linear time variant filters (i.e., thea
ina * z ** k
can be a Stream instance), cascade filters (behaves as a list of filters), resonators, etc.. EachLinearFilter
instance is compiled just in time when called; - Zeros and poles plots and frequency response plotting integration with MatPlotLib;
- Linear Predictive Coding (LPC) directly to
ZFilter
instances, from which you can find PARCOR coeffs and LSFs; - Both sample-based (e.g., zero-cross rate, envelope, moving average, clipping, unwrapping) and block-based (e.g., window functions, DFT, autocorrelation, lag matrix) analysis and processing tools;
- A simple synthesizer (Table lookup, Karplus-Strong) with processing tools (Linear ADSR envelope, fade in/out, fixed duration line stream) and basic wave data generation (sinusoid, white noise, impulse);
- Biological auditory periphery modeling (ERB and gammatone filter models);
- Multiple implementation organization as
StrategyDict
instances: callable dictionaries that allows the same name to have several different implementations (e.g.erb
,gammatone
,lowpass
,resonator
,lpc
,window
); - Converters among MIDI pitch numbers, strings like “F#4” and frequencies;
- Polynomials, Stream-based functions from itertools, math, cmath, and more! Go try yourself! =)