<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Phausto: fast and accessible DSP programming for sound and music creation in Pharo</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Domenico</forename><surname>Cipriani</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">Pharo Association</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Nahuel</forename><surname>Palumbo</surname></persName>
							<email>nahuel.palumbo@inria.fr</email>
							<affiliation key="aff1">
								<orgName type="laboratory">UMR 9189 CRIStAL</orgName>
								<orgName type="institution" key="instit1">Univ. Lille</orgName>
								<orgName type="institution" key="instit2">Inria</orgName>
								<orgName type="institution" key="instit3">CNRS</orgName>
								<orgName type="institution" key="instit4">Centrale Lille</orgName>
								<address>
									<addrLine>Park Plaza, Parc scientifique de la Haute-Borne, 40 Av. Halley Bât A</addrLine>
									<postCode>59650</postCode>
									<settlement>Villeneuve-d&apos;Ascq</settlement>
									<country key="FR">France</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Sebastian</forename><forename type="middle">Jordan</forename><surname>Montaño</surname></persName>
							<email>sebastian.jordan@inria.fr</email>
							<affiliation key="aff1">
								<orgName type="laboratory">UMR 9189 CRIStAL</orgName>
								<orgName type="institution" key="instit1">Univ. Lille</orgName>
								<orgName type="institution" key="instit2">Inria</orgName>
								<orgName type="institution" key="instit3">CNRS</orgName>
								<orgName type="institution" key="instit4">Centrale Lille</orgName>
								<address>
									<addrLine>Park Plaza, Parc scientifique de la Haute-Borne, 40 Av. Halley Bât A</addrLine>
									<postCode>59650</postCode>
									<settlement>Villeneuve-d&apos;Ascq</settlement>
									<country key="FR">France</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Stéphane</forename><surname>Ducasse</surname></persName>
							<email>stephane.ducasse@inria.fr</email>
							<affiliation key="aff1">
								<orgName type="laboratory">UMR 9189 CRIStAL</orgName>
								<orgName type="institution" key="instit1">Univ. Lille</orgName>
								<orgName type="institution" key="instit2">Inria</orgName>
								<orgName type="institution" key="instit3">CNRS</orgName>
								<orgName type="institution" key="instit4">Centrale Lille</orgName>
								<address>
									<addrLine>Park Plaza, Parc scientifique de la Haute-Borne, 40 Av. Halley Bât A</addrLine>
									<postCode>59650</postCode>
									<settlement>Villeneuve-d&apos;Ascq</settlement>
									<country key="FR">France</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Phausto: fast and accessible DSP programming for sound and music creation in Pharo</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">ED5A11854C16BF37B1B0BB8515CA8B29</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T18:09+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>sound synthesis, live coding, audio, DSP programming, Pharo, Faust, ChucK dsp := DSP create: &apos;import(&quot;stdFaust.lib&quot;)</term>
					<term>process = pm.marimba(400 ,3 ,7000 ,0.25 , 0.5 , ba.pulse(20000)) + pm.marimba (800, 3 ,7000 ,0.25 , 0.5 , ba.pulse(10000))</term>
					<term>&apos; dsp := ((Marimba new freq: 800</term>
					<term>trigger: (Pulse new period: 0.2) ) + (Djembe new freq: 800</term>
					<term>trigger: (Pulse new period: 0.1) )) asDsp</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>This paper introduces Phausto, a library that generates sounds in Pharo programming language using Faust (Functional Audio Streams), a programming language designed to develop real-time digital signal processors (DSP).</p><p>In Phausto, DSP programs are created by the composition of Unit Generators written in a MUSIC-N style, like the ChucK programming language, or from a string containing a valid Faust program.</p><p>We present Phausto's API, implementation details and an overview of its syntax, and of Unit Generators and ToolKit elements. We also analyze the motivations behind the project and identify its target audiences. Finally, we present the conclusions drawn after one year of development and use, and outline the agenda for future work.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>We present Phausto: a sound generation library for the Pharo programming language. Phausto is a library created with the primary goal of integrating state-of-the-art sound synthesis inside the Pharo ecosystem, allowed by a dynamic engine (Section 4). This engine connects a Faust [1] (Functional Audio Streams) program generated to an underlying PortAudio [2] layer that, in turn connect with the platform-specific low-level audio API. Together with these emerging sonic capabilities comes a new quest: a transparent and effective API to develop and design Digital Signal Processors (DSP) such as synthesisers and effects, both to be used in Pharo applications and for creative musical composition.</p><p>The Phausto API (Section 5) is designed to be modern and straightforward: its semantics and the subdivision of Faust's standard library functions into Phausto Unit Generators subclasses is inspired by the ChucK [3] programming language, which takes this concept from MUSIC-N style programming music languages [4]. Unit Generators (UGens) are basic building blocks for signal processing algorithms that were first developed by Max Mathews and Joan E. Miller for the Music III program [5] in 1960. UGens include processing modules such as oscillators, filters, envelopes and effects that can be connected to create synthesis instruments (sometimes referred as patches).</p><p>DSP can be created in Phausto from a string containing a valid Faust program, as in:</p><p>All Unit Generators have default values for their parameters, which are themself Faust boxes, too.</p><p>The main contributions of this paper are:</p><p>• A description of the Phausto library architecture and implementation details.</p><p>• Examples of sound synthesis using Phausto API.</p><p>• An overview of the Phausto Standard Library and ToolKit.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Motivation</head><p>We develop Phausto to generate sound directly from the Pharo environment, without needing external dependencies to play performance during live coding sessions.</p><p>We have identified three primary target audiences for Phausto:</p><p>1. Pharo programmers who want to include sounds or sonic interaction in their Pharo applications, including procedural audio designed Faust extensive physical modelling synthesis library; 2. Artists with little or no computer literacy who want to design and develop synthesisers and effects for their music creation fast and easily. Pharo offers a transparent syntax with a neat IDE and a browser that enables users to avoid complex library management; Phausto ensures all Faust libraries are readily accessible as well-documented classes and methods.  Phausto is an open-source Pharo library to create synthesisers and audio effects that are converted into Faust programs by an embedded Faust compiler. Figure <ref type="figure" target="#fig_0">1</ref> shows an overview of its architecture.</p><p>The Dynamic Engine in the backend initialises the PortAudio library and opens a stream for audio I/O. It creates a DSP from strings of valid Faust codes or Boxes created with the Phausto API. The definitions of the Unit Generators are implemented in the Faust libraries, which are accessed by the Dynamic Engine when DSPs are created.</p><p>The DSP is a Faust program that computes floating point numbers between -1.0 and 1.0 as output. These values fill the blocks of a PortAudio stream. The platform-specific audio driver transforms the PortAudio stream into sound, using the sound interface Digital-To-Analog converter.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Under-the-hood: Faust programming language</head><p>Faust (Functional Audio Stream) [1] is a functional programming language tailored to sound synthesis and audio processing created at the GRAME-CNCM Research Department <ref type="bibr" target="#b3">3</ref> . It provides developers with an alternative to C/C++ for designing and deploying DSPs. One of its key features is a block diagram-oriented syntax, which eases a modular approach to the creation of synthesisers and effects. A Faust program describes a signal processor, essentially mapping input signals to output signals, but it does not outline a connection to the external world <ref type="bibr" target="#b4">4</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1.">Faust dynamic engine</head><p>The dynamic engine implementation describes a straightforward C API for Faust objects including the audio drivers responsible for rendering the samples computed by the DSP and the library used for reading audio data files. Faust DSP objects are structures that can be either instantiated from a string of valid Faust code by calling the createDsp function: After being created, DSP needs to be initialized by calling the initDSP function with a sampling rate and buffer size for the audio driver. <ref type="bibr" target="#b5">5</ref> . Finally, start function is called to open the audio stream and processing audio blocks until stop function is called.</p><p>bool initDsp(dsp* dsp, RendererType renderer, int sr, int bsize); bool startDsp(dsp* dsp);</p><p>The dynamic engine also allows access to and modification of DSP parameters using the getParamValueDsp and setParamValueDsp functions: The dynamic engine includes the Faust Compiler [7], libFaust in Figure <ref type="figure" target="#fig_0">1</ref>. The compiler generates bytecode from the Faust Imperative Representation, which is then successively executed by a stackbased virtual machine. We chose this approach for its lightweight nature and zero dependencies, although other options with faster execution, as an LLVM [8] backend <ref type="bibr" target="#b6">6</ref> . The Faust compiler meets the performance needs of Phausto intended goals and audience; as interactions with the Faust program occur only once it has been created and initialized, the choice between the LLLVM compiler and the backend interpreter does not affect the control on-the-fly of the DSP parameters.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2.">The PortAudio layer</head><p>To maintain compatibility across different operating systems and keep the ToolKit as lightweight as possible, we leverage PortAudio. PortAudio is an Open Source Cross Platform C library <ref type="bibr" target="#b7">7</ref> and API for audio input and output [2]. It was designed to simplify the development of real-time audio applications, and it is part of a larger initiative called PortMusic 8 that also includes MIDI <ref type="bibr" target="#b9">9</ref> capabilities.</p><p>PortAudio renders the samples computed by the Faust interpreter with the PortAudio and Faust's native library <ref type="bibr" target="#b10">10</ref> . This approach ensures all the dependencies (including all Faust libraries) to be less than 10 MB.</p><p>PortAudio handles the connection with the audio input and audio ports on the host platform. It internally manages audio stream buffers and requests audio processing from the client application via a callback that is associated with an opened stream. In the dynamic engine, this association is managed by the following function: This function sets the sampling rate and the buffer size and allows one to choose a different renderer from PortAudio if needed.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3.">The Box API</head><p>The Faust C box API <ref type="bibr" target="#b11">11</ref> allows for the programmatic creation of a box expression, which is used to create a DSP object. This stage is an intermediate public entry point created in the Semantic Phase of Faust's compilation chain. The Semantic Phase is the first step of Faust's compilation chain; starting from the DSP source code written in Faust, the Semantic Phase produces signals that are (conceptually) infinite streams of samples. Boxes can be created by calling a specific function defined in libFaust-box-c. e.g., for creating a UI button: The Box API also supplies methods to convert numbers into Boxes and to connect Boxes via the five binary composition operators of the language <ref type="bibr">12</ref> </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Phausto programming by example: Fast and easy sound synthesis</head><p>Programming DSP with Phausto is fast and easy because it combines the modular synthesiser [9]  creative and flexible mindset with the Pharo Object Oriented Programming paradigm. Phausto takes advantage of Pharo's concise and iconic syntax, the reflectiveness of the environment, and the ease of developing reusable code. With Phausto, Pharo becomes a fully-fledged IDE for audio synthesis and algorithmic composition without needing additional extensions (in contrast to other IDEs and code editors in mainstream programming languages). Moreover, manipulating the DSP parameters using Pharo syntax provides musicians with a tool offering unnoticeable latency <ref type="bibr" target="#b13">13</ref> for their live performances and compositions. Listing 1 shows a simple example using Phausto playing a Pulse Oscillator. First, we instantiate the UGen to play, in this case, a Pulse Oscillator. Then we create a stereo DSP by sending the messages asDSP to our Pulse Oscillator. (To change the mono output of a synth to stereo, we send the stereo message to the Box that is the result of the multiplication).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1.">Start your engine</head><p>Once our DSP is created, we initialize and start it to hear the sound it generates. We can stop the DSP whenever we want. If we are finished with our DSP programming, it would be a good practice to destroy it.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2.">Taking Control of Configuration and Parameters</head><p>Each UGen has different configuration parameters with default values, each of them documented in the class comments. For example, to control the parameters of a Pulse Oscillator we need to specify the freq -for frequency in Hertz, and duty -to change the oscillator duty cycle (between 0 and 1).</p><p>pulse := PulseOsc new freq: 220; duty: (LFOTriPos new freq: 4). dsp := pulse stereo asDsp. dsp init. dsp start.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Listing 2: Configuring UGen parameters</head><p>The code in Listing 2 sets the frequency of the Pulse Oscillator to 220 Hz (default frequency is 440 Hz) and assigns the value of the duty cycle to a Low-Frequency Oscillator (LFO) with a Triangular Positive Waveform (LFOTriPos oscillates between 0 and 1).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.">Live programming</head><p>To modify a parameter of a UnitGenerator in real time, while the DSP is playing, we create a PhHSlider by sending the message init: initialValue to a ByteSymbol. This creates a PhHSlider with the ByteSymbol as a label and the required initial value. Then, we control the parameter on live by sending the message setValue: parameter: to our DSP. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.4.">Music composition with Pharo Processes</head><p>Once we have started our DSP we can create music compositions using Pharo Processes, Blocks and Delays. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Listing 4: Algorithmic music composition</head><p>For instance, code in Listing 4 plays a sequence of 24 chromatic notes starting from C5 (MIDI note number 72) playing at exponentially shorter intervals of time.</p><p>In this example, we have created a Square Oscillator which has its frequency connected to a PhHSlider (to be controlled), multiplied for an Attack-Release Envelope controlled by other PhHSlider.</p><p>The playNote:prefix:dur: method modifies two parameters:</p><p>• it converts a MIDI note number to a frequency in Hertz and sends this value to the SquareNote parameter; • it sends the value 1 and after 0.1 seconds a value of 0 to the parameter SquareGate.</p><p>Essentially, the playNote:prefix:dur: the method simulates the action of playing a key on a MIDI keyboard. For this operation, our DSP needs a parameter with the gate suffix to trigger its envelope and a parameter named Note for controlling the frequency. Both parameters must share the same prefix, which is 'Square' in this example.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Core Implementation</head><p>Phausto allows Pharo users to use functions and data structures from the Faust programming language via Foreign Function Interface (FFI) [10]. The library contains the API to instantiate, access and modify DSP and create Faust Boxes as described in Section 4.</p><p>To use Phausto, the librariesBundle folder must be downloaded from the GitHub repository and placed next to the current Pharo image<ref type="foot" target="#foot_7">14</ref> . The libraries bundle includes hundreds of functions for synthesis and processing audio written in Faust (see Section 7).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1.">DSP creation from Phausto Boxes</head><p>We create UnitGenerators objects in Phausto using the Faust Box API (described in Section 4.3). It enables writing DSP in Pharo with a dedicated API that hides Faust syntax from the user.</p><p>The Box API class provides the connection to over 50 functions that we have considered fundamental for developing the Phausto API. These functions include those to create Faust primitives, composition operators and mathematical expressions. The methods that create or combine boxes return a new Box. If the operation fails, a null pointer is returned.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.2.">The lifecycle of a DSP</head><p>A DSP object is originally initialised (i.e., connected to the PortAudio layer) and subsequently started, stopped, and at the end of its use destroyed to avoid dangling pointers. All these methods call to the corresponding function defined in the dynamic engine.</p><p>Once a DSP is initialised we can check its parameters on a Transcript (traceAllParams) and modify the value of its parameters sending the message setValue: aParameter with a Number or a Box as the first argument and with a String as the second argument.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.3.">Managing the global compilation context</head><p>To use the Faust Box API we create a singleton global compilation context before we create a Box, and destroy this context after the Box has been used to create a DSP. For this reason, the Box class has a shared variable called libContext not initialised when the Pharo image is opened. Every call to the BoxAPI class in Phausto first ensures the creation of the context by calling createLibContextFFI if not exist. At the same time, every time a DSP is created, the compilation context is destroyed by calling BoxAPI unique instance destroyLibContext.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.">Phausto Standard Library and the ToolKit</head><p>The Phausto Standard Library includes the bindings to functions in the standard Faust library stdFaust.lib<ref type="foot" target="#foot_8">15</ref> . They are implemented as subclasses of UnitGenerator and organised in package tags, while the ma.lib (which includes mathematical operations) is ported as methods of the PhBox superclass.</p><p>The design of the Phausto API exposes all original arguments as instance variables of the UGen object and default values are set during initialisation <ref type="bibr">16</ref> . The setters convert their arguments into a Box, allowing the user to use both, fixed numbers or other boxes (e.g., other UnitGenerators, or a UIPrimitive to control the variable in real-time).</p><p>One specific UnitGenerator is created by sending the asBox message. This method first creates an intermediateBox from a Faust code string without parameters and returns a finalBox from the connection of the instance variables to the intermediateBox. Listing 5 presents the binding between the djembe function in Faust and the Djembe class in Phausto. The ToolKit<ref type="foot" target="#foot_10">17</ref> tag of the Phausto package includes a set of classes that do not have a corresponding function in the standard Faust library. These classes encompass units for sound generations that combine one or more UnitGenerators.</p><p>The ToolKit includes a combination of effects and modulators (e.g., FIlterEnvelope or FilterLFO), effects and synthesizers with a custom design (e.g., DelayFeedBack or SamplePlayer) or 'utilities' as the Incrementer (that increments its output by an increment value at every step).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="8.">Related work</head><p>One of the primary sources of inspiration for Phausto is Kyma [12], an object-oriented environment for music composition written in Smalltalk-80, created by Carla Scaletti in the mid of 1980. The first version of Kyma ran on a Macintosh 512k computer and could not manipulate sound in real time. This is why Scaletti and Kurt J. Hebel collaborated to integrate a separate multiprocessor to compute and process audio [13]. Although there is no direct connection between Phausto and Kyma, we share Scaletti's desire to make music programming more accessible to composers without a strong background in computer science. Our goal is also to make music creation more accessible to programmers without a strong background in music and sound synthesis.</p><p>Pharo programmers could play sound samples in Pharo since Pharo 9.0 using the Sound package <ref type="bibr">18</ref> .</p><p>Pharo Sound plays samples and sounds by FFI calls to the SDL2 library<ref type="foot" target="#foot_12">19</ref> . This package is poorly documented and offers very few audio generators and effects based on a Pharo implementation of low-level C techniques for computing samples. Consequently, its API is difficult to access and complex to expand, it does not use terminology consistent with modern audio programming practices. FaustPy<ref type="foot" target="#foot_13">20</ref> is a Python wrapper for Faust implemented using CFFI that works with Python 2.7 and 3.2+. It is the only wrapper for a high-level general-purpose programming language supporting objectoriented programming.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="9.">Future Work</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="10.">Conclusion</head><p>After ten months of development, Phausto is a comprehensive solution for enabling sound synthesis into Pharo applications. Phausto offers a diverse ToolKit that includes sample players, basic oscillators, envelopes, various physical models, resonant filters, reverbs, and delays. The extensive list of Unit Generators features a streamlined API for parameter manipulation.</p><p>Additionally, TurboPhausto's synthesizers and effects were showcased in a 30-minute live performance titled "Riding the MoofLod" during the ESUG2024 conference at Lille. Special thanks to Carla Scaletti and Kurt J. Hebel at Symbolic Sound Corporation fo their lifelong effort to spread love for Smalltalk and computer music, and to Cristian Vogel for pushing Kyma into the world of electronic dance music.</p><p>This work has been supported by the Pharo Consortium.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: Overview of Phausto library and the embedded Faust dynamic engine.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>dsp* createDsp (const char* name_app, const char* dsp_content, int argc, const char* argv[], const char* target, int opt_level); or from Boxes (Section 4.3) with the createDspFromBoxes function: dsp* createDspFromBoxes(const char* name_app, Box box, int argc, const char* argv[], const char* target, int opt_level);</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>FaustFLOAT</head><label></label><figDesc>getParamValueDsp (dsp* dsp_ext, int p); FaustFLOAT setParamValueDsp (dsp* dsp_ext, int p, FaustFLOAT val);</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head></head><label></label><figDesc>bool initDsp(dsp* dsp, RendererType renderer, int sr, int bsize);For instance, in Phausto we initialise a DSP by calling: initDsp(aDSP, 0, 44100, 512);</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head></head><label></label><figDesc>pulse := PulseOsc new. "Instantiate an Unit Generator" dsp := pulse stereo asDsp. "Create the DSP in stereo mode" dsp init. "Initialize the DSP" dsp start. "Start the sound" dsp stop. "Stop the sound" dsp destroy. "Destroy the DSP" Listing 1: Simple example using Phausto</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head></head><label></label><figDesc>lfoFreq := #lfoFreq init: 2. pulse := PulseOsc new freq: 220; duty: (LFOTriPos new freq: lfoFreq ). dsp := pulse asDsp. dsp init. dsp start. "Change the value of a parameter while the sound is playing" dsp setValue: 8 parameter: 'lfoFreq'. ... "Continue using the DSP until the end" Listing 3: Changing UGen parameters while playing Listing 3 shows an example of changing the frequency of the LFO from 2 to 8 Hz after the DSP is started.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head></head><label></label><figDesc>synth := (SquareOsc new freq: #SquareNote) * (AREnv new trigger: #SquareGate). dsp := (synth =&gt; SatRev new) stereo asDsp.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>3. Students and beginners who want to develop their audio plug-ins, by exporting DSPs developed in Pharo to Cmajor 1 patches thanks to the Faust2CMajor export</figDesc><table><row><cell cols="2">create a Box from</cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell>t o le f t</cell></row><row><cell cols="2">Phausto Objects</cell><cell>BOX API</cell><cell>creates a DSP from a Box</cell><cell>the FAUST generated</cell><cell></cell><cell></cell><cell>o u t p u t s a u d io c h a n n e l</cell></row><row><cell></cell><cell></cell><cell></cell><cell></cell><cell>prorgam computes</cell><cell></cell><cell></cell></row><row><cell>PHAUSTO</cell><cell cols="2">creates DSP from a String</cell><cell>DYNAMIC ENGINE</cell><cell>samples for the underlying audio layer</cell><cell>PORTAUDIO</cell><cell>fills blocks of audio bufffers</cell><cell>PLATFORM SPECIFIC</cell></row><row><cell></cell><cell></cell><cell></cell><cell>LIBFAUST</cell><cell></cell><cell></cell><cell></cell><cell>AUDIO DRIVER</cell></row><row><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell>o</cell></row><row><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell>u</cell></row><row><cell></cell><cell></cell><cell cols="2">FAUST LIBRARIES Unit Generators are implemented in the FAUST libraries</cell><cell></cell><cell></cell><cell></cell><cell>t h ig o t io u a t p t u s c d h a n n e r l</cell></row><row><cell></cell><cell></cell><cell></cell><cell>(stdfaust.lib)</cell><cell></cell><cell></cell><cell></cell></row></table><note><ref type="bibr" target="#b2">2</ref> . Cmajor is a new C-family programming language for writing fast and portable audio software, created by Julian Storer and Cesare Ferrari. Cmajor patches can be exported as native VST/AU/AAX plugins or loaded directly into a Digital Audio Workstation (DAW) with the Cmajor VST/AU plugin3. Phausto Overview and Architecture</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head></head><label></label><figDesc>Or from a string of Faust code by calling:</figDesc><table><row><cell>Box CboxButton(const char* label);</cell></row><row><cell>Box CDSPToBoxes(const char* name_app, const char* dsp_content,</cell></row><row><cell>int argc, const char* argv[], int* inputs, int* outputs, char* error_msg);</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">https://cmajor.dev/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">https://github.com/grame-cncm/Faust/tree/master-dev/architecture/cmajor#Faust2cmajor</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2">https://Faust.grame.fr/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3">https://Faustdoc.grame.fr/manual/architectures/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4">For a more detailed description of sampling rates, audio buffer size and audio drivers, refer to the first chapters of The Audio Programming Book<ref type="bibr" target="#b6">[6]</ref> </note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="6" xml:id="foot_5">Linked with components of the LLVM compiler toolchain, the library allows the deployment of a complete dynamic compilation chain from source to executable code.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="13" xml:id="foot_6">The latency time refers to the duration required to execute the message setValue:parameter: (which is is an FFI call), to execute. If we run a simple benchmark:</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="14" xml:id="foot_7">https://github.com/lucretiomsp/phausto</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="15" xml:id="foot_8">https://faustlibraries.grame.fr/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="16" xml:id="foot_9">The default values have been an arbitrary choice, influenced by other programming languages such as ChucK, PureData, SuperCollider, as well as our direct experience and by empirical audio tests during development.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="17" xml:id="foot_10">The ToolKit name is a homage to the Synthesis ToolKit<ref type="bibr" target="#b11">[11]</ref> in C++(STK)by Perry R. Cook and Gary Scavone, as its primary goal is to facilitate faster development of synthesisers and effects.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="18" xml:id="foot_11">https://github.com/pharo-contributions/Sound</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="19" xml:id="foot_12">SimpleDirectMedia is a cross-platform development library designed to provide low-level access to audio, keyboard, mouse and graphics hardware.</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="20" xml:id="foot_13">https://github.com/marcecj/Faust_python</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="21" xml:id="foot_14">https://webassembly.js.org/docs/contrib-wat-vs-wast.html</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="22" xml:id="foot_15">https://github.com/pharo-graphics/Toplo</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgments</head><p>We would like to thank Stephane Sletz, Yann Orlarey, Guillermo Polito, Esteban Lorenzano and Pablo Tesone, for their invaluable support, push and assistance throughout the development of Phausto.</p><p>We express our gratitude to the organisation of the ESUG for the inspiration and the knowledge we gained during the conferences. In particular, the meetings with the members of the Pharo team and GRAME in Lyon 2023. It was instrumental in the birth of Phausto.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<title level="m">Faust there are five binary composition operations to combine block diagrams: sequential</title>
				<imprint>
			<date type="published" when="1000">1000</date>
		</imprint>
	</monogr>
	<note>recursive ( ~) . For a detailed description of Faust binary operators see. timesRepeat: [dsp setValue: (Random new nextIntegerBetween: 90 and: 900) parameter: &apos;SquareOscFreq&apos;. timeToRun. The results show that a single call takes approximately 0.007 milliseconds. At a 192 kHz sample rate, this latency is slightly more than 1 sample, making it effectively instantaneous compared to the rate at which the computer can generate sound. However, it&apos;s important to consider that the latency of calling the function void setParamValueDsp(dsp* dsp_ext, int p, FaustFLOAT val); through the dynamic engine primarily depends on the buffer size and sample rate parameters used in the Phausto audio layer. By default, Phausto initialize its DSPs with a 44100 sample rate and a buffer size of 512 samples. This corresponds to a latency of approximately 11.6 ms, which is below the 20 ms threshold generally considered to be imperceptible or minimally disruptive for human perception, as demonstrated by the Haas effect</note>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<title level="m" type="main">A FAUST Tutorial</title>
		<author>
			<persName><forename type="first">E</forename><surname>Gaudrain</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Orlarey</surname></persName>
		</author>
		<ptr target="https://hal.science/hal-02158895,manual" />
		<imprint>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">Portaudio-an open source cross platform audio api</title>
		<author>
			<persName><forename type="first">R</forename><surname>Bencina</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Burk</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2001">2001</date>
			<publisher>ICMC</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">Chuck: A concurrent, on-the-fly audio programming language</title>
		<author>
			<persName><forename type="first">G</forename><surname>Wang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Cook</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">The chuck audio programming language</title>
		<author>
			<persName><forename type="first">G</forename><surname>Wang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">a strongly-timed and on-the-fly environ/mentality</title>
				<meeting><address><addrLine>USA</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2008">2008</date>
			<biblScope unit="page">I3323202</biblScope>
		</imprint>
	</monogr>
	<note type="report_type">Ph.D. thesis</note>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<title level="m" type="main">The Computer Music Tutorial</title>
		<author>
			<persName><forename type="first">C</forename><surname>Roads</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1996">1996</date>
			<publisher>MIT Press</publisher>
			<pubPlace>Cambridge, MA, USA</pubPlace>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<title level="m" type="main">The Audio Programming Book</title>
		<author>
			<persName><forename type="first">R</forename><surname>Boulanger</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Lazzarini</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2010">2010</date>
			<publisher>The MIT Press</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">An Overview of the FAUST Developer Ecosystem</title>
		<author>
			<persName><forename type="first">S</forename><surname>Letz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Orlarey</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Fober</surname></persName>
		</author>
		<ptr target="https://hal.science/hal-02158929" />
	</analytic>
	<monogr>
		<title level="m">International Faust Conference</title>
				<meeting><address><addrLine>Mainz, Germany</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Llvm: a compilation framework for lifelong program analysis and transformation</title>
		<author>
			<persName><forename type="first">C</forename><surname>Lattner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Adve</surname></persName>
		</author>
		<idno type="DOI">10.1109/CGO.2004.1281665</idno>
	</analytic>
	<monogr>
		<title level="m">International Symposium on Code Generation and Optimization</title>
				<imprint>
			<publisher>CGO</publisher>
			<date type="published" when="2004">2004. 2004. 2004</date>
			<biblScope unit="page" from="75" to="86" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<monogr>
		<author>
			<persName><forename type="first">M</forename><surname>Vail</surname></persName>
		</author>
		<title level="m">The synthesizer: a comprehensive guide to understanding, programming, playing, and recording the ultimate electronic music instrument</title>
				<imprint>
			<publisher>Oxford University Press</publisher>
			<date type="published" when="2014">2014</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<monogr>
		<title level="m" type="main">Unified ffi -calling foreign functions from pharo</title>
		<author>
			<persName><forename type="first">G</forename><surname>Polito</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Ducasse</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Tesone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Brunzie</surname></persName>
		</author>
		<ptr target="http://books.pharo.org/booklet-uffi/" />
		<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<monogr>
		<title level="m" type="main">The synthesis toolkit (stk)</title>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">R</forename><surname>Cook</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">P</forename><surname>Scavone</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1999">1999</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Composing sound objects in kyma</title>
		<author>
			<persName><forename type="first">C</forename><surname>Scaletti</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Perspectives of New Music</title>
		<imprint>
			<biblScope unit="page" from="42" to="69" />
			<date type="published" when="1989">1989</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<monogr>
		<title level="m" type="main">A Complex and Interactive Network: Carla Scaletti, the Kyma System, and the Kyma User Community</title>
		<author>
			<persName><forename type="first">M</forename><surname>Heying</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2019">2019</date>
			<pubPlace>Santa Cruz</pubPlace>
		</imprint>
		<respStmt>
			<orgName>University of California</orgName>
		</respStmt>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
