GEN20 GEN20 GEN20 Generates functions of different windows. Description This subroutine generates functions of different windows. These windows are usually used for spectrum analysis or for grain envelopes. Syntax f # time size 20 window max [opt] Initialization size -- number of points in the table. Must be a power of 2 ( + 1). window -- Type of window to generate: 1 = Hamming 2 = Hanning 3 = Bartlett ( triangle) 4 = Blackman ( 3-term) 5 = Blackman - Harris ( 4-term) 6 = Gaussian 7 = Kaiser 8 = Rectangle 9 = Sinc max -- For negative p4 this will be the absolute value at window peak point. If p4 is positive or p4 is negative and p6 is missing the table will be post-rescaled to a maximum value of 1. opt -- Optional argument required by the Gaussian window, the Kaiser window and the Sinc window. Examples f 1 0 1024 20 5 This creates a function which contains a 4 - term Blackman - Harris window with maximum value of 1. f 1 0 1024 -20 2 456 This creates a function that contains a Hanning window with a maximum value of 456. f 1 0 1024 -20 1 This creates a function that contains a Hamming window with a maximum value of 1. f 1 0 1024 20 7 1 2 This creates a function that contains a Kaiser window with a maximum value of 1. The extra argument specifies how "open" the window is, for example a value of 0 results in a rectangular window and a value of 10 in a Hamming like window. f 1 0 1024 20 6 1 2 This creates a function that contains a Gaussian window with a maximum value of 1. The extra argument specifies how broad the window is, as the standard deviation of the curve; in this example the s.d. is 2. The default value is 1. f 1 0 1024 20 9 1 3 This creates a function that contains a Sinc window with a maximum value of 1. The extra argument specifies the range of the function as multiple of π. The default value is 1. For all diagrams, see Window Functions Here is an example of the GEN20 routine. It uses the file gen20.csd. Example of the GEN20 routine. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. These are the diagrams of the waveforms of the GEN20 routines, as used in the example: f 1 0 512 20 2 - Hanning window f 1 0 512 20 2 - Hanning window f 2 0 512 20 6 1 - Gaussian window f 2 0 512 20 6 1 - Gaussian window Credits Author: &nameparis; MIT, Cambridge 1995 Author: &namejohn; University of Bath/Codemist Ltd. Bath, UK New in Csound version 3.2 Optional argument to Gaussian added in 5.10