René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Shaping the envelope of an instrument | ||
With a gen function
The following template shows how the shape the envelope of an instrument.
The parameter p6 identifies the function table of the envelope shape; p7 is the
function table of the tone to be shaped.
sr = 44100 kr = 441 ksmps =100 nchnls = 1 instr 1; ilen = p3 iamp = p4 ifrq = cpspch(p5) if1 = p6 ; shape of envelope if2 = p7 ; waveform aenv oscili iamp, 1/ilen, if2 asig oscili aenv, ifrq, if1 out asig endin f1 0 1024 10 1 2 3 5 8 13 1 2 3 5 8 13 ; fibonacci twice f2 0 513 5 1 100 1024 100 1 112 1 100 1024 100 1 ; twin peaks i1 0 2 8000 7.00 1 2 e
See gong for an example that uses this technique.
With linseg and expon
expon makes it ideal to generate a simple envelope.
|