diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-09-22 04:13:21 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-09-25 03:52:16 +0200 |
commit | 503acf7dfe5fa747dbbd2576d0b78b8c54ac9e4c (patch) | |
tree | 75994115663633e2307bf8d6d91faf9eea552731 /ladspa.lua | |
parent | d5ae3fdde5b22fd0e66f6e9c27eb08c23f0274ba (diff) | |
download | applause2-503acf7dfe5fa747dbbd2576d0b78b8c54ac9e4c.tar.gz |
changed semantics of ZipStream (ie. multiply, add operators): the left stream determines the length
* this makes them compatible with the scalar operations like Stream:mul(), Stream:add() etc
when the right stream is a scalar turned into an infinite stream.
* Consequently, both operations could be merged: Stream:mul() and the __mul operator
are now synonymous.
The methods are kept since they are sometimes handy to avoid braces when writing
from left to right.
Since the old way of mapping a stream for scalars is still a bit faster compared to using
a ZipStream, this method is still applied for scalars as an optimization.
Both the methods and the operators will now work with scalars and arbitrary streams, though.
* This means that many primitives based on scalar operations previously will now
work with streams as well. This applies to Stream:scale(), Stream:ccscale(), Stream:mix(),
Stream:pan() and even line().
* Added Stream:min() and Stream:max() as shortcuts for binary operations from the
math package.
* All the binary operations from the math and bit packages will work with streams now
as well (without performance penalties).
* Stream:clip() has been revised and works with stream arguments now as well.
* Optimized ConcatStream, MapStream, ScanStream, FoldStream and esp. ZipStream.
* The new ZipStream semantics allow for new useful idioms.
For instance, to add an envelope to an infinite stream (stream*env), a SubStream
was often necessary to restrict the resulting stream to the length of the envelope
as in (stream*env):sub(1,env:len()).
This can now be written more elegantly as (env*stream).
To extend a stream to infinite length, you may still write 0+stream or
stream..0
Diffstat (limited to 'ladspa.lua')
0 files changed, 0 insertions, 0 deletions