audiolazy PackageΒΆ

AudioLazy package

This is the main package file, that already imports all modules into the system. As the full name might not be small enough for typing it everywhere, you can import with a helpful alias:

>>> import audiolazy as lz
>>> lz.Stream(1, 3, 2).take(8)
[1, 3, 2, 1, 3, 2, 1, 3]

But there’s some parts of the code you probably will find it cleaner to import directly, like the z object:

>>> from audiolazy import z, Stream
>>> filt = 1 / (1 - z ** -1) # Accumulator linear filter
>>> filt(Stream(1, 3, 2), zero=0).take(8)
[1, 4, 6, 7, 10, 12, 13, 16]

For a single use within a console or for trying some new experimental ideas (perhaps with IPython), you would perhaps find easier to import the full package contents:

>>> from audiolazy import *
>>> s, Hz = sHz(44100)
>>> delay_a4 = freq2lag(440 * Hz)
>>> filt = ParallelFilter(comb.tau(delay_a4, 20 * s),
...                       resonator(440 * Hz, bandwidth=100 * Hz)
...                      )
>>> len(filt)
2

There’s documentation inside the package classes and functions docstrings. If you try dir(audiolazy) [or dir(lz)] after importing it [with the suggested alias], you’ll see all the package contents, and the names starting with lazy followed by an underscore are modules. If you’re starting now, try to see the docstring from the Stream and ZFilter classes with the help(lz.Stream) and help(lz.ZFilter) commands, and then the help from the other functionalities used above. If you didn’t know the dir and help built-ins before reading this, it’s strongly suggested you to read first a Python documentation or tutorial, at least enough for you to understand the basic behaviour and syntax of for loops, iterators, iterables, lists, generators, list comprehensions and decorators.

This package was created by Danilo J. S. Bellini and is a free software, under the terms of the GPLv3.

Summary of package modules:

Module Description
lazy_analysis Audio analysis and block processing module
lazy_auditory Peripheral auditory modeling module
lazy_compat Compatibility tools to keep the same source working in both Python 2 and 3
lazy_core Core classes module
lazy_filters Stream filtering module
lazy_io Audio recording input and playing output module
lazy_itertools Itertools module “decorated” replica, where all outputs are Stream instances
lazy_lpc Linear Predictive Coding (LPC) module
lazy_math Math modules “decorated” and complemented to work elementwise when needed
lazy_midi MIDI representation data & note-frequency relationship
lazy_misc Common miscellanous tools and constants for general use
lazy_poly Polynomial model and Waring-Lagrange polynomial interpolator
lazy_stream Stream class definition module
lazy_synth Simple audio/stream synthesis module
lazy_text Strings, reStructuredText, docstrings and other general text processing
lazy_wav Resources for opening data from Wave (.wav) files