This operational approach makes it particularly suitable for live mixed music performances. The granulator can be configured in two distinct modes: as a multichannel sound effect with ambisonic output, or as an ambisonic sound effect when positioned between an ambisonic encoder and decoder.

## 4. MAXMSP WRAPPING

Throughout the development of our project, we have created numerous objects within the MaxMSP environment. To maintain workflow continuity, we developed a Max/MSP wrapper that facilitates interaction with the granulator within this development environment. The wrapper was initially designed to enable dynamic invocation of any Faust object by simply adjusting the number of channels within a bpatcher.<fnref n="3" /> The Figure 1 illustrates the variables within the wrapper, which include three additional options not originally present in the Faust code.

The first wrapper-specific option is the “channels” variable. By default, dynamically changing the number of channels for a Faust object within Max/MSP is not feasible. This variable, however, allows us to replace the Faust object by selecting the desired number of channels, thus offering greater flexibility in the development process.

The wrapper includes two additional variables, “randomize” and “dump”, each providing distinct functionalities. The “randomize” option assigns random values to all internal variables within their respective minimum and maximum ranges. This feature is crucial for exploring the full range of the granulator’s capabilities, especially given the complexity introduced by having 17 internal variables.

The “dump” option allows users to export the current configuration of the granulator for future retrieval with a single click. The interplay between the “randomize” and “dump” functions enables users to experiment with and save various configurations, facilitating both exploration and preservation of interesting settings.

## 5. ARCHITECTURE

The granulator’s behavior is determined by seven distinct components:

* Input filtering.

* Feedback loop of the input signal with delay.

* Grains generation.

* Modulation.

* Grains transposition.

* Spatial sound transformations.

* Feedback loop with transposition.

The Figure 2 represents these 7 modules. Subsequent sections will provide a detailed discussion of each module. It is crucial to note that two variables significantly influence the behavior of all other parameters in the granulator: the “variability” and “index distr” parameters (explained in Section 5.6.3). These variables introduce varying degrees of randomness into each of the other parameters, thereby impacting their behavior and interaction. The “variability” parameter modulates the extent of randomness applied, while the

<figure><img src="image_45.png" /><figcaption>Figure 1: *Max bpatcher*.</figcaption></figure>

<figure><img src="image_46.png" /><figcaption>Figure 2: *Simplified diagram*.</figcaption></figure>

“index distr” parameter governs how this randomness is distributed across the different channels or harmonics. Together, these variables play a central role in shaping the overall sonic output by dynamically altering the relationships between the granulator’s internal variables.

### 5.1. Input Filtering

The first effect applied to the input signal is a combination of low-pass and high-pass filtering. By default, the granulator does not apply any filtering to the input signal; however, it provides the flexibility to dynamically adjust the input filtering as needed.

### 5.2. Delayed Feedback Loop

The primary objective of this module is to blend the input signal with a delayed version of itself to create a more complex sound texture before segmenting it into grains. By adjusting the “maxdelay” variable, a delay is introduced to the input signal, which is

<footnote n="3">³A MaxMSP object that modularizes a patcher or subpatcher, displaying only specified visual elements in other patchers</footnote>
<figure><img src="image_47.png" /><figcaption>Figure 3: Input delayed feedback loop.</figcaption></figure>

<figure><img src="image_48.png" /><figcaption>Figure 4: Envelope design.</figcaption></figure>

then added to the input after being scaled by the “feedback” vari-
able. Figure 3 illustrates the structure of this module.

These two variables allow the user to either process the clean
input signal with no delay and zero feedback or to achieve a more
intricate effect by mixing the input signal with its delayed version,
with delays extending up to 10 seconds.

**5.3. Grains Generation**

This module is responsible for segmenting the processed input sig-
nal into grains. Two primary properties of the grain are addressed:
the size of the grain and the grain envelope. The grain size deter-
mines the duration of each grain, while the grain envelope controls
the temporal shape of the grain’s amplitude profile.

5.3.1. Grain Size

Instead of employing a rarefaction logic, the granulator operates
based on grain size and spacing. The grain size is calculated by
adding the “grainoffset” variable to the product of the “grainsize”
and the “variability” parameter. This configuration enables the
generation of grains with a uniform size or with sizes varying
within a specified range. The “spacing” variable multiplied by the
“variability” parameter will determine the spacing between grains.

5.3.2. Grain Envelope

After evaluating various envelope shapes, we determined through
experimental validation that a combination of Gaussian and loga-
rithmic waveforms provides optimal results. The “grainenvmorph”
variable enables dynamic adjustment of the envelope shape, rang-
ing from zero to one. A value of zero corresponds to a Gaussian
envelope, while a value of one corresponds to a logarithmic enve-
lope. Figure 4 illustrates the envelope shapes for different values
of the “grainenvmorph” variable. Figure 5 illustrates the creation
of grains while the “grainenvmorph” and “grainsize” variable are
changing.

**5.4. Envelope Amplitude Modulation**

Following the creation of each grain, this module enables the ap-
plication of amplitude modulation to each grain through a variable
modulation factor, "modfactor". Figure 6 depicts the grain enve-
lope under three conditions: without modulation, with 50% mod-
ulation, and with 100% modulation. The variable "modfreq" sets

<figure><img src="image_49.png" /><figcaption>Figure 5: Morphing between envelopes and different grain sizes.</figcaption></figure>

<figure><img src="image_50.png" /><figcaption>Figure 6: Envelope amplitude modulation.</figcaption></figure>

the frequency of the amplitude modulation, ranging from 1 Hz to
15 kHz. Figure 7 demonstrates the effects of envelope modulation
at three different frequencies: 10 Hz, 20 Hz, and 40 Hz.

Initially, the module utilized a single modulating signal for all
grains. This approach led to the perception of a single, continu-
ous tone after listening to a stream of grains, which did not align
with our objectives. To address this issue, we implemented phase-
controlled modulation for each grain. This modification ensures
complete decorrelation between the shapes of the modulated en-
velopes of the grains. By employing an ad hoc modulating signal,
the granulator is able to produce grains that share the same modu-
lation characteristics without creating a cohesive tonal effect.

5.4.1. Modulating Signal Morphing

The ability to morph the waveform of the modulating signal in an
amplitude modulation (AM) system plays a crucial role in shap-
ing the sound of the resulting signal. For instance, using a square
wave as the modulation signal tends to produce a bright, aggres-
sive sound, whereas a sine wave results in a smoother, softer tone.
The granulator’s “modmorph” feature acts as an interpolation con-
troller between four waveform signals: sine, sawtooth, square, and
sine again. Figure 8 illustrates the envelopes generated by varying
values of the “modmorph” variable. It is important to note that in-
teger values correspond to pure waveforms, while decimal values
result in a morphed shape that blends two adjacent waveforms.

The design choice to position a sine wave at both the beginning and end of the modulation cycle allows the user to create any conceivable morph between the three basic waveforms. This capability enables the creation of interesting effects through waveform morphing. By gradually transitioning from one waveform shape to another, either rapidly or slowly, users can achieve smooth or abrupt changes in sound texture. Figure 9 illustrates the process of

<figure><img src="image_51.png" /><figcaption>Figure 7: Variable "modfreq".</figcaption></figure>
<figure><img src="image_52.png" /><figcaption>Figure 8: Modulating signal morphing from sine to square.</figcaption></figure>

<figure><img src="image_53.png" /><figcaption>Figure 9: Mix of different modulating signals.</figcaption></figure>

wave morphing applied to the grain envelope.

### 5.4.2. Modulating the Frequency of the Amplitude Modulating Signal

In addition to modulating the amplitude of each grain's envelope, the granulator also offers a variable called "modfreqmod". This variable controls the degree of frequency modulation applied to the amplitude modulation of the envelope. Figure 10 illustrates the impact of varying the "modfreqmod" variable from zero to one. In this context, a value of 0.5 represents the absence of frequency modulation, while values closer to zero or one introduce increasing levels of frequency modulation to the amplitude modulation envelope. This transformation enables the creation of envelopes where the amplitude modulation can dynamically shift from a high frequency to a low frequency, or vice versa, with each new grain. This modulation process is applied every time a grain is generated, allowing for varied and evolving sound textures.

## 5.5. Grains Transposition

At this stage of the process, the grains are transposed within a range of -24 to +24 semitones.

## 5.6. Spatialisation

Given that one of CICM laboratory's primary focus on sound spatialization and our prior advancements in the field of ambisonic

<figure><img src="image_54.png" /><figcaption>Figure 10: Frequency modulation of the amplitude modulating signal.</figcaption></figure>

spatialization, we decided to integrate an ambisonic spatialization layer into the granulator. There are various approaches to constructing this spatialization layer, and we chose to implement two distinct methods, each designed to produce different sonic outcomes. Currently, we have developed two versions of the granulator, each catering to different musical requirements. The version presented in this paper differs from the second version, particularly in its approach to spatialization. Here we discuss this two approaches:

### 5.6.1. Spatial Sound Transformation

The version of the granulator presented in this paper employs a method we refer to as "spatial sound transformation". Unlike traditional spatialization approaches that focus on placing sound at a specific point in space, this approach leverages spatialization algorithms to create new and dynamic sound effects [6].

In this configuration, the granulator could function as a multi-channel effect, with each channel acting independently, but in order to achieve a more intricate spatial result, the granulator is positioned between an ambisonic encoder and decoder. This approach contrasts with the traditional method of granulating multiple channels, placing them on the space and then projecting them through a sound system. By using the granulator as an ambisonic effect between the encoder and decoder, we modify the spatial representation sent from the encoder to the decoder, effectively altering how the spatial audio is perceived.

This "spatial sound transformation" enables a wide array of sound effects, one example is spatial decorrelation [7]. By applying different delays to each ambisonic harmonic channel, we can alter the reconstruction of the final "sound image", leading to unique spatial effects. In Section 5.6.3, we will explore how each variable of the granulator is configured to respond to different distributions among the ambisonic harmonics, further enhancing the complexity and richness of the spatial effects.

### 5.6.2. From Point Source to Diffuse Field

The second implementation of the granulator adheres to a more conventional approach to spatialization. In this version, each grain is positioned randomly within the 2D space before entering the final feedback loop, that will be discussed in Section 5.7.

Since each grain is spatialized using an ambisonic encoder, an ambisonic decoder of the same order is required for proper interpretation. What makes this implementation particularly interesting is that the initial "image" of the spatialized sound is precisely positioned in a specific location within the space. However, as the sound is reintroduced through the feedback loop, these subsequent "images" become increasingly diffuse, ultimately creating a more complex and enveloping diffuse sound field. This approach leverages the spatialization algorithms to transition from a clearly defined spatial sound to a more ambient and immersive auditory experience.

### 5.6.3. Ambisonic Distribution

When the granulator is used between an ambisonic encoder and decoder, every channel of the granulator is modifying a specific spherical (for 3D) or circular harmonics (for 2D). As every harmonic adds complementary information to the final reconstruction of the spatialised sound, the question of how to alter the parameters of each harmonic becomes relevant. As each channel of the
<figure><img src="image_55.png" /><figcaption>Figure 11: *Ambisonic distributions.*</figcaption></figure>

granulator is modifying a specific harmonic, the way each internal parameter of every channel of the granulator relates to one another determines the characteristics of the final ambisonic reconstruction. There are numerous possibilities for distributing the granulator's internal parameters across the spherical or circular harmonics, ranging from high-level control parameters to specific adjustments for each harmonic. Our proposition for distributing how each internal parameter of each channel changes is based on the transfer functions proposed by Alain Bonardi and Paul Goutmann in the Faust "HOA" library. With this method the variables of each channel will change taking in account the selected transfer function and the number of the harmonic. The "index distr" variable enables users to select from various distribution patterns. Figure 11 illustrates the potential distributions as mathematical functions. The first distribution is "x" which represents a linear distribution. Upon selecting a specific ambisonic distribution, the internal parameters of each channel in the granulator are adjusted according to the "variability" parameter and the corresponding value from the selected transfer function. For instance, consider the impact on the first low-pass and high-pass filters. For each harmonic, or granulator channel, the frequency of these filters is calculated by taking the base frequency value and adding an additional component. This component is the product of the base frequency and a scaling factor ranging from zero to one, which is distributed across all the harmonics. For a linear transfer function, or "x", the resulting sonic effect is that the higher the harmonic level, the more pronounced the effect of each parameter becomes. This configuration creates a gradient of effects, where parameters such as filter frequency progressively intensify with the level of the harmonic, contributing to a more dynamic and evolving sound texture.

## 5.7. Grains Feedback Loop and Transposition

At this stage, a grain with specific spatial properties and a modified spectrum, thanks to filtering and modulation, has already been created. The final step in the granulator's process involves the collection of these grains through a feedback loop. This final loop enables the granulator to produce a continuous stream of grains rather than discrete, isolated grains at the output. As detailed earlier in this paper, parameters such as grain size, spacing, and other characteristics are adjusted before each grain is generated. The outcome is a flux of grains with varying sizes and spectral contents, which are accumulated within a time window specified by the "maxdelay" variable.

Figure 12 illustrates the configuration of this final feedback loop. A critical aspect of this module is the transposition within the feedback loop. As shown in Figure 12, each grain is initially

<figure><img src="image_56.png" /><figcaption>Figure 12: *Feedback loop and transposition of grains.*</figcaption></figure>

outputted without any transposition. However, subsequent feedback signal of the same grain are increasingly transposed. This setup produces an interesting sonic effect, as the echoes of each grain begin to "escape" into either very low or very high frequency spectrums. The variable "transpout" controls the degree of transposition applied, allowing the user to shape the extent of this spectral shift.

## 5.8. Smoothing

A 1024-sample transition buffer is employed for all input variables to smooth the input before it is applied. This smoothing mechanism mitigates abrupt changes that could otherwise result in audible clicks.

# 6. MACRO CONTROLS

The granulator has 17 internal variables, which exceeds what a performer can feasibly adjust simultaneously, especially when working with EMG/EEG signals that offer limited channels for control. To maximize the granulator's potential, we have discovered that employing advanced mapping algorithms, such as regression models and neural networks, can yield highly effective results. These approaches allow for the complex and dynamic manipulation of the granulator's parameters, enabling performers to explore a broader range of sonic possibilities despite the constraints of limited input channels.

### 6.1. Regression

By employing the regression algorithm "RapidMax",<fnref n="4" /> we successfully recorded various configurations of the granulator, enabling them to evolve in response to inputs provided to the regression model. This approach offers users the flexibility not only to explore the extensive possibilities of the granulator but also to record these configurations and seamlessly morph between them. This dynamic capability enhances the creative potential of the granulator, allowing for the development of evolving soundscapes and complex transitions between different sonic states.

### 6.2. One Layer Perceptron

A comparable approach to the regression model was adopted by developing a single-layer perceptron neural network using Faust. This implementation relies on vector and matrix multiplications to evaluate the perceptron. However, as of now, we have not developed a training algorithm, so this method remains in the experimental stage. Currently, we can only test random weights and biases until an interesting outcome is achieved. The lack of a systematic training process limits the full potential of this method,

<footnote n="4">⁴https://github.com/samparkewolfe/RapidMax</footnote>
but it represents a promising direction for future development in
generating and exploring novel sound configurations.

7. USER CASES AND FUTURE DEVELOPMENTS

Within the context of the BBDMI project, we have had the oppor-
tunity to test the granulator in various settings. This experience
has provided valuable insights into both the possibilities and limi-
tations of the granulator. In concert settings, we received positive
feedback regarding the granulator's sound, which has garnered in-
terest from composers and musicians. However, despite this initial
enthusiasm, many users eventually discontinue using the granula-
tor due to its complexity.

This issue highlights the need for further development of the
internal mapping algorithms to facilitate more accessible and in-
tuitive macro controls directly within the Faust-compiled object.
Simplifying the user interface while maintaining the granulator's
powerful capabilities is crucial for broader adoption.

8. ACKNOWLEDGMENTS

The research presented in this paper has been supported by the
French national research agency (ANR-21-CE38-0018).

9. REFERENCES

[1] Iannis Xenakis, *Formalized music: Thought and mathemat-ics in composition*, Bloomington : Indiana University Press, 1971.

[2] Curtis Roads, *Microsound*, The MIT Press. MIT Press, Lon-don, England, Aug. 2004.

[3] Horacio Vaggione, “Articulating microtime,” *Computer Mu-sic Journal*, vol. 20, no. 2, pp. 33–38, 1996.

[4] Barry Truax, “Real-time granular synthesis with a digital sig-nal processor,” *Computer Music Journal*, vol. 12, no. 2, pp. 14–26, 1988.

[5] Alain Bonardi, “La librairie abclib : un ensemble de codes Faust rassemblant 20 ans de recherche, enseignement et création en musique mixte,” in *Proceedings of the Journées d’Informatique Musicale 2021*, videoconferencing due to Covid, July 2021, AFIM.

[6] Paul Goutmann and Alain Bonardi, “Approaching spatial au-dio processing by means of decorrelation and ring modulation in ambisonics,” in *Proceedings of the 19th Sound and Mu-sic Computing Conference, June 5-12th, 2022, Saint-Etienne (France)*. 6 2022, Zenodo.

[7] Anne Sèdes, “Approche musicale de la décorrélation mi-crotemporelle dans la bibliothèque HOA,” in *Journées d’Informatique Musicale 2015*, université de Montréal, Ed., Montréal, Canada, May 2015, Université de Montréal.
# WIDGET MODULATION IN FAUST

Yann Orlarey

Univ Lyon, Inria, INSA Lyon, CITI, EA3720,
69621 Villeurbanne, France
yann.orlarey@inria.fr

Stéphane Letz

Univ Lyon, GRAME-CNCM, INSA Lyon,
Inria, CITI, EA3720, 69621 Villeurbanne,
France
letz@grame.fr

Romain Michon

Univ Lyon, Inria, INSA Lyon, CITI, EA3720,
69621 Villeurbanne, France
romain.michon@inria.fr

## ABSTRACT

This article presents a novel extension to the FAUST programming language called *Widget Modulation*. Inspired by *Modular Synthesizer*, this high order operation enables developers to effortlessly implement *voltage control type* modulation to existing FAUST circuits.

Although signal modulation can easily be achieved by writing the necessary code during circuit development, *Widget Modulation* expressions enable it a *posteriori*, after the circuit has been developed and without modifying its code. This feature allows for easy *reuse and customization* without prior planning by the original circuit designer, offering a new level of expressivity and flexibility in FAUST circuit design.

## 1. INTRODUCTION

The development of voltage control in analog sound synthesis, beginning in the mid-20th century, marks a milestone in the history of electronic music. This technique involves using electrical voltages to modulate various synthesizer parameters, such as the pitch or amplitude of an oscillator or the cutoff frequency of a filter. This capability allows synthesis parameters to evolve, imparting timbral richness, expressiveness, and dynamism to the sounds produced.

Key figures in the development of voltage control for analog sound synthesis include Hugh Le Caine, Robert Moog, and Don Buchla. Building on Hugh Le Caine's concept of the voltage-controlled oscillator (VCO), Robert Moog established a crucial standard for modular synthesizers known as 1V/oct, where an increase of one volt corresponds to a pitch change of one octave [1].

This standard enables a form of recursivity within the synthesizer itself: the sound signals produced by one module can control the parameters of other modules, including itself. This recursive capability is a key factor in the richness and complexity of the sounds generated by modular synthesizers. Let's quote Suzanne Ciani in [2]: "What we all love is the hands-on experience of patching and tweaking ... the way it engages both our brains and our bodies, the freedom of choice it offers, the individualism, the uniqueness."

Implementing *voltage control* principals, à la Modular Synthesizer, in FAUST [3] had always been straightforward. All we need to do is add an audio input and implement a *modulation operation* that describes how to combine this additional input signal with that of the widget we want to modulate. The modulation operation can be as simple as an addition or multiplication.

As an example, let's start with a simple oscillator: `myosc`, with a frequency control, but no modulation possibility:

```python
import("stdfaust.lib");
```

```python
myosc = vslider("freq[style:knob][scale:log]", 440, 20, 20000, 0.1)
: os.osc;
```

```python
process = myosc;
```

Let's now look at how to transform `myosc` to create a frequency modulation (FM) circuit [4]. To do this, we need to modulate the frequency of the oscillator by introducing the influence of another oscillator. Specifically, we will achieve this by adding the output signal of the second oscillator (`mymod`) to the frequency control (the `freq` widget) of the first oscillator, as in the following code:

```python
import("stdfaust.lib");
```

```python
myosc = +(vslider("freq[style:knob][scale:log]", 440, 20, 20000, 0.1))
: os.osc;
```

```python
mymod = hslider("fmod[style:knob][scale:log]", 110, 20, 1000, 0.01)
: os.osc * hslider("amod[style:knob]", 25, 0, 1000, 0.01);
```

```python
process = mymod : myosc;
```

The modification was minimal. All we had to do was add an input signal to `myosc` and sum it with the `freq` widget of the oscillator. However, we could do this because we had access to the source code of `myosc`. If `myosc` had been defined in a library, we would have had to either modify the library or duplicate the `myosc` code in our program.

As we will see, *Widget Modulation* allows us to do the same kind of transformation but without modifying the source code! It, therefore, makes FAUST's code reuse mechanisms, `library()` and `component()` even more useful.

## 2. EXAMPLES OF WIDGET MODULATION

Before a more formal description of *Widget Modulation*, let's consider some very simple examples using `dm.freeverb_demo` from the standard library.

Without inspecting the code, just by looking at the user interface of `dm.freeverb_demo` (figure 1) we can see the names of the various widgets that are involved and that could possibly be modulated.

Here we are interested in the `Wet` slider that controls the balance between the wet (reverbered) and dry (unprocessed) signals.

In order to modulate the `Wet` slider, we write:
<figure><img src="image_57.png" /><figcaption>Figure 1: Freeverb user interface.</figcaption></figure>

```python
[Wet] -> dm.freeverb_demo]
```

As we can see, the syntax of a *Widget Modulation* deliberately resembles that of a *lambda-abstraction*, although the semantics are quite different and the two should not be confused. Here the string `"Wet"` identifies the target of the modulation, the `vslider("Wet",...)` in the definition of `dm.freeverb_demo`. Because we didn't specify a modulation circuit, the modulation circuit is implicitly assumed to be a multiplication.

The resulting circuit has now three inputs: the new input for the modulation signal, and the original left and right inputs of the reverb. Moreover the signal delivered by the `"Wet"` slider is multiplied by the input modulation signal everywhere in the reverb circuit.

This extra input can now be connected to an oscillator to modulate the Wet parameter as in:

```python
1+os.osc(0.1)/4,_:_ ["Wet" -> dm.
                       freeverb_demo];
```

Here the modulation signal `1+os.osc(0.1)/4` is an oscillator with a frequency of 0.1 Hz, and an amplitude of 0.25. The `1+` is used to ensure that the modulation signal is between 0.75 and 1.25.

**Modulation Circuit.** In the previous example, we didn't indicate a modulation circuit. To do so, we use the symbol `':'` followed by the modulation circuit. For example `"Wet":+` indicates the use of an addition as a modulation circuit. It means that our previous example is equivalent to:

```python
1+os.osc(0.1)/4,_:_ ["Wet":* -> dm.
                       freeverb_demo];
```

By writing `"Wet":*` we explicitly stated to use a multiplication * as a modulation circuit. Please note that the `:` symbol in `"Wet":*` is used to separate the widget name from the modulation circuit and should not be confused with the sequential composition operator `:` , even if it also suggests an idea of connection.

We'll come back to this later, but a modulation circuit can be of three types. A circuit with *two inputs and one output*, like * or +; a circuit with *one input and one output*, like * (2); or a circuit with *no input and one output*, like 0.75.

1. Only a modulation circuit with two inputs, like `+` or `*` creates an external modulation input. Its first input is connected to the widget, and the second one becomes the modulation input.

2. Another possibility is to describe the entire modulation circuit in a single expression, in which case there is no need for an additional input, as in the following example:

```python
[Wet”:*(1+os.osc(0.1)/4) -> dm.
                       freeverb_demo];
```

3. Finally, we can completely replace the target widget with a modulation circuit that has no inputs, for example:

```python
[Wet":0.75 -> dm.freeverb_demo];
```

Then the slider will be removed from the user interface and replaced by a constant value of 0.75, with potential speed up of the computation.

Instead of replacing a widget with a constant, we can replace it with another widget, for example to change its name, style, range, etc.:

```python
[Wet":vsv slider("WetDry", 0.25, 0, 1,
                   0.01) -> dm.freeverb_demo];
```

In this case, all occurrence of `vsv slider("Wet", 0.25, 0, 1, 0.01)` in `dm.freeverb_demo` is replaced by `vsv slider("WetDry", 0.25, 0, 1, 0.01)`.

**Multiple Targets.** In the previous examples, we only had one target widget. We can specify more than one by separating them with commas as in the following example:

```python
[Wet", "Damp", "RoomSize" -> dm.
                       freeverb_demo]
```

The resulting circuit has five inputs, three modulation inputs and two reverb inputs. The first input modulates the `"Wet"` widget, the second the `"Damp"` widget, and the third the `"RoomSize"` widget. These three inputs are followed by the two inputs of the reverb.

Please note that the above expression is equivalent to the “curryfied” version:

```python
[Wet" -> ["Damp" -> ["RoomSize" -> dm.
                       freeverb_demo]]]
```
<figure><img src="image_58.png" /><figcaption>Figure 2: All gain controls are modulated by the same input.</figcaption></figure>

<figure><img src="image_59.png" /><figcaption>Figure 3: Only the gain of channel 2 is modulated.</figcaption></figure>

**Multiple Matches.** It might happen that the same name matches multiple widgets in different groups. In this case, all the matched widgets will be modulated by the same audio input.

In the following example we have a kind of two voices mixer:

```python
import("stdfaust.lib");

mixer = hgroup("mixer",
    par(i,2,
        vgroup("chan %2i",
            *(vslider("gain", 0, 0, 1,
                       0.01))
        )
    )
);

process = ["gain" -> mixer];
```

Since in both channels we have “gain” widget, the modulation will affect both channels as we can see on the bloc-diagram figure 2.

For a more specific selection of the target widget, we can include the names of some or all of the enclosing groups of the target widget, as in `"v:chan 1/gain" -> mixer`. Here, only the gain of channel number 1 will be modulated (see figure 3).

### 3. SYNTAX OF WIDGET MODULATION

In the preceding examples, we have provided an informal overview of *Widget Modulation*, aiming to offer a relatively intuitive understanding. Now, we will present a more formal description using syntactic rules in Backus-Naur Form (BNF), starting from the *Widget Modulation* expression itself:

<figure><img src="image_60.png" /><figcaption>Figure 4: *WidgetModulationExpression*.</figcaption></figure>

<figure><img src="image_61.png" /><figcaption>Figure 5: *Target*.</figcaption></figure>

#### 3.1. *WidgetModulationExpression*

```
WidgetModulationExpression
    ::= '[' Target ( ',' Target )*
        '->' Expression ']'
```

A *Widget Modulation* expression is composed of a list of target widgets and a modulated expression in which the target widgets are presumably used. The targets are separated by a comma sign (`,`). There must be at least one target. A *Widget Modulation* without targets is not allowed. The targets and the modulated expression are separated by the sign `->`, and the whole *Widget Modulation* expression is enclosed in square brackets.

#### 3.2. *Target*

```
Target ::= '"' WidgetPath '"' (':' ModulationCircuit )?
```

A *Target* is composed of a *WidgetPath* that identifies the widget to modulate, and an optional *ModulationCircuit* that indicates how to combine the signal delivered by the widget with the modulation signal. If no *ModulationCircuit* is provided, the default is multiplication.

#### 3.3. *WidgetPath*

```
WidgetPath
    ::= ( ( 'h:' | 'v:' | 't:' )
        GroupLabel '/' )* WidgetLabel
```

The *WidgetPath* is used to identify widgets in a modulated expression. It is a string composed of a widget label, optionally preceded by a sequence of group labels separated by slashes. The widget label is matched after removing any metadata. Group labels are used to disambiguate the widget to match, but they do not have to be consecutive.

<figure><img src="image_62.png" /><figcaption>Figure 6: *WidgetPath*.</figcaption></figure>
## 3.4. ModulationCircuit

The *ModulationCircuit* describe how to modulate the signal produced by the target widget. It can be any FAUST circuit with up to two inputs and one output. Three cases have to be considered:

* (2 → 1): A binary circuit with two inputs and one output, for example + as in "Wet":+. In this case, and only in this case, an additional input is created and the value of the widget is combined into the binary circuit before being used in the modulated expression.

* (1 → 1): A unary circuit with one input and one output, for example *(lfo(10, 0.5)) as in "Wet":*(lfo(10, 0.5)). In this case, the value of the widget is routed into the unitary circuit before being used in the modulated expression, and no additional input is created.

* (0 → 1): A constant circuit with no input and one output, for example 0.75 as in "Wet":0.75. In this case all the occurrences of widget are simply removed and replaced by the constant circuit in the modulated expression. This is convenient to simplify a rich interface when some widgets that are not needed. In this case, no additional input is created.

## 3.5. Compilation

*Widget Modulation* is a circuit transformation primitive that is handled in the first phase of the compilation process. During this phase the FAUST program is evaluated to produce a circuit in normal form (a flat circuit composed solely of interconnected primitives).

Let's illustrate this process on our previous example:

```
[Wet":*(1+os.osc(0.1)/4) -> dm.
  freeverb.demo]
```

The compiler first evaluates *(1+os.osc(0.1)/4) and dm.freeverb.demo into their respective normal forms c1 and c2. It then computes the normal form of `["Wet":*(1+os.osc(0.1)/4)-> dm.freeverb.demo]` by replacing every widget w labeled "Wet" occurring in c2 with w:c1.

As a circuit transformation, *Widget Modulation* represents a new type of operation for FAUST, distinct from circuit composition operations (:, , \~, <; , :>), which assemble existing circuits without transforming them. Despite this distinction, *Widget Modulation* fully aligns with the philosophy of a programming language dedicated to the description and implementation of audio circuits.

# 4. EXAMPLES OF MODULATION CIRCUITS

The ability to specify our own modulation circuits provides a lot of flexibility and expressiveness to *Widget Modulation*. Here, we give some examples of modulation circuits, some of which exploit the fact that it is possible to know the minimum and maximum values of a signal using the primitives lowest and highest, thereby ensuring that the signal after modulation remains within the widget's limits.

## 4.1. Frequency Modulation

Let's start with a simple example of frequency modulation showing the usage of simple additive and multiplicative modulations.

<figure><img src="image_63.png" /><figcaption>Figure 7: Simple frequency modulation.</figcaption></figure>

We first define an oscillator with its own user interface consisting of two widgets, one controlling its frequency and the other its amplitude.

```R
osc(n) = hgroup("osc %2n", os.osc(f) * g
  with {
    f = vslider("freq[scale:log][style:knob
  ][unit:Hz]",440,0.25,20000,1);
    g = vslider("gain[style:knob]", 0, 0,
      1, 0.01);
  });
```

The n parameter is used in the group label to distinguish oscillators, so that we can use more than one. The minimal value for the frequency, 0.25 Hz, is deliberately outside the audible range in order to use the oscillator also as a LFO.

Let's look at a first example of frequency modulation using an addition as the modulation circuit:

```R
process = osc(1) : ["freq":+ -> osc(2)];
```

The user interface and resulting spectrum are shown in figure 7. We recognize a FM spectrum, but the amplitude of the modulation oscillator is not high enough to obtain a rich spectrum. We can fix the problem by amplifying the modulation signal:

```R
process = osc(1)*500 : ["freq":+ -> osc(2)];
```

This gives us the spectrum figure 8.

Now let's add a third modulation stage, to modulate the "gain" of oscillator 1 and obtain a periodic variation in the spectrum:

```R
process = osc(0)+1 : ["gain" -> osc(1)*500]
  : ["freq":+ -> osc(2)];
```

The resulting program can be try on line here

## 4.2. Advanced Modulation Circuits

In the previous examples, we did not account for the possibility of the modulated widget signal exceeding the limits of the initial widget. However, there are scenarios where this is important. Therefore, we now present several more advanced modulation circuits that ensure that the output value respects the range of values of
<figure><img src="image_64.png" /><figcaption>Figure 8: Improved FM circuit.</figcaption></figure>

the widget `w`. As a reminder, we can determine the minimum and maximum values of a signal using the `lowest` and `highest` primitives.

**addp and add modulations.** The principle here is to add a value taken between two limits to the widget. A distinction is made between two cases, depending on the nature of the modulation signal. It could be a positive modulation signal, between 0 and +1, such as the signal from an envelope follower. Alternatively, it could be an audio signal, between -1 and +1, such as the signal from an oscillator. The obtained value is then clipped to the limits of the widget.

The first function, `addp`, adds to the widget `w` a value between `v1` and `v2` based on a positive modulation signal `m` ranging from 0 to +1:

```hml
addp(v1,v2,w,m) = max(lo, min(hi, w + v))
with {
    lo = lowest(w);
    hi = highest(w);
    v = v1+m*(v2-v1);
};
```

The second function, `add`, adds to the widget `w` a value between `v1` and `v2` based on an audio modulation signal `m` ranging from -1 to +1.

```hml
add(v1,v2,w,m) = addp(v1,v2,w, (m+1)/2);
```

**mulp and mul modulations.** The first function `mulp` multiply the widget value `w` by a factor between `f1` and `f2` based on a positive modulation signal `m` ranging from 0 to +1.

```hml
mulp(f1,f2,w,m) = max(lo, min(hi, w * f))
with {
    lo = lowest(w);
    hi = highest(w);
    f = f1+m*(f2-f1);
};
```

The second one `mulp` multiply the widget value `w` by a factor between `f1` and `f2` according to an audio modulation signal `m` ranging from -1 to +1.

```hml
mul(f1,f2,w,m) = mulp(f1,f2,w, (m+1)/2);
```

**mapp and map modulations.** These last two functions allow you to completely replace a widget (causing it to disappear from the user interface) with a value that varies between two bounds controlled by a modulation signal. The first function `mapp` replaces the widget by a value between `v1` and `v2` based on a positive modulation signal `p` ranging from 0 to +1.

```hml
mapp(v1,v2,w,p) = v1 + p*(v2-v1);
```

### 4.3. Revisiting the Frequency Modulation Example

We can apply these new functions to revisit our frequency modulation example. Let's start by defining an `md` environment containing all our modulation functions:

```hml
md = environment {
    addp(v1,v2,w,m) = max(lowest(w), min(
        highest(w), w + v))
    with {
        v = v1+m*(v2-v1);
    };

    mulp(f1,f2,w,m) = max(lowest(w), min(
        highest(w), w * f))
    with {
        f = f1+m*(f2-f1);
    };

    mapp(v1,v2,w,p) = v1 + p*(v2-v1);

    add(v1,v2,w,m) = addp(v1,v2,w, (m+1)/2);
    mul(f1,f2,w,m) = mulp(f1,f2,w, (m+1)/2);
    map(v1,v2,w,m) = mapp(v1,v2,w, (m+1)/2);
};
```

The revised frequency modulation example is as follows:

```hml
process = osc(0)
    : ["freq":md.add(-500,500) -> osc
        (1)];
```

It is interesting to note that the same target widget can be modulated several times by different modulation circuits. In the following *Widget Modulation* expression, two modulation circuits are applied to the same “freq” widget. It is first modulated by an `add(-600,600)`, and the result by a `mul(0.1,10)`:

```json
["freq":md.add(-600,600), "freq":md.mul
  (0.1,10) -> osc(1)]
```

The circuit figure 9, shows how this double modulation is implemented.

To complete this section, here is a more elaborate example. It combines double frequency modulation—by an oscillator and by its own output signal via feedback—with the modulation of the “gain” widgets of these two oscillators by a third oscillator.

```hml
process = osc(0) : ["gain":md.add(0,0.5) ->
    (_ ,osc(1)): ["freq":md.add(-600,600), "
    freq":md.mul(0.1,10) -> osc(2)]}@ (200)
] <:_,@(5000);
```
<figure><img src="image_65.png" /><figcaption>Figure 9: *Double modulation of the "freq" widget.*</figcaption></figure>

## 5. CONCLUSION

This article introduces *Widget Modulation*, a novel extension to the FAUST programming language. This high-order primitive directly manipulates audio circuits, marking the first instance of such functionality within FAUST.

Inspired by the principles of modular synthesizers, *Widget Modulation* enables developers to seamlessly implement voltage control-type modulation into existing FAUST circuits. This allows for the redesign of user interfaces without necessitating direct access to the underlying source code.

While mastering the use of *Widget Modulation* may require time, its potential to significantly influence the development of FAUST libraries is substantial [5]. Users will be empowered to create libraries of modules, akin to those found in modular synthesizers, featuring rich and detailed user interfaces, with the assurance that a posteriori customization remains feasible. Furthermore, the extension opens avenues for the development of new libraries dedicated to modulation circuits.

## 6. REFERENCES

[1] Laurent de Wilde, *Les fous du son, d'Edison à nos jours*, Grasset, 2016.

[2] Suzanne Ciani, *Foreword*, Bjooks, May 2018.

[3] Yann Orlarey, Stéphane Letz, and Dominique Fober, *New Computational Paradigms for Computer Music*, chapter “Faust: an Efficient Functional Approach to DSP Programming”, Delatour, Paris, France, 2009.

[4] John M. Chowning, “The synthesis of complex audio spectra by means of frequency modulation,” *Journal of the audio engineering society*, vol. 21, no. 7, pp. 526–534, 1973.

[5] Julius O. Smith, “Signal processing libraries for Faust,” in *Proceedings of Linux Audio Conference (LAC-12)*, Stanford, USA, May 2012.
# ASSESSMENT OF SIMULATIONS IN FAUST AND TASCAR FOR THE DEVELOPMENT OF AUDIO ALGORITHMS IN ACOUSTIC ENVIRONMENTS

Felix Holzmüller

Institute of Electronic Music and Acoustics
University of Music and Performing Arts
Graz, Austria
holzmueller@iem.at

Christian Blöcher

Institute of Electronic Music and Acoustics
University of Music and Performing Arts
Graz, Austria
bloecher@iem.at

Alois Sontacchi

Institute of Electronic Music and Acoustics
University of Music and Performing Arts
Graz, Austria
sontacchi@iem.at

## ABSTRACT

Testing real-time capable audio algorithms in a time-variant acoustic environment can be a tedious process, often requiring specialised hardware to fulfil latency constraints. In this publication, an alternative approach based on an acoustic scene simulation in TASCAR and signal processing using FAUST is assessed and tested against actual measurements. In dry acoustic environments, a good match of level distribution and spatial coherence at various evaluated points can be observed when modelling direct sound and early reflections. A simulation of an ANC algorithm shows also comparable performance to a measurement-based reference. Larger deviations are observed for reverberant and anisotropic scenarios. The proposed toolchain can be used for low-cost development and assessment of real-time capable algorithms in time-variant acoustic scenarios, as all parameters and virtual positions can be updated during operation.

## 1. INTRODUCTION

The development and testing of real-time capable audio algorithms can be a complex undertaking. Some algorithms like active noise control (ANC) are especially time critical and cannot be tested in the real world with common audio hardware and processing on an ordinary computer. Therefore, specialised hardware such as Field Programmable Gate Arrays (FPGAs) or digital signal processors (DSPs) are usually needed, which are often associated with considerable programming effort. Although dedicated rapid prototyping platforms are lowering the entry barrier by supporting higher-level code written in FAUST [1, 2, 3] or MATLAB/Simulink, they are generally costly and not always easily accessible. Another issue of testing systems in reality is a limited repeatability. Even small variations, for example inaccuracies in the geometrical arrangement of acoustic sources and receivers, can change the exact outcome of an experiment. A viable alternative to testing algorithms in the real world can be the combination of a time-variant, real-time capable acoustic simulation environment with an implementation of the algorithm under test in FAUST for a realistic simulation of its behaviour.

TASCAR<fnref n="1" /> [4] is an open-source program for rendering acoustic scenes. Originally developed for hearing aid research, it features time-domain methods like a geometric room-acoustic simulation using an image source model (ISM), an implementation of a simple feedback-delay network (FDN) for diffuse reverberation, and various source and receiver types. A unique feature compared to other simulation tools is the ability to run simulations in real-time

with inputs and outputs provided as JACK Audio<fnref n="2" /> connections. All parameters of objects like position and orientation can be changed via Open Sound Control (OSC)<fnref n="3" /> during operation. This enables researchers to conduct experiments in virtual scenes with variable positions in real-time.

As TASCAR only handles acoustic scene creation, the algorithm under test has to be implemented separately. Here FAUST's ability to compile applications for various architectures comes into play. FAUST has already been used successfully for implementing active noise control algorithms [2, 3]. After an algorithm is implemented in FAUST, it can be compiled as standalone JACK application with the faust2ja[...] tools. This application can receive signals from TASCAR, process them, and send them back to the acoustic scene simulation. Due to JACK's real-time capability, only a small delay equal to the audio device's block size is introduced.

The aim of this publication is to assess the capability of TASCAR and FAUST for testing and evaluation of time-variant audio algorithms compared to a co-simulation, based on recorded signals and measurements. In section 2, the acoustic scene simulation in TASCAR and the performed measurements are described. Section 3 compares acoustic properties of the recorded sound field and the acoustic scene simulation for different rooms and varying level of detail in the simulation. Section 4 showcases the use of TASCAR and FAUST for an ANC algorithm before summarising the findings in section 5. Measurements and code are openly accessible [5].

## 2. MEASUREMENTS AND SIMULATIONS

To assess the validity and accuracy of the simulation, acoustic properties and the ANC algorithm are evaluated for two different rooms:

* An acoustically treated measurement chamber with non-parallel walls, dimensions of approximately 5 m × 4 m × 3 m, and a reverberation time of less than 50 ms above 300 Hz and less than 30 ms above 1 kHz.

* A meeting room with an overall reverberation time of about 0.9 s and anisotropic acoustic properties (surfaces with absorbers, glass, plasterwall, and wooden cabinets).

Figure 1 shows the floor plan of both rooms.

### 2.1. Measurements

In the measurement chamber and meeting room, respectively, an arrangement of eight and four Genelec 8020B loudspeakers was em-

<footnote n="1">¹https://www.tascar.org</footnote>

<footnote n="2">²https://jackaudio.org/</footnote>

<footnote n="3">³https://opensoundcontrol.stanford.edu</footnote>
<figure><img src="image_66.png" /><figcaption>Figure 1: Floor plans of the evaluated rooms with positions of primary loudspeakers (gray), secondary loudspeakers (orange), and the microphone array (black bar) with indicated central position (red cross).</figcaption></figure>

ployed as acoustic source. It was ensured that the level differences between loudspeakers were below 1 dB.

The sound field in the rooms was recorded via an arrangement of 25 measurement microphones (NTi MA2230), uniformly spaced with a distance of 5.5 cm on a straight line, extending from the centre of the loudspeaker arrangement. The microphones are class 1 certified according to IEC 61672 and equipped with a 1/2" capsule. After measurements, all microphones were calibrated using a Brüel & Kjær 4231 calibrator.<fnref n="4" /> The microphone arrangement is shown in figure 2.

<figure><img src="image_67.png" /><figcaption>Figure 2: Microphone arrangement in the meeting room.</figcaption></figure>

A DirectOut ANDIAMO AD/DA converter and microphone preamplifier provided in- and outputs for microphones and loud-

speakers. The device, running at 44.1 kHz sample rate, was connected via MADI with an RME sound card (HDSPe MADI in the measurement chamber, Madiface Pro in the meeting room) to the measurement PC. Any occurring latency caused by the AD/DA conversion was measured and compensated on the recordings.

The sound field was captured for several primary source configurations with loudspeakers playing uncorrelated uniform white noise. In the first configuration all loudspeakers were playing, while in the second configuration only the loudspeaker pointed at by the microphone arrangement was active. With this source position defined as 0°, an additional configuration with four active loudspeakers at {0°, 90°, 180°, 270°} was recorded in the measurement chamber. Additionally, impulse responses between each loudspeaker and microphone were obtained using multiple exponential sine-sweeps [6]. For the ANC co-simulation, an additional loudspeaker acting as a secondary source positioned closer to the central position was set up as measured as indicated in figure 1. This speaker was not present during measurements of the primary sound sources.

## 2.2. Simulation

The geometry and transducer locations of both assessed rooms were recreated in TASCAR for acoustic scene simulations. As receivers in simulations do not influence the sound field nor have any placement constraints, a finer grid of measurement positions with a spacing of 0.5 cm, that also extended closer to the source at 0°, was chosen.<fnref n="5" />

To assess the capability of TASCAR for acoustic sound field simulations, different degrees of accuracy were implemented. In the most basic case, only a free field scenario without any reflections is considered. In the next case, early reflections are simulated based on a 2^nd^ order ISM. Estimations for the frequency dependent absorption coefficients are used based on the surface materials. Values were used from the manufacturer's data sheet on the absorber material in the measurement chamber [7] and from a comprehensive, openly accessible database of common materials [8]. To increase the grade of detail further, in the next case the sources' directivity is adjusted. TASCAR has a *cardioidmod* source type, where a cardioid directivity pattern is achieved at a defined frequency. Towards lower frequencies an omnidirectional, towards higher frequencies a narrower directivity is modelled. To get an estimate for the frequency at which the cardioid pattern should be reproduced, the magnitude response of the physical loudspeaker was measured at 0° and 90° horizontal angle. The frequency at which both responses started to diverge by 6 dB, 940 Hz, was used as the value for the simulation. In the last case, a diffuse FDN reverb [9] with the reverberation time taken from the measurements is added. The different degrees of accuracy for all cases are summarised in table 1.

<table><caption>Table 1: Description of the simulations' degree of accuracy.</caption><thead><tr><td>Case</td><td>Description</td></tr></thead><tbody><tr><td>0</td><td>Free-field conditions</td></tr><tr><td>1</td><td>2<sup>nd</sup> order image source model (ISM)</td></tr><tr><td>2</td><td>2<sup>nd</sup> order ISM + source directivity</td></tr><tr><td>3</td><td>2<sup>nd</sup> order ISM + source directivity + FDN reverb</td></tr></tbody></table>

<footnote n="4">⁴Due to a too high preamplifier gain in the measurement chamber, the calibrator's signal at 94 dB caused clipping. Therefore, the digitally set-table amplifier gain has been reduced by 10 dB for calibration in this case. Subsequently, the lower gain was used for the meeting room recordings.</footnote>

<footnote n="5">⁵The simulations are split into several segments with smaller numbers of receivers to reduce computational load and memory requirements.</footnote>
For the room acoustic evaluation, the acoustic scene was rendered offline on a high performance computing node for faster calculation as the input signal is known beforehand. Real-time simulations are performed on an ordinary notebook.

## 3. ROOM ACOUSTIC PARAMETERS

To assess the quality and accuracy of the recreated, simulated sound field, two properties are evaluated and compared to measurements for every source setup - the level distribution and the spatial coherence along the microphone arrangement.

### 3.1. Level Distribution

As quite simple yet effective measure, the level distribution is based on 30 s long recordings of uncorrelated uniform white noise for each source configuration (one, four or eight loudspeakers). After applying the individual calibration for each microphone, the respective root mean square (RMS) levels are calculated. The same noise realisation has also been used as input signal for the simulations in TASCAR for the respective source configurations.

<figure><img src="image_68.png" /><figcaption>(a) 1 loudspeaker</figcaption></figure>

<figure><img src="image_69.png" /><figcaption>(b) 4 loudspeakers</figcaption></figure>

Figure 3: Comparison of measured and simulated sound level distributions relative to the levels at the central position in the meeting room along the microphone array.

Figures 3 and 4 show the level distributions with different source configurations and rooms. All curves are normalised to the level at the central position. In the measurement chamber with

<figure><img src="image_70.png" /><figcaption>(a) 1 loudspeaker</figcaption></figure>

<figure><img src="image_71.png" /><figcaption>(b) 4 loudspeakers</figcaption></figure>

<figure><img src="image_72.png" /><figcaption>(c) 8 loudspeakers</figcaption></figure>

Figure 4: Comparison of measured and simulated sound level distributions relative to the levels at the central position in the measurement chamber along the microphone array.

almost free field conditions towards higher frequencies, only minor differences between simulations and measurements can be observed. However, in the more reverberant meeting room, differences between the simulation cases are more obvious. With only one source active, simulation case 0 with only free field conditions shows a too steep rise in level, as the influence of the room reflections are neglected here. With four active sources in figure 3(b), cases 2 and 3 result in a decrease in level when leaving the central position.
Most likely *cardioidmod* sources exhibit too much directivity towards high frequencies, generating a too narrow sweet spot at the central position. Over all scenarios, the simulations with early reflections and omnidirectional source directivity (case 1) deliver the most accurate results. Small ripples in the measured levels around the central positions can be observed, most likely due to variances between the measurement microphones.

## 3.2. Spatial Coherence

A second parameter often used to describe sound fields is the spatial correlation between two points. It was initially proposed as additional parameter to describe the acoustics of a closed room [10]. Various authors derived analytical results for the correlation in various scenarios [11, 12, 13]; In the most notable finding by Cook et al. [10], it takes the form

$$R = \frac{\sin(kr)}{kr} \qquad (1)$$

in a pure-tone diffuse sound field, where $k = \frac{2\pi}{\lambda}$ is the wave number with wavelength $\lambda$ and $r$ the distance between the two observed points.

Measuring the spatial correlation can be a tedious and time consuming process, as usually only a single frequency can be assessed at once. A faster, alternative approach is to play and record a broadband signal and calculate the coherence. It has been shown by Jacobsen and Roisin [14], that the coherence at the evaluated frequency corresponds to the squared correlation, if a sufficiently fine analysis bandwidth is chosen. With this technique, all excited frequencies can be evaluated using only a single measurement.

The coherence is analysed and compared for three different frequencies of {300, 1000, 1700}Hz, all of which lie above the Schroeder frequency [15] for both assessed rooms (approximately 60 Hz in the measurement chamber and 260 Hz in the meeting room). Figure 5 shows the results for the measurement chamber. Unsurprisingly, the coherence in these close to free field conditions is estimated perfectly as unity over all positions for a single source. Also for four and eight sources a good resemblance of the measurements can be observed over the whole assessed range. Interestingly, simulation case 0 without any early reflections performs best at 300 Hz. This could be explained by a sub-optimal choice of absorption coefficients for the ISM.

The coherence in the meeting room in figure 6 shows larger differences between measurements and simulations. While simulations perform relatively well at lower frequencies at positions close to the reference location, less resemblance is seen with increased frequency and distance. This behaviour can be explained by the lack of proper diffuse reverberation. Discrepancies between measurement and simulations with a single source at low frequencies are most likely the result of room modes which cannot be reproduced by a 2nd order ISM.

# 4. APPLICATION FOR ACTIVE NOISE CONTROL

To show the capabilities of the proposed toolchain for real-time processing, a co-simulation of an active noise control algorithm based on actual measurements is compared to a full simulation in TASCAR and FAUST. Before describing the details of the simulation setup, the basics of signal processing for active control are presented.

## 4.1. Feedforward Filtered-X Least Mean Squares Filter

ANC can be implemented using different fundamental designs. As this section only highlights the relevant portions of the algorithm for the investigated scenario, the interested reader may be referred to more detailed literature [16, 17].

A feedforward system can be used to control both deterministic and random disturbances. A time-advanced reference signal $x[n]$ is captured, filtered by a so-called control filter $W(z)$, and played back via transducers, also referred to as secondary sources. The control signal $u[n]$, the signal for the secondary sources, can therefore be described in $z$ domain as

$$U(z) = W(z)X(z), \qquad (2)$$

where e.g. $X(z)$ corresponds to the $z$-transform of $x[n]$. The residual error signal at the listening position is now found as the superposition of the primary disturbances $d[n]$ and the control signal $u[n]$, whereby the alterations to the signal by the acoustic plant $G(z)$ between the secondary source and the listening position have to be considered as well. This results in

$$E(z) = D(z) + G(z)U(z) = D(z) + G(z)W(z)X(z) \qquad (3)$$

for the $z$-transform of the residual error.

ANC often relies on adaptive filters to compensate for slight variations in the acoustic scenario. An ordinary least mean squares (LMS) filter cannot be used in this case, as the output of the control filter is altered by the acoustic transfer path $G(z)$ before summation with the disturbances [18]. However, a trick can be used to find a suitable structure. Assuming both the acoustic plant $G(z)$ and the control filter $W(Z)$ are in a modelling phase linear and time-invariant systems, the position of the two blocks can be switched due to their commutative property. Now the reference signal is first filtered by the plant, producing the so-called filtered reference signal $r[n]$, which is then used as input for the control filter. In time domain, this results in the error signal

$$e[n] = d[n] + \mathbf{w}^T \mathbf{r}[n], \qquad (4)$$

where $\mathbf{w} = [w_0, w_1, \dots, w_{N-1}]^T$ holds the coefficients of the control filter, $\mathbf{r}[n] = [r[n], r[n-1], \dots, r[n-N+1]]^T$ is a buffer of filtered reference signals, and $N$ corresponds to the control filter order.

As the control filter output now directly contributes to the residual error signal, its coefficients can be adapted with an LMS approach as

$$\mathbf{w}[n+1] = \mathbf{w}[n] - \mu \mathbf{r}[n]e[n], \qquad (5)$$

where $\mu$ is the adaptation stepsize.

As in a real physical system plant and control filter cannot be switched, the reference signals are filtered for adaptation with an estimate or measurement of the plant response $\hat{G}(z)$. This algorithm is known as *filtered-x* or *filtered-reference LMS* (FxLMS) filter.
<figure><img src="image_73.png" /><figcaption>(a) 1 loudspeaker, f = 300 Hz</figcaption></figure>

<figure><img src="image_74.png" /><figcaption>(b) 1 loudspeaker, f = 1000 Hz</figcaption></figure>

<figure><img src="image_75.png" /><figcaption>(c) 1 loudspeaker, f = 1700 Hz</figcaption></figure>

<figure><img src="image_76.png" /><figcaption>(d) 4 loudspeakers, f = 300 Hz</figcaption></figure>

<figure><img src="image_77.png" /><figcaption>(e) 4 loudspeakers, f = 1000 Hz</figcaption></figure>

<figure><img src="image_78.png" /><figcaption>(f) 4 loudspeakers, f = 1700 Hz</figcaption></figure>

<figure><img src="image_79.png" /><figcaption>(g) 8 loudspeakers, f = 300 Hz</figcaption></figure>

<figure><img src="image_80.png" /><figcaption>(h) 8 loudspeakers, f = 1000 Hz</figcaption></figure>

<figure><img src="image_81.png" /><figcaption>(i) 8 loudspeakers, f = 1700 Hz</figcaption></figure>

Figure 5: Comparison of the spatial coherence of measured and simulated sound fields in the measurement chamber between the central position and points along the microphone array at distance *r* for analysis frequencies *f* with corresponding wavenumber *k*.
<figure><img src="image_82.png" /><figcaption>Figure 6: Comparison of the spatial coherence of measured and simulated sound fields in the meeting room between the central position and points along the microphone array at distance *r* for analysis frequencies *f* with corresponding wavenumber *k*.</figcaption></figure>
## 4.2. Simulation Setup

The goal of the ANC experiment is to determine FAUST's and TASCAR's ability to perform simulations for audio algorithms. In this context, the real-time capability of standalone applications written in FAUST constitutes a vital prerequisite for the success of the combined simulation approach. As the focus lies on both feasibility and comparability to measurements, only a setup with a single primary source at 0° and a single receiver at the central position is assessed for both rooms and all degrees of detail for the simulations at 22 050 Hz sample rate. All experiments are performed on an ordinary notebook (Intel Core i7-13700H with 32 GB RAM, running Ubuntu Studio 24.04).

The FxLMS algorithm described in section 4.1 is implemented in FAUST. The secondary transfer path $\hat{G}(z)$ is obtained by rendering an impulse response in TASCAR between the secondary source and the receiver position. Both the adaptive filter and the plant $\hat{G}(z)$ are implemented as FIR filters with 128 taps<fnref n="6" /> ($\hat{G}$ is 5.8 ms). For more efficiency, the predelay, i.e. the acoustic time of flight between source and receiver, is cut from the secondary path and modelled as a simple delay. A white noise innovation signal is played back by pure data (pd). For optimal performance, it is used both as signal for the primary source in TASCAR and as reference signal $x[n]$ for the FxLMS algorithm. The secondary path filter $\hat{G}(z)$ and the adaptive filter itself are compiled as two separate programs. The FxLMS filter generates the control signal $u[n]$ for the secondary sources, which is routed to TASCAR as well. TASCAR renders the signal at the virtual microphone position sample by sample in real-time, based on the primary and secondary sources' signals with the selected degree of detail. The resulting residual error signal $e[n]$ is then recorded in pd and transmitted to the FxLMS filter for adaptation as well. Figure 7 shows the signal flow of the ANC simulation. For bulk processing and better repeatability, central control of the ANC experiment (e.g. initialisation of all applications and scenes, setting parameters via OSC) is implemented in Python, while the JACK connections are built automatically with the `jcmess` utility.

<figure><img src="image_83.png" /><figcaption>Figure 7: Signal flow of the ANC simulation using pure data (white), FAUST (blue) and TASCAR (orange).</figcaption></figure>

All FAUST scripts are compiled as standalone JACK application by the `faust2jaqt` tool. The signals are routed using JACK Audio with the virtual dummy driver at 22 050 Hz sample rate and a block size of 16 samples. Due to the recursion of the error signal

back into the FxLMS block for adaptation and to pd for recording, a latency of one block (16 samples $\hat{=} 0.726$ ms) is introduced on the error signal $e[n]$. This latency has to be taken into account for adaptation, meaning $r[n]$ has to be delayed by the same amount. For better comparability, the RMS output signal levels in TASCAR have been calibrated for each case to match those of the actual measurements.

For the measurement-based reference, the innovation signal is convolved with the impulse responses measured in the physical rooms to obtain the disturbance signal $d[n]$ at the central position. The disturbance signal as well as the innovation signal, used as reference signal $x[n]$, are processed in a Python co-simulation of the FxLMS ANC algorithm. The same set of parameters (step size $\mu$, FxLMS filter order $N$, secondary path order) is chosen for the ANC algorithm in Python, the loopback delay caused by JACK in the TASCAR and FAUST simulation is modelled as well. For a realistic scenario, a full length version of the secondary path response $G(z)$ is convolved sample by sample with the calculated control signal $u[n]$ before summation with the primary disturbances $d[n]$ to get the error signal $e[n]$.

## 4.3. Results

Table 2 and figure 8 show a comparison of simulations and measurement based co-simulations in terms of error signal levels before and after adaptation. In a simulation with free field conditions (case 0), the residual error decays towards zero and approaches numerical limits. However, in a real room, even a measurement chamber, this perfect cancellation is not reached due to unavoidable reflections and reverberation. In the measurement chamber, simulation scenarios with at least early reflections (cases 1 to 3) exhibit more realistic results. A relatively similar level with engaged ANC is achieved this way compared to the co-simulation, although with about 5 dB to 6 dB more attenuation. It is also noticeable, that the simulation in FAUST and TASCAR adapts slower compared to the measurements. A look at the spectrum of the error signal before and after adaptation in figure 9 shows that the ISM in TASCAR causes an increased level towards low frequencies, as the extrapolated absorption coefficients in this frequency range exhibit lower values. This behaviour is intensified in the signal level after adaptation as spectral tilt, most likely as early reflections in the secondary path are not considered by the ANC algorithm with the chosen filter order.

In the meeting room, results of both measurement and simulations with early reflections show no meaningful noise reduction. This is due to the fact, that early reflections with strong contributions cannot be controlled as they are exceeding the 128 samples length of both adaptive filter and modelled secondary path.

<table><caption>Table 2: Comparison of ANC performance in terms of error signal root mean square (RMS) values in dB.</caption><thead><tr><th rowspan="2"></th><th colspan="2">Measurement Chamber</th><th colspan="2">Meeting Room</th></tr><tr><th>ANC off</th><th>ANC on</th><th>ANC off</th><th>ANC on</th></tr></thead><tbody><tr><th>Meas</th><td>-39.8</td><td>-51.6</td><td>-44.7</td><td>-44.8</td></tr><tr><th>Sim 0</th><td>-39.8</td><td>-103.3</td><td>-44.7</td><td>-122.1</td></tr><tr><th>Sim 1</th><td>-39.8</td><td>-57.9</td><td>-44.7</td><td>-45.1</td></tr><tr><th>Sim 2</th><td>-39.8</td><td>-57.2</td><td>-44.7</td><td>-45.1</td></tr><tr><th>Sim 3</th><td>-39.8</td><td>-57.2</td><td>-44.7</td><td>-45.1</td></tr></tbody></table>

<footnote n="6">⁶Higher filter orders would lead to an unreasonably long build time of the adaptive filter in its current implementation.</footnote>

<footnote n="7">⁷https://github.com/synthnassizer/jcmess</footnote>
<figure><img src="image_84.png" /><figcaption>Figure 8: Comparison of error signals for one noise realisation with ANC adaptation enabled from 5 s onwards.</figcaption></figure>

<figure><img src="image_85.png" /><figcaption>Figure 9: Comparison of 1/3 octave smoothed error magnitude spectra for one noise realisation with and without ANC.</figcaption></figure>
## 5. CONCLUSION AND OUTLOOK

This study assesses the capability of combining FAUST and TASCAR for signal processing and acoustic scene simulations in order to develop and test real-time capable audio algorithms. Simulation results from these tools are compared to measurements in two real rooms: a measurement chamber with an extremely short reverberation time, and a meeting room with anisotropic acoustic properties. Room acoustic evaluations based on the level distribution along a microphone arrangement show a good match between measurements and simulations just considering early reflections and omitting source directivity. The spatial coherence is highly similar between simulations and measurements in the measurement chamber as well. Greater differences are observed in the more diffuse meeting room, most likely caused by the ISM order and lack of proper diffuse reverberation.

An active noise control algorithm is tested in TASCAR for acoustic scene simulation and FAUST for signal processing on an ordinary PC, using JACK Audio for signal routing. Compared to a measurement based co-simulation, a full scale simulation in TASCAR and FAUST exhibits comparable results when considering at least early reflections. However, the low filter order of the implemented FxLMS algorithm only permits the evaluation of relatively dry acoustic scenarios.

The full potential of a combined simulation approach with FAUST and TASCAR lies in time-variant simulations, as all parameters and virtual positions can be updated during operation via OSC. Future works may include the integration of head-tracking devices, for example to develop and improve position-dependent local ANC algorithms [19, 20].

## 6. REFERENCES

[1] Maxime Popoff, Romain Michon, Tanguy Risset, Yann Orlarey, and Stéphane Letz, "Towards an FPGA-Based Computation Flow for Ultra-Low Latency Audio Signal Processing," in *Sound and Music Computing Conference, Saint-Étienne, France, June 2022*, https://inria.hal.science/hal-03805199.

[2] Loïc Alexandre, Pierre Lecomte, Marie-Annick Galland, and Maxime Popoff, "Feedback Acoustic Noise Control with Faust on FPGA: Application to Noise Reduction in Headphones," in *International Faust Conference, Saint-Étienne, France, June 2022*, https://hal.science/hal-03781085.

[3] Loïc Alexandre, Pierre Lecomte, and Marie-Annick Galland, "Experimental Active Noise Control Using Faust On FPGA: Comparison Between A Multi-Point and Spherical Harmonics Method," in *Forum Acusticum 2023 - 10th Convention of the European Acoustics Association*, Torino, Italy, Sept. 2023, European Acoustics Association, https://hal.sciencede/hal-04221590.

[4] Giso Grimm, Joanna Luberadzka, and Volker Hohmann, "A Toolbox for Rendering Virtual Acoustic Environments in the Context of Audiology," *Acta Acustica united with Acustica*, vol. 105, no. 3, pp. 566-578, May 2019.

[5] Felix Holzmüller, Christian Blöcher, and Alois Sontacchi, "Assessment of Simulations in Faust and Tascar for the Development of Audio Algorithms in Acoustic Environments -

Code and Data," Sept. 2024, https://zenodo.org/records/13859827.

[6] Angelo Farina, "Simultaneous Measurement of Impulse Response and Distortion with a Swept-Sine Technique," in *AES 108th Convention*, Paris, Feb. 2000, https://www.aes.org/e-lib/inst/browse.cfm?elib=10211.

[7] BASF SE, "Basotect® G+ - Technical Information," https://soundproofwarehouse.com.au/website-images/TI-Basotect-G-eng-11-2011-1.pdf, Oct. 2011.

[8] Physikalisch-Technsiche Bundesanstalt, "Absorption Coefficient Database," https://www.ptb.de/cms/ptb/fachabteilungen/abt1/fb-16/ag-163/absorption-coefficient-database.html, May 2012.

[9] Michael Gerzon, "Synthetic Stereo Reverberation: Part One," *Studio Sound*, vol. 13, no. 12, pp. 632-635, Dec. 1971, https://www.worldradiohistory.com/Archive-A11-Audio/Archive-Studio-Sound/70s/Studio-Sound-1971-12.pdf.

[10] Richard K. Cook, Richard V. Waterhouse, Raymond D. Berendt, Seymour Edelman, and Moody C. Thompson, Jr., "Measurement of Correlation Coefficients in Reverberant Sound Fields," *The Journal of the Acoustical Society of America*, vol. 27, no. 6, pp. 1072-1077, Nov. 1955.

[11] Chetlur G. Balachandran, "Random Sound Field in Reverberation Chambers," *The Journal of the Acoustical Society of America*, vol. 31, no. 10, pp. 1319-1321, Oct. 1959.

[12] Gerard C. J. Bart, "Spatial Crosscorrelation in Anisotropic Sound Fields," *Acoustica*, vol. 28, no. 1, pp. 45-49, Jan. 1973.

[13] Wing T. Chu, "Comments on the coherent and incoherent nature of a reverberant sound field," *The Journal of the Acoustical Society of America*, vol. 69, no. 6, pp. 1710-1715, June 1981.

[14] Finn Jacobsen and Thibaut Roisin, "The coherence of reverberant sound fields," *The Journal of the Acoustical Society of America*, vol. 108, no. 1, pp. 204-210, July 2000.

[15] Manfred R. Schroeder, "The "Schroeder frequency" revisited," *The Journal of the Acoustical Society of America*, vol. 99, no. 5, pp. 3240-3241, May 1996.

[16] Stephen J. Elliott, *Signal Processing for Active Control*, Signal Processing and Its Applications. Academic Press, 1 edition, 2001.

[17] Bernard Widrow and Samuel D. Stearns, *Adaptive Signal Processing*, Prentice-Hall, 1985.

[18] Dennis R. Morgan, "An analysis of multiple correlation cancellation loops with a filter in the auxiliary path," *IEEE Transactions on Acoustics, Speech, and Signal Processing*, vol. 28, no. 4, pp. 454-467, Aug. 1980.

[19] Stephen J. Elliott, Marcos Simón-Gálvez, Jordan Cheer, and Woomin Jung, "Head tracking for local active noise control," in *12th Western Pacific Acoustics Conference*, Singapore, Dec. 2015, https://eprints.soton.ac.uk/388063/.

[20] Woomin Jung, Stephen J. Elliott, and Jordan Cheer, "Combining the remote microphone technique with head-tracking for local active sound control," *The Journal of the Acoustical Society of America*, vol. 142, no. 1, pp. 298-307, July 2017.
# Presentation of Workshops

## abc.lib - News From Multichannel Audio Processing in Mixed Music

Alain Bonardi and Paul Goutmann

abc.lib is an open source library written in Faust language and distributed in the form of a Max package and a set of Pd objects. The Max and Pd distributions bring together objects for synthesis, multichannel and ambisonic processing, as well as numerous utilities for mixed music. In this workshop, we'll introduce the library's ecosystem. Step by step, we'll build musical situations involving synthesis, multichannel processing and spatial sound processing in ambisonics. We'll take advantage of special cases to explain the approach we've chosen to build a Max package for multichannel processing from a set of Faust code.

## Introducing the Sound Corpus Survey: What's that I hear? Understanding Human Sound Description to Make Better Generative Audio Engines

Domenico Cipriani

This session consists of a 40-minute workshop and a 20-minute live performance. The workshop introduces Phausto, a lightweight Pharo library and API for sound generation and DSP programming using Faust. Participants will learn to install tools, understand Pharo syntax, and develop DSPs, making it accessible even to sound artists with little programming experience. The live coding performance features MOOFLOD, a Pharo tool developed through research by Evref and MINT, for creating music on-the-fly. It pairs sound generation (via Phausto) with visualizations of rhythmic patterns and synthesis manipulation. Afterward, audience members will assess their emotional engagement and understanding via a questionnaire.

## Some useful links:

* https://linktr.ee/lucretiomsp

* https://www.youtube.com/watch?v=NpOX_UoFV_g

* https://www.youtube.com/watch?v=7nLFGuZ-I5w&t=192s
# Presentation of Demos

## Experiences with Rust + Faust

Leon Gnaedinger

I want to talk about my general experiences with integrating Rust in Faust and writing audio applications with it. This means I want to talk about how the Rust language feels around Faust, how I integrate Faust into my Rust projects and what difficulties and positives I think there are. Next I want to talk about the ecosystem of rust-faust integration in more detail. The options there are (nih-plug, faust-build, faust-types, faust-llvm). Maybe share some little tricks I learned. Besides the ecosystem around the Rust + Faust, I also want to share some insights about the broader audio DSP Rust ecosystem and share some libraries that I tend to use in my projects.

## Demo of Stratus

Martin Bartlett and Landon McCoy

Demo of Stratus in general showcasing how it works. This is a guitar demo as well.

## SHCdyna, a Dynamic and Interactive Application for Musical Performance

Ruolun Allen Weng and Christophe Lebreton

Developed by LiSiLoG, SHCdyna is a continuation and extension of the faust2smartphone project, first introduced at International Faust Conference (IFC) 2018. SHCdyna enhances the flexibility of creating musical applications through dynamic compilation, allowing musicians and developers to create, upload, and execute Faust projects in real-time on iOS devices. Building on the key concepts of customizable SHC (Smart Hand Computer) interfaces, motion control, and Faust's powerful digital signal processing (DSP) capabilities, SHCdyna opens up new possibilities for interactive music creation. This presentation will highlight the evolution introduced in SHCdyna and explore its potential applications in education and live performance.

## Some useful links:

* SHCdyna Doc: https://github.com/RuolunWeng/SHCdyna

* faust2smartphone: https://github.com/RuolunWeng/faust2smartphone

* Smart Hand Computer: https://www.lisilog.com/en/shc-2
<figure><img src="image_86.png" /></figure>
<figure><img src="image_87.png" /></figure>

9 782959 791109

4th International Faust Conference

Proceedings

<figure><img src="image_88.png" /></figure>