Giter VIP home page Giter VIP logo

gammaenv's Introduction

gammaenv

Introduction

"gammaenv" produces smoothed-out S-curve envelope signal with the specified attack and release characteristics. The attack and release times can be further adjusted in real-time. Delay parameter is also specified as the percentage of the total time.

The S-curve produced by this envelope algorithm closely resembles a sine-wave signal slightly augmented via the tanh() function. Such augmentation makes the shape slightly steeper and in the end allows the algorithm to follow it closer. The name "gammaenv" relates to this algorithm's version.

The algorithm's topology is based on 5 sets of "leaky integrators" (the simplest form of 1st order low-pass filters). Each set (except the 5th) use 4 low-pass filters in series. Outputs of all sets are then simply summed/subtracted to produce the final result. The topology is numerically stable for any valid input signal, but may produce envelope overshoots depending on the input signal.

Up to 25% of total attack (or release) time can be allocated (via Delay parameters) to the delay stage. The delay is implemented by the same topology: this has the benefit of not requiring additional memory buffering. For example, it is possible to get up to 250 ms delay on a 1-second envelope release stage without buffering.

The processSymm() function provides the "perfect" implementation of the algorithm, but it is limited to the same attack and release times. A more universal process() function can work with any attack and release times, but it is about 2 times less efficient and the actual attack stage's envelope can range from the "designed" U to the undesired sharp V shape. Unfortunately, the author was unable to find an approach that could be similar to the processSymm() function while providing differing attack and release times (the best approach found so far lengthens the delay stage unpredictably).

Compile and run the testtable.cpp to produce a tab-delimited table of curves at various delay values. Also use this source as an example of envelope generator setup and use procedure.

With the help of this DSP construct it is possible to transform discrete switching events into smooth transitions.

Curves

Curves chart

gammaenv's People

Contributors

avaneev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gammaenv's Issues

What is this for?

It looks like a kind of smoothing that would be better than a simple exponential attack-release decay?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.