Python: module boodle.stereo

boodle.stereo | index boodle/stereo.py

`stereo: Utility functions for stereo panning.
These functions return a stereo object -- an object which represents a
range of stereo positions for a soundscale. Stereo objects can be passed
to new_channel_pan() or sched_note_pan().
default() -- return the default stereo position
shift() -- return a simple stereo shift
shiftxy() -- return a two-dimensional stereo shift
scale() -- return a stretched or compressed stereo effect
scalexy() -- return a two-dimensional stereo scaling
fixed() -- return a stereo effect which is compressed to a point
fixedx() -- an alias for fixed
fixedy() -- return a stereo effect which is compressed to a point on the Y axis
fixedxy() -- return a stereo effect compressed to a point on the XY plane
compose() -- apply one stereo effect on top of another
cast() -- convert an object to a stereo effect`

Modules
`` |  |
unittest |  |  |

Classes
`` |  | unittest.TestCase(__builtin__.object) TestStereo
class TestStereo(unittest.TestCase)
`` |  | Method resolution order: TestStereo unittest.TestCase __builtin__.object Methods defined here: assertStereo(self, val, tup) test_compose(self) test_construct(self) test_extend(self) Methods inherited from unittest.TestCase: __call__(self, *args, **kwds) __init__(self, methodName='runTest') `Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.` __repr__(self) __str__(self) assertAlmostEqual = failUnlessAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` assertAlmostEquals = failUnlessAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` assertEqual = failUnlessEqual(self, first, second, msg=None) `Fail if the two objects are unequal as determined by the '==' operator.` assertEquals = failUnlessEqual(self, first, second, msg=None) `Fail if the two objects are unequal as determined by the '==' operator.` assertFalse = failIf(self, expr, msg=None) `Fail the test if the expression is true.` assertNotAlmostEqual = failIfAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` assertNotAlmostEquals = failIfAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` assertNotEqual = failIfEqual(self, first, second, msg=None) `Fail if the two objects are equal as determined by the '==' operator.` assertNotEquals = failIfEqual(self, first, second, msg=None) `Fail if the two objects are equal as determined by the '==' operator.` assertRaises = failUnlessRaises(self, excClass, callableObj, *args, **kwargs) `Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.` assertTrue = failUnless(self, expr, msg=None) `Fail the test unless the expression is true.` assert_ = failUnless(self, expr, msg=None) `Fail the test unless the expression is true.` countTestCases(self) debug(self) `Run the test without collecting errors in a TestResult` defaultTestResult(self) fail(self, msg=None) `Fail immediately, with the given message.` failIf(self, expr, msg=None) `Fail the test if the expression is true.` failIfAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` failIfEqual(self, first, second, msg=None) `Fail if the two objects are equal as determined by the '==' operator.` failUnless(self, expr, msg=None) `Fail the test unless the expression is true.` failUnlessAlmostEqual(self, first, second, places=7, msg=None) `Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).` failUnlessEqual(self, first, second, msg=None) `Fail if the two objects are unequal as determined by the '==' operator.` failUnlessRaises(self, excClass, callableObj, *args, **kwargs) `Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.` id(self) run(self, result=None) setUp(self) `Hook method for setting up the test fixture before exercising it.` shortDescription(self) `Returns a one-line description of the test, or None if no description has been provided. The default implementation of this method returns the first line of the specified test method's docstring.` tearDown(self) `Hook method for deconstructing the test fixture after testing it.` Data descriptors inherited from unittest.TestCase: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)` Data and other attributes inherited from unittest.TestCase: failureException = <type 'exceptions.AssertionError'> `Assertion failed.`

Functions
`` |  | cast(obj) `cast(obj) -> stereo Convert obj into a stereo object. If obj is None, this returns the default stereo position. If obj is a number, this returns a simple stereo shift -- no scaling. If obj is a stereo object, this returns it.` compose(stereo1, stereo2) `compose(stereo1, stereo2): Return a stereo effect which is the result of applying of stereo1 on top of stereo2. This is the equivalent of a channel set to stereo1, containing a channel stereo2.` default() `default() -> stereo Return a stereo object which describes the default stereo position -- no shift, no contraction.` extend_tuple(obj) `extend_tuple(obj) -> stereo Given a stereo object, return a 4-tuple which is an equivalent stereo object. (This is an internal function. Outside callers should not make use of it.)` fixed(pos) `fixed(pos) -> stereo Return a stereo effect which is compressed to a point (on the X axis). All sounds contained in this effect, no matter how shifted, will come from a single point. If pos is zero, this will be the center; if -1, directly to the left; if 1, directly to the right.` fixedx(pos) `fixedx(pos) -> stereo An alias for fixed(pos).` fixedxy(posx, posy) `fixedxy(posx, posy) -> stereo Return a stereo effect which is compressed to a point on the XY plane.` fixedy(posy) `fixedy(posy) -> stereo Return a stereo effect which is compressed to a point on the Y axis.` scale(size) `scale(size) -> stereo Return a stereo effect which is not shifted left or right, but is compressed or stretched from the center. If size is less than 1, the channels are compressed; zero causes every sound to be perfectly centered. If size is greater than 1, the channels are spread apart. Negative values cause the left and right channels to swap.` scalexy(sizex=1, sizey=1) `scalexy(sizex=1, sizey=1) -> stereo Return a two-dimensional stereo scaling. If sizey is 1 (or omitted), this is equivalent to scale(sizex).` shift(pos) `shift(pos) -> stereo Return a simple stereo shift. If pos is zero, there is no shift in origin; this returns the default stereo position. -1 means directly to the left; 1 means directly to the right. More extreme values recede into the distance.` shiftxy(posx=0, posy=0) `shiftxy(posx=0, posy=0) -> stereo Return a two-dimensional stereo shift. If posy is zero (or omitted), this is equivalent to shift(posx).`

Data
`` |  | Identity = () Identity_2 = (1.0, 0.0) Identity_4 = (1.0, 0.0, 1.0, 0.0)