### FFT/IFFT Usage Example in EEL2 Source: https://www.cockos.com/EEL2/index.php A complete example demonstrating the sequence of operations for FFT, including permutation and scaling. Remember to scale the output by 1/size. ```eel buffer=0; fft(buffer, 512); fft_permute(buffer, 512); buffer[32]=0; fft_ipermute(buffer, 512); ifft(buffer, 512); // need to scale output by 1/512.0, too. ``` -------------------------------- ### Perform Pattern Matching with match() Source: https://www.cockos.com/EEL2/index.php Examples of using the match function with wildcards to search for substrings. ```eel2 match("*blah*", "this string has the word blah in it") == 1 match("*blah", "this string ends with the word blah") == 1 ``` -------------------------------- ### Extract Data with match() and Format Specifiers Source: https://www.cockos.com/EEL2/index.php Example of using match with format specifiers to extract a numeric value into a variable. ```eel2 match("*%4d*","some four digit value is 8000, I say",blah)==1 && blah == 8000 ``` -------------------------------- ### Define a Function with Taylor Approximation in EEL2 Source: https://www.cockos.com/EEL2/index.php Define a function that calculates a Taylor approximation for a given input. This example demonstrates a basic function with a single parameter. ```eel function mySine(x) ( // taylor approximation x - (x^3)/(3*2) + (x^5)/(5*4*3*2) - (x^7)/(7*6*5*4*3*2) + (x^9)/(9*8*7*6*5*4*3*2); ); ``` -------------------------------- ### Execute a fixed-count loop in EEL2 Source: https://www.cockos.com/EEL2/index.php The loop count is evaluated once at the start. If the count is less than 1, the code block is skipped. ```EEL2 loop(32, r += b; b = var * 1.5; ); ``` -------------------------------- ### Define a Function with Local Variables for Caching in EEL2 Source: https://www.cockos.com/EEL2/index.php Use the 'local()' statement to declare variables that are private to a function and persist across calls. This example caches the result of mySine to avoid redundant calculations. ```eel function mySine(x) local(lastreq lastvalue) ( lastreq != x ? ( lastreq = x; // taylor approximation lastvalue = x - (x^3)/(3*2) + (x^5)/(5*4*3*2) - (x^7)/(7*6*5*4*3*2) + (x^9)/(9*8*7*6*5*4*3*2); ); lastvalue; ); ``` -------------------------------- ### Looping Constructs Source: https://www.cockos.com/EEL2/index.php EEL2 provides several ways to implement loops. ```APIDOC ## Looping Constructs ### Description Supports looping via `loop()` and `while()` functions. ### `loop(count, code)` Evaluates the first parameter once to determine a loop count. If the count is less than 1, the second parameter is not evaluated. Implementations may limit the number of iterations. ```eel2 loop(32, r += b; b = var * 1.5; ); ``` ### `while(code)` Evaluates the first parameter until the last statement in the code block evaluates to zero. Implementations may limit the number of iterations. ```eel2 while( a += b; b *= 1.5; a < 1000; // as long as a is below 1000, we go again. ); ``` ### `while(condition) ( code )` Evaluates the condition, and if nonzero, evaluates the following code block, and repeats. Similar to a C style `while()` construct. Implementations may limit the number of iterations. ```eel2 while ( a < 1000 ) ( a += b; b *= 1.5; ); ``` ``` -------------------------------- ### Call User Defined Functions in EEL2 Source: https://www.cockos.com/EEL2/index.php Demonstrates how to call user-defined functions from other parts of your EEL2 code. Ensure functions are declared before they are called. ```eel y = mySine($pi * 18000 / getSampleRate()); z = calculateSomething(1,2); ``` -------------------------------- ### Call Namespace Functions in EEL2 Source: https://www.cockos.com/EEL2/index.php Demonstrates calling functions that operate within a specific namespace, either directly or through an object instance. ```eel whatever.set_foo(32); set_foo(32); ``` -------------------------------- ### Execute a C-style while loop Source: https://www.cockos.com/EEL2/index.php Evaluates the condition before each iteration of the code block. ```EEL2 while ( a < 1000 ) ( a += b; b *= 1.5; ); ``` -------------------------------- ### Navigate Up Namespace Hierarchy in EEL2 Source: https://www.cockos.com/EEL2/index.php Use the 'this..' prefix to access variables in parent namespaces, enabling navigation up the hierarchy. ```eel function set_par_foo(x) ( this..foo = x; ); a.set_par_foo(1); a.b.set_par_foo(1); ``` -------------------------------- ### Expression Evaluation with Parentheses in EEL2 Source: https://www.cockos.com/EEL2/index.php Demonstrates how parentheses can enclose multiple statements in an expression, with the value of the expression being the result of the last statement. ```eel2 z = ( a = 5; b = 3; a+b; ); ``` -------------------------------- ### Define Functions with Namespace Access using 'instance' in EEL2 Source: https://www.cockos.com/EEL2/index.php Use the 'instance()' declaration to associate a function with a specific global variable namespace, enabling pseudo object-style programming. ```eel function set_foo(x) instance(foo) ( foo = x; ); ``` -------------------------------- ### Indexing Memory with Brackets Source: https://www.cockos.com/EEL2/index.php Use brackets to index memory. The sum of the value to the left and the value within the brackets is used for indexing. If the value in the brackets is omitted, only the value to the left is used. For fractional values, manually truncate them to an integer using '|0'. ```eel z=x[y]; x[y]=z; ``` ```eel x[y|0] = z ``` -------------------------------- ### Use named strings Source: https://www.cockos.com/EEL2/index.php Named strings persist for the life of the script and are initialized as empty. ```EEL2 x = #myString; strcpy(x, "hello world"); ``` -------------------------------- ### Define a Simple Function in EEL2 Source: https://www.cockos.com/EEL2/index.php Use this syntax to define functions that take no parameters and return a global variable. Functions cannot be recursive and must call functions declared before them. ```eel function getSampleRate() ( srate; ); ``` -------------------------------- ### Accessing Global Shared Memory Source: https://www.cockos.com/EEL2/index.php Use 'gmem' followed by brackets to access the global shared buffer for reading or writing. ```eel z=gmem[y]; gmem[y]=z; ``` -------------------------------- ### Use temporary string instances Source: https://www.cockos.com/EEL2/index.php The # operator provides a temporary string instance with limited scope. ```EEL2 x = #; strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x); ``` -------------------------------- ### FFT/IFFT Functions Source: https://www.cockos.com/EEL2/index.php Functions for performing Fast Fourier Transform (FFT) and Inverse Fast Fourier Transform (IFFT) on complex and real number buffers. Note that FFT/IFFT require real/imaginary input pairs and must not cross a 65,536 item boundary. ```APIDOC ## FFT/IFFT Functions ### Description Functions for performing Fast Fourier Transform (FFT) and Inverse Fast Fourier Transform (IFFT) on complex and real number buffers. Note that FFT/IFFT require real/imaginary input pairs and must not cross a 65,536 item boundary. ### fft_real(buffer, size) Performs a real-to-complex FFT. ### ifft_real(buffer, size) Performs a complex-to-real IFFT. ### convolve_c(dest, src, size) Convolves two complex number buffers. The size specifies the number of complex number pairs. The convolution must NOT cross a 65,536 item boundary. ``` -------------------------------- ### Pattern Matching Source: https://www.cockos.com/EEL2/index.php Functions for searching strings using simplified regex-style wildcards. ```APIDOC ## match / matchi ### Description Search for a needle in a haystack using wildcards (*, +, ?) and type-based format specifiers. ### Methods - **match(needle, haystack, ...)**: Case-sensitive search. - **matchi(needle, haystack, ...)**: Case-insensitive search. ``` -------------------------------- ### Stack Operations Source: https://www.cockos.com/EEL2/index.php Functions for interacting with the user stack, which is approximately 4096 items in size. ```APIDOC ## Stack Operations ### Description Functions for interacting with the user stack, which is approximately 4096 items in size. ### stack_push(value) Pushes `value` onto the user stack and returns a reference to the value. ### stack_pop(value) Pops a value from the user stack into `value` (or a temporary buffer if `value` is not specified) and returns a reference to where the stack was popped. This function never fails, even if the stack is empty. ### stack_peek(index) Returns a reference to the item on the top of the stack (if `index` is 0) or the Nth item on the stack if `index` is greater than 0. ### stack_exch(value) Exchanges `value` with the top of the stack and returns a reference to the parameter with the new value. ``` -------------------------------- ### String Handling Source: https://www.cockos.com/EEL2/index.php Details on how strings are represented and manipulated in EEL2. ```APIDOC ## String Handling ### Description EEL2 supports strings, with optional implementation of string functions. Strings can be specified as literals using quotes and follow C-like syntax for escaping. ### String Literals - Specified using double quotes (e.g., `"This is a test string"`). - Quotes within strings must be escaped with backslashes (e.g., `"He said \"hello, world\" to me"`). - Multiple literal strings are automatically concatenated. - Quotes can span multiple lines. - Implementations may impose a soft limit on string size. ### String Referencing Strings are referenced by a number (index) or a name. ### Mutable Strings Mutable strings can be handled using: 1. **Indexed Strings (0-1023)**: ```eel2 x = 50; // string slot 50 strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x); ``` 2. **Temporary Strings (`#`)**: ```eel2 x = #; strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x); ``` Scope is limited and unpredictable; initial values are undefined. 3. **Named Strings (`#name`)**: ```eel2 x = #myString; strcpy(x, "hello world"); ``` Named strings are initialized to empty and persist. Shortcuts exist for assignment and appending: ```eel2 #myString = "hello "; // same as strcpy(#myString, "hello "); #myString += "world"; // same as strcat(#myString, "world"); ``` ### String Functions - **strlen(str)**: Returns the length of the string. ``` -------------------------------- ### Formatted String Output Source: https://www.cockos.com/EEL2/index.php Function for generating formatted strings using printf-style specifiers. ```APIDOC ## sprintf ### Description Copies format to str, converting format strings based on provided parameters. ### Parameters - **str**: Destination string. - **format**: Format string containing specifiers like %s, %d, %f, %x, etc. - **...**: Additional parameters for format specifiers. ``` -------------------------------- ### Perform Fast Fourier Transform (FFT) in EEL2 Source: https://www.cockos.com/EEL2/index.php Computes the Fast Fourier Transform on data in the local memory buffer. The size must be a power of 2 between 16 and 32768. Output is permuted. ```eel buffer=0; fft(buffer, 512); ``` -------------------------------- ### Memory Utility Functions Source: https://www.cockos.com/EEL2/index.php Functions for managing and manipulating memory buffers, including freeing memory, copying, setting values, and performing calculations. ```APIDOC ## Memory Utility Functions ### Description Functions for managing and manipulating memory buffers, including freeing memory, copying, setting values, and performing calculations. ### freembuf(top) Notifies the memory manager that a portion of the local memory buffer is no longer in use. `top` is the highest index used plus 1. Calling `freembuf(0)` indicates no memory is in use. This is a hint and does not guarantee memory is freed. ### memcpy(dest, source, length) Copies `length` items from `source` to `dest`. Results may be undefined if buffers overlap and cross a 65,536 item boundary. ### memset(dest, value, length) Sets `length` items in `dest` to `value`. ### mem_multiply_sum(buf1, buf2, length) Sums the products of `length` items of `buf1` and `buf2`. Special cases for `buf2`: -1 sums squares of `buf1`, -2 sums absolute values of `buf1`, -3 sums values of `buf1`. Other negative values for `buf2` result in undefined behavior. ### mem_insert_shuffle(buf, len, value) Shuffles `buf` to the right by one element, inserting `value` at `buf[0]`, and returns the previous `buf[len-1]`. ### __memtop() Returns the maximum memory words available to the script. ``` -------------------------------- ### Define a Function with Multiple Parameters in EEL2 Source: https://www.cockos.com/EEL2/index.php Define a function that accepts multiple parameters and performs calculations using them. The parameters are local to the function. ```eel function calculateSomething(x y) ( x += mySine(y); x/y; ); ``` -------------------------------- ### FFT and IFFT Operations Source: https://www.cockos.com/EEL2/index.php Performs Fast Fourier Transform operations, including real-only variants and permutation utilities for in-order data access. ```APIDOC ## FFT / IFFT ### Description Performs a Fast Fourier Transform or inverse on data in the local memory buffer. Outputs are permuted; use fft_permute and fft_ipermute for in-order access. ### Parameters - **start_index** (integer) - Required - The offset in the local memory buffer. - **size** (integer) - Required - The size of the FFT. Must be one of: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, or 32768. ### Request Example buffer=0; fft(buffer, 512); fft_permute(buffer, 512); // Process data fft_ipermute(buffer, 512); ifft(buffer, 512); ``` -------------------------------- ### Permute FFT Output in EEL2 Source: https://www.cockos.com/EEL2/index.php Rearranges the output of an FFT into sequential order for easier processing. Call this after FFT and before in-order use of the data. ```eel fft_permute(buffer, 512); ``` -------------------------------- ### String Manipulation Functions Source: https://www.cockos.com/EEL2/index.php Functions for copying, concatenating, and comparing strings. ```APIDOC ## String Manipulation Functions ### Description Functions to perform basic string operations like copy, append, and comparison. ### Methods - **strcpy(str, srcstr)**: Copies srcstr into str, returns str. - **strcat(str, srcstr)**: Appends srcstr to str, returns str. - **strcmp(str, str2)**: Compares str to str2 (case sensitive), returns -1, 0, or 1. - **stricmp(str, str2)**: Compares str to str2 (ignoring case), returns -1, 0, or 1. - **strncmp(str, str2, maxlen)**: Compares str to str2 up to maxlen bytes (case sensitive). - **strnicmp(str, str2, maxlen)**: Compares str to str2 up to maxlen bytes (ignoring case). - **strncpy(str, srcstr, maxlen)**: Copies srcstr into str, stops after maxlen bytes. - **strncat(str, srcstr, maxlen)**: Appends srcstr to str, stops after maxlen bytes of srcstr. ``` -------------------------------- ### Division Operator Source: https://www.cockos.com/EEL2/index.php The '/' operator divides two values and returns the quotient. ```eel value / divisor ``` -------------------------------- ### Assign and append to named strings Source: https://www.cockos.com/EEL2/index.php Shortcut syntax for modifying named string variables. ```EEL2 #myString = "hello "; // same as strcpy(#myString, "hello "); #myString += "world"; // same as strcat(#myString, "world"); ``` -------------------------------- ### Perform Inverse Fast Fourier Transform (IFFT) in EEL2 Source: https://www.cockos.com/EEL2/index.php Computes the Inverse Fast Fourier Transform. The output needs to be scaled by 1/size. ```eel ifft(buffer, 512); ``` -------------------------------- ### Comparison Operators in EEL2 Source: https://www.cockos.com/EEL2/index.php Compares two values and returns 1 for true and 0 for false. Supports equality, inequality, and relational comparisons. ```eel2 value1 == value2 ``` ```eel2 value1 === value2 ``` ```eel2 value1 != value2 ``` ```eel2 value1 !== value2 ``` ```eel2 value1 < value2 ``` ```eel2 value1 > value2 ``` ```eel2 value1 <= value2 ``` ```eel2 value1 >= value2 ``` -------------------------------- ### Perform Complex-to-Real IFFT in EEL2 Source: https://www.cockos.com/EEL2/index.php Computes the Inverse FFT for real-valued output data. The output needs to be scaled by 1/size. ```eel ifft_real(buffer, 512); ``` -------------------------------- ### Define Nested Namespace Function Call in EEL2 Source: https://www.cockos.com/EEL2/index.php Shows how to call a function within a nested namespace, allowing for more organized code structure. ```eel function test2() ( this.set_foo(32); ); whatever.test2(); ``` -------------------------------- ### Exponentiation Operator Source: https://www.cockos.com/EEL2/index.php The '^' operator calculates the first parameter raised to the power of the second parameter. The 'pow(x,y)' function provides equivalent functionality. ```eel base ^ exponent ``` -------------------------------- ### Arithmetic Operators in EEL2 Source: https://www.cockos.com/EEL2/index.php Performs basic arithmetic operations. Supports addition, subtraction, multiplication, division, and modulo. ```eel2 value - another_value ``` ```eel2 value + another_value ``` ```eel2 y *= z ``` ```eel2 y /= divisor ``` ```eel2 y %= divisor ``` ```eel2 y += z ``` ```eel2 y -= z ``` -------------------------------- ### Execute a while loop with trailing condition Source: https://www.cockos.com/EEL2/index.php The code block executes until the final statement evaluates to zero. ```EEL2 while( a += b; b *= 1.5; a < 1000; // as long as a is below 1000, we go again. ); ``` -------------------------------- ### Mathematical Functions Source: https://www.cockos.com/EEL2/index.php A collection of built-in mathematical functions available in EEL2. ```APIDOC ## Mathematical Functions ### Description Provides various mathematical operations. ### Functions - **atan2(x,y)**: Returns the Arc Tangent of x divided by y (return value is in radians). - **sqr(x)**: Returns the square of the parameter (similar to x*x, though only evaluating x once). - **sqrt(x)**: Returns the square root of the parameter. - **pow(x,y)**: Returns the first parameter raised to the second parameter-th power. Identical in behavior and performance to the ^ operator. - **exp(x)**: Returns the number e (approx 2.718) raised to the parameter-th power. This function is significantly faster than pow() or the ^ operator. - **log(x)**: Returns the natural logarithm (base e) of the parameter. - **log10(x)**: Returns the logarithm (base 10) of the parameter. - **abs(x)**: Returns the absolute value of the parameter. - **min(x,y)**: Returns the minimum value of the two parameters. - **max(x,y)**: Returns the maximum value of the two parameters. - **sign(x)**: Returns the sign of the parameter (-1, 0, or 1). - **rand(x)**: Returns a psuedorandom number between 0 and the parameter. - **floor(x)**: Rounds the value to the lowest integer possible (floor(3.9)==3, floor(-3.1)==-4). - **ceil(x)**: Rounds the value to the highest integer possible (ceil(3.1)==4, ceil(-3.9)==-3). - **invsqrt(x)**: Returns a fast inverse square root (1/sqrt(x)) approximation of the parameter. ``` -------------------------------- ### Define Functions with Namespace Access using 'this.' in EEL2 Source: https://www.cockos.com/EEL2/index.php Alternatively, use the 'this.' prefix within a function to access variables within the current namespace, mimicking object property access. ```eel function set_foo(x) ( this.foo = x; ); ``` -------------------------------- ### Mathematical Functions in EEL2 Source: https://www.cockos.com/EEL2/index.php Provides standard trigonometric and inverse trigonometric functions. Angles are specified in radians. ```eel2 sin(angle) ``` ```eel2 cos(angle) ``` ```eel2 tan(angle) ``` ```eel2 asin(x) ``` ```eel2 acos(x) ``` ```eel2 atan(x) ``` -------------------------------- ### Perform Real-to-Complex FFT in EEL2 Source: https://www.cockos.com/EEL2/index.php Computes the FFT for real-valued input data. The size must be a power of 2 between 16 and 32768. ```eel fft_real(buffer, 512); ``` -------------------------------- ### Use fixed string slots for mutable strings Source: https://www.cockos.com/EEL2/index.php Utilize indexed slots (0-1023) to store and manipulate mutable string data. ```EEL2 x = 50; // string slot 50 strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x); ``` -------------------------------- ### Assignment Operators in EEL2 Source: https://www.cockos.com/EEL2/index.php Assigns values to variables. Supports direct assignment, compound assignment for arithmetic, bitwise operations, and exponentiation. ```eel2 y = z ``` ```eel2 base ^= exponent ``` -------------------------------- ### Modulo Operator Source: https://www.cockos.com/EEL2/index.php The '%' operator calculates the remainder of the division of the numerator by the denominator. It converts the absolute values of both operands to integers before calculation. ```eel numerator % denominator ``` -------------------------------- ### Bitwise Operators in EEL2 Source: https://www.cockos.com/EEL2/index.php Performs bitwise operations on integer values. Note that the relative precedence of |, &, and ~ are equal and evaluated left-to-right. Use parentheses for clarity when mixing these operators. ```eel2 a | b ``` ```eel2 a & b ``` ```eel2 a ~ b ``` ```eel2 y |= z ``` ```eel2 y &= z ``` ```eel2 y ~= z ``` -------------------------------- ### Multiplication Operator Source: https://www.cockos.com/EEL2/index.php The '*' operator multiplies two values and returns the product. ```eel value * another_value ``` -------------------------------- ### Conditional Assignment using Ternary Operator in EEL2 Source: https://www.cockos.com/EEL2/index.php Shows how the ternary operator can be used as an lvalue for conditional assignment. ```eel2 (a < 5 ? b : c) = 8; ``` -------------------------------- ### Perform Inverse Modified DCT (IMDCT) in EEL2 Source: https://www.cockos.com/EEL2/index.php Applies an Inverse Modified Discrete Cosine Transform. The IMDCT requires size/2 inputs and produces size results, overwriting the input buffer. ```eel imdct(0, 512); ``` -------------------------------- ### Inverse Permute FFT Input in EEL2 Source: https://www.cockos.com/EEL2/index.php Reverses the permutation applied by fft_permute, preparing the data for an inverse FFT. Call this after in-order use and before IFFT. ```eel fft_ipermute(buffer, 512); ``` -------------------------------- ### Logical Operators in EEL2 Source: https://www.cockos.com/EEL2/index.php Performs logical OR and AND operations. Note that the relative precedence of || and && are equal and evaluated left-to-right. Use parentheses for clarity when mixing these operators. ```eel2 y || z ``` ```eel2 y && z ``` -------------------------------- ### Conditional Branching in EEL2 Source: https://www.cockos.com/EEL2/index.php Implements conditional logic similar to C's if/else. Supports ternary operator with or without an else clause. Expressions can contain multiple statements within parentheses. ```eel2 y ? z ``` ```eel2 y ? z : x ``` ```eel2 x % 5 ? ( f += 1; x *= 1.5; ) : ( f=max(3,f); x=0; ); ``` ```eel2 a < 5 ? b = 6; ``` ```eel2 a < 5 ? b = 6 : c = 7; ``` ```eel2 a < 5 ? ( b = 6; c = 7; ); ``` -------------------------------- ### Bitwise Right Shift Operator Source: https://www.cockos.com/EEL2/index.php The '>>' operator performs a bitwise right shift with sign-extension. Both values are converted to 32-bit integers. Negative shifts produce non-positive results. Shifts by more than 32 or less than 0 result in undefined behavior. ```eel value >> shift_amt ``` -------------------------------- ### Bitwise Left Shift Operator Source: https://www.cockos.com/EEL2/index.php The '<<' operator performs a bitwise left shift. Both values are converted to 32-bit integers. Shifts by more than 32 or less than 0 result in undefined behavior. ```eel value << shift_amt ``` -------------------------------- ### Sign Reversal Operator Source: https://www.cockos.com/EEL2/index.php The '-' operator returns the value with its sign reversed (equivalent to -1 * value). ```eel -value ``` -------------------------------- ### Perform Modified DCT (MDCT) in EEL2 Source: https://www.cockos.com/EEL2/index.php Applies a Modified Discrete Cosine Transform to data in the local memory buffer. The size must be a power of 2 between 64 and 4096. The MDCT overwrites the first half of the input buffer with the results. ```eel mdct(0, 512); ``` -------------------------------- ### Logical NOT Operator Source: https://www.cockos.com/EEL2/index.php The '!' operator returns the logical NOT of its parameter. If the parameter is 0.0, it returns 1.0; otherwise, it returns 0.0. ```eel !value ``` -------------------------------- ### String Substring and Character Access Source: https://www.cockos.com/EEL2/index.php Functions to extract substrings or access individual bytes/data types within a string. ```APIDOC ## String Substring and Character Access ### Description Functions to manipulate specific parts of a string or read/write binary data at specific offsets. ### Methods - **strcpy_from(str, srcstr, offset)**: Copies srcstr to str starting at offset. - **strcpy_substr(str, srcstr, offset, maxlen)**: Copies srcstr to str starting at offset with maxlen limit. - **str_getchar(str, offset[, type])**: Returns data at byte-offset. Supports types like 'c', 's', 'i', 'f', 'd' (signed/unsigned/endian variants). - **str_setchar(str, offset, value[, type])**: Sets value at byte-offset. ``` -------------------------------- ### Reference a literal string Source: https://www.cockos.com/EEL2/index.php Literal strings are immutable and referenced by a variable containing the string ID. ```EEL2 x = "hello world"; gfx_drawstr(x); ``` -------------------------------- ### MDCT and IMDCT Operations Source: https://www.cockos.com/EEL2/index.php Performs a Modified Discrete Cosine Transform or its inverse on data within a local memory buffer. ```APIDOC ## MDCT / IMDCT ### Description Performs a modified DCT or inverse MDCT on data in the local memory buffer. The MDCT replaces the first half of inputs with results, while the IMDCT takes size/2 inputs and produces size results. ### Parameters - **start_index** (integer) - Required - The offset in the local memory buffer. - **size** (integer) - Required - The size of the MDCT/IMDCT. Must be one of: 64, 128, 256, 512, 1024, 2048, or 4096. ### Note MDCT operations must not cross a 65,536 item boundary. ### Request Example mdct(0, 512); ``` -------------------------------- ### Unmodified Value Operator Source: https://www.cockos.com/EEL2/index.php The '+' operator returns the value unmodified. ```eel +value ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.