envext

envext — Extracts the envelope of a file to a text file.

Syntax

envext [-flags] soundfile
csound -U envext [-flags] soundfile

Initialization

soundfile - Name of the input soundfile.

The following flags are available for envext (The default values are stated in parenthesis):

-o fnam Name of output filename (newenv)
-w size (in seconds) of analysis window (0.25)

The envext utility generates a text file containing time and amplitude pairs by finding the absolute peak within each window.

Examples

Here is an example of the envext utility. Play envext.csd

Example 1360. Example of the envext utility.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac   -m0  ;;;realtime audio out, with limiter protection
; For Non-realtime ouput leave only the line below:
; -o envext.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

; by Menno Knevel 2022

instr 1
; analyzes sound file and outputs result to a file called "newenv"
ires1 system_i 1,{{ envext -w .05 Mathews.wav }}               
endin

</CsInstruments>
<CsScore>

i1 0 1  

e
</CsScore>
</CsoundSynthesizer>


This example will produce a text file containing the following:


0.000 0.000
0.039 0.426
0.053 0.606
0.108 0.494
0.163 0.333
0.208 0.301
0.297 0.587
0.309 0.622
0.399 0.624
0.414 0.676
.........
.........
15.411 0.293
15.452 0.123
15.502 0.014
15.551 0.000

Which shows the time for the peak amplitude within each measured window.

Credits

Author: John ffitch

1995