33 releases

0.2.12-alpha.0 Apr 7, 2023
0.2.11-alpha.0 Dec 19, 2022
0.2.5-alpha.0 Jun 21, 2022
0.2.4-alpha.0 Mar 14, 2022
0.1.42-alpha.0 Oct 27, 2021

#12 in #surge

Download history 130/week @ 2023-12-07 102/week @ 2023-12-14 153/week @ 2023-12-21 74/week @ 2023-12-28 106/week @ 2024-01-04 122/week @ 2024-01-11 99/week @ 2024-01-18 81/week @ 2024-01-25 76/week @ 2024-02-01 103/week @ 2024-02-08 158/week @ 2024-02-15 95/week @ 2024-02-22 109/week @ 2024-02-29 185/week @ 2024-03-07 111/week @ 2024-03-14 169/week @ 2024-03-21

588 downloads per month
Used in 62 crates (33 directly)

GPL-3.0 license

33KB
471 lines

surge-macros

Surge-macros is a Rust crate that provides a set of macros for the surge synthesizer system. Macros are a powerful tool in Rust that allow for code generation and metaprogramming, which can improve code readability and maintainability.

The surge-macros crate provides macros for various tasks such as defining and instantiating surge modules, setting module parameters, and processing audio signals. These macros can be used to generate Rust code for surge modules and signals, which can be compiled and run within the surge synthesizer system.

Mathematical Analysis

The surge-macros crate is primarily focused on code generation and metaprogramming, and does not involve significant mathematical analysis on its own. However, the macros provided by the crate can be used to generate Rust code for various signal processing algorithms and techniques, such as digital filtering, wave shaping, and frequency modulation.

For example, the crate includes a macro for computing the inner product of two blocks of audio samples, which is a fundamental operation in digital signal processing. The inner product of two blocks x and y can be computed using the formula:

ip = sum(x[n] * y[n]), for n = 0 to N-1

where N is the block size and x[n] and y[n] are the samples in blocks x and y, respectively. This formula can be used to compute the correlation between two signals, or to implement a variety of other signal processing algorithms.

Overall, the surge-macros crate provides a powerful tool for code generation and metaprogramming in the context of the surge synthesizer system. It can be used to generate Rust code for a variety of signal processing algorithms and techniques, and can improve code readability and maintainability.

Dependencies

~11–21MB
~297K SLoC