Share to: share facebook share twitter share wa share telegram print page

FAUST (programming language)

FAUST
Original author(s)Yann Orlarey, Dominique Fober, Stéphane Letz
Developer(s)GRAME, Centre National de Création Musicale
Initial release2002 (2002)
Stable release
2.60.3[1] / June 14, 2023 (2023-06-14)
Written inC++
Operating systemLinux, OS X, Windows, Unix
TypeFunctional programming language for audio signal processing
LicenseGPL
Websitefaust.grame.fr

FAUST (Functional AUdio STream) is a domain-specific purely functional programming language for implementing signal processing algorithms in the form of libraries, audio plug-ins, or standalone applications. A FAUST program denotes a signal processor: a mathematical function that is applied to some input signal and then fed out.

Overview

The FAUST programming model combines a functional programming approach with a block diagram syntax:

  • The functional programming approach provides a natural framework for signal processing. Digital signals are modeled as discrete functions of time, signal processors as second order functions that operate on them, and FAUST's block diagram composition operators, used to combine signal processors together, as third order functions, etc.
  • Block diagrams, even if purely textual as in FAUST, promote a modular approach to signal processing that complies with sound engineers' and audio developers' habits.

A FAUST program doesn't describe a sound or a group of sounds, but a signal processor. The program source is organized as a set of definitions with at least the definition of the keyword process (the equivalent of main in C):

process = ...;

The FAUST compiler translates FAUST code into a C++ object, which may then interface with other C++ code to produce a full program.

The generated code works at the sample level. It is therefore suited to implement low-level DSP functions like recursive filters. The code may also be embedded. It is self-contained and does not depend on any DSP library or runtime system. It has a very deterministic behavior and a constant memory size.

The semantics of FAUST is driven to be simple and well-defined. It allows the FAUST compiler to be semantically driven. Instead of compiling a program literally, it compiles the mathematical function it denotes. This may promote component reuse. Moreover, having access to the exact semantics of a FAUST program can simplify preservation issues.

FAUST is a textual language but block diagram oriented. It combines two approaches: functional programming and algebraic block diagrams, which are constructed via function composition. For that, FAUST relies on a block diagram algebra of five composition operations.

Example code

FAUST programs define a process function that operates on incoming data. This is analogous to the main function in most programming languages. The following is an example that produces silence:

process = 0;

The second example copies the input signal to the output. It involves the _ primitive that denotes the identity function for signals:

process = _;

Another example sums a stereo signal into a mono signal using the + primitive:

process = +;
Block diagrams generated by Faust from some simple programs

Most FAUST primitives are analogous to their C counterpart on numbers, but lifted to signals. For example, the FAUST primitive sin operates on a signal X by applying the C function sin to each sample X[t]. All C numerical functions have their counterpart in FAUST. Some signal processing primitives are specific to FAUST. For example, the delay operator @ takes two input signals: X (the signal to be delayed) and D (the delay to be applied), and produces an output signal Y such that Y(t) = X(t − D(t)).

Block diagram composition

Contrary to Max-like visual programming languages where the user does manual connections, FAUST primitives are assembled in block diagrams by using a set of high-level block diagram composition operations.

Simple examples of block diagram composition
The block diagram composition operators used in FAUST
f~g Recursive composition (precedence 4)
f,g Parallel composition (precedence 3)
f:g Sequential composition (precedence 2)
f<:g Split composition (precedence 1)
f:>g Merge composition (precedence 1)

Using the sequential composition operator : the output of + can be routed to the input of abs to compute the absolute value of the signal:

process = + : abs;

Here is an example of parallel composition using the , operator that arranges its left and right expressions in parallel. This is analogous to a stereo cable.

process = _,_;

These operators can be arbitrarily combined. The following code multiplies an input signal with 0.5:

process = _,0.5 : *;

The above may be rewritten in curried form:

process = *(0.5);

The recursive composition operator ~ can be used to create block diagrams with cycles (that include an implicit one-sample delay). Here is an example of an integrator that takes an input signal X and computes an output signal Y such that Y(t) = X(t) + Y(t−1):

process = + ~ _;

Generating full applications

Using specific architecture files, a FAUST program can be used to produce code for a variety of platforms and plug-in formats. These architecture files act as wrappers and describe the interactions with the host audio and GUI system. As of 2021, more than 30 architectures are supported and new ones may be implemented by anyone.

Screenshot of mixer.dsp (available in the FAUST distribution) using the jack-qt architecture
Some architecture files available for FAUST
alsa-gtk.cpp ALSA application + GTK
alsa-qt.cpp ALSA application + QT4
android.cpp Android applications
au.cpp Audio Unit plug-in
ca-qt.cpp CoreAudio application + QT4
ios-coreaudio.cpp iPhone and iPad applications
jack-gtk.cpp JACK application + GTK
jack-qt.cpp JACK application + QT4
ladspa.cpp LADSPA plug-in
max-msp.cpp Max MSP plug-in
pd.cpp Puredata plug-in
q.cpp Q language plug-in
supercollider.cpp Supercollider plug-in
vst.cpp VST plug-in
vsti-mono.cpp Monophonic VST Instrument plug-in
vsti-poly.cpp Polyphonic VST Instrument plug-in

Generating block diagrams

A useful option makes it possible to generate the block diagram representation of the program as one or more SVG graphic files.

It is useful to note the difference between the block diagram and the generated C++ code. As stated, the key idea here is not to compile the block diagram literally, but the mathematical function it denotes. Modern C/C++ compilers also don't compile programs literally. But because of the complex semantics of C/C++ (due to side effects, pointer aliasing, etc.) they can't go very far in that direction. This is a distinct advantage of a purely functional language: it allows compilers to do very advanced optimisations.

Arrows-like semantics

The Faust semantics is almost the same as that of Haskell's Arrows type class. However, the Arrow type class is not bound to signal processors.

Equivalences between FAUST and Arrow combinators
f~g loop ((\(a,b) -> (b,a)) ^>> f >>> id &&& (delay>>>g)) where delay is not a method of the Arrow type class, but is specific to signal processing arrows
f,g f***g
f:g f>>>g
f<:g f>>^h>>>g with appropriate function h (or &&& in special cases)
f:>g f>>^h>>>g with appropriate function h

The Arrow combinators are more restrictive than their FAUST counterparts, e.g., the nesting of parallel composition is preserved, and inputs of the operands of &&& must match exactly.

References

Read other articles:

KasangNagariKantor Wali Nagari KasangNegara IndonesiaProvinsiSumatera BaratKabupatenPadang PariamanKecamatanBatang AnaiKode Kemendagri13.05.02.2002 Luas-Jumlah penduduk- Kasang merupakan salah satu nagari yang terdapat dalam kecamatan Batang Anai, Kabupaten Padang Pariaman, Provinsi Sumatera Barat, Indonesia. Stasiun Duku berada di nagari ini, tepatnya di korong (dusun) Duku. Nagari Kasang ini berbatasan langsung dengan kota padang,dan pintu masuk menuju ke Bandar Udara Internasional Minang…

Grécia Antiga 2 000 a.C. – 168 a.C. Localização de Grécia AntigaMapa das colônias gregas no mar Mediterrâneo durante o Período Arcaico. O Partenon, um templo dedicado à deusa Atena, localizado na Acrópole de Atenas, é um dos símbolos mais representativos da cultura e da sofisticação dos gregos antigos Continente Eurásia e África Capital Não especificada Língua oficial Grego antigo Religião Religião grega antiga Governo Cidades-Estados Período histórico Antig…

The Right HonourableDavid LangeONZ CHDavid Lange pada saat pembukaan kantor pos baru di Foxton, 1980-an [[Perdana Menteri Selandia Baru]] 32Masa jabatan26 Juli 1984 – 8 Agustus 1989Penguasa monarkiElizabeth IIGubernur JenderalDavid BeattiePaul ReevesWakilGeoffrey Palmer PendahuluRobert MuldoonPenggantiGeoffrey Palmer[[Pemimpin Oposisi]] 23Masa jabatan3 Februari 1983 – 26 Juli 1984 PendahuluBill RowlingPenggantiRobert Muldoon[[Jaksa Agung]] 26Masa jabatan8 Ag…

Dattatreya Balkrushna Kalelkar (Devanagari: दत्तात्रेय बाळकृष्ण कालेलकर) (1 Desember 1885 – 21 Agustus 1981), yang lebih dikenal sebagai Kaka Kalelkar, adalah seorang aktivis kemerdekaan, reformator dan jurnalis India. Ia adalah pengikut utama filsafat dan metode Mahatma Gandhi. Kehidupan Kalelkar lahir di Satara pada 1 Desember 1885. Ia berasal dari desa Kaleli dekat Sawantwadi di Maharashtra yang memberikan marganya Kalelkar. Re…

Kitty MelroseKitty Melrose, from a 1907 publicationBornAgnes Butterfield(1881-09-06)6 September 1881Whitehaven, Cumberland, EnglandDied3 June 1912(1912-06-03) (aged 30)Westminster, London, EnglandCause of deathSuicide by asphyxiationOccupationStage actress Kitty Melrose (née Agnes Butterfield; 6 September 1881 – 3 June 1912) was an English stage actress and singer.[1] Life Melrose was born in Cumberland to Stephen and Jane Butterfield. Her father later worked as a clothier i…

Oksima adalah suatu senyawa kimia yang termasuk dalam kelompok imina, dengan rumus umum R1R2C=NOH, di mana R1 adalah suatu rantai samping organik dan R2 dapat berupa hidrogen, membentuk suatu aldoksima, atau gugus organik lain, membentuk suatu ketoksima. Oksima tersubstitusi-O membentuk suatu keluarga senyawa yang terkait erat. Amidoksima adalah oksima amida dengan struktur umum RC(=NOH)(NRR'). Oksima biasanya dihasilkan oleh reaksi hidroksilamina dengan aldehida atau keton. Istilah oksima beras…

The VagabondPoster teatrikal untuk The VagabondSutradaraCharles ChaplinEdward Brewer (sutradara teknikal)ProduserHenry P. CaulfieldDitulis olehCharles Chaplin (skenario)Vincent Bryan (skenario)Maverick Terrell (skenario)PemeranCharles Chaplin Edna Purviance Eric CampbellSinematograferWilliam C. FosterRoland TotherohPenyuntingCharles ChaplinDistributorMutual Film CorporationTanggal rilis 10 Juli 1916 (1916-07-10) Durasi24 menitNegaraAmerika SerikatBahasaFilm bisuIntertitel InggrisThe Vagabon…

C-141 Starlifter A United States Air Force C-141C of the 452d Air Mobility Wing in 2003 Jenis Strategic airlifter Pembuat Lockheed Penerbangan perdana 17 December 1963 Diperkenalkan 1965 Dipensiunkan 5 May 2006 Pengguna utama United States Air Force Dibuat 1963–1968 Jumlah 285 Lockheed C-141 Starlifter adalah airlifter strategis militer sayap tinggi (high wing) dalam pelayanan dengan Air Mobility Command (AMC) dari Angkatan Udara Amerika Serikat (USAF). Pesawat ini juga disajikan dengan s…

Peta Kabupaten Konawe Kepulauan di Sulawesi Tenggara Berikut adalah daftar kecamatan dan kelurahan di Kabupaten Konawe Kepulauan, Provinsi Sulawesi Tenggara, Indonesia. Kabupaten Konawe Kepulauan terdiri dari 7 kecamatan, 7 kelurahan dan 89 desa dengan luas wilayah 867,58 km² dan jumlah penduduk sebesar 37.126 jiwa (2019) dengan sebaran penduduk 43 jiwa/km².[1][2] Daftar kecamatan dan kelurahan di Kabupaten Konawe Kepulauan, adalah sebagai berikut: KodeKemendagri Kecamatan Juml…

نظام الدين النيسابوري تَعليق للنيسابوري على كِتاب التَذكرة في الهَيئة لأبو جَعفر مُحمد بِن الحَسن الطُوسي موقع إيران التيمورية، بتاريخ ديسمبر 1490. معلومات شخصية مكان الميلاد قم  تاريخ الوفاة سنة 1328 [1]  مواطنة إيران  الحياة العملية المهنة فيلسوف،  وفلكي،  وم…

Railway station in Greater Manchester, England Bromley CrossBromley Cross railway station in 2012.General informationLocationBolton, BoltonEnglandGrid referenceSD729131Managed byNorthern TrainsPlatforms2Other informationStation codeBMCClassificationDfT category EHistoryOpened1848Passengers2018/19 0.329 million2019/20 0.413 million2020/21 73,9882021/22 0.211 million2022/23 0.239 million LocationNotesPassenger statistics from the Office of Rail and Road Bromley Cross railway station, on Chapeltown…

Esporlatucomune(IT) Esporlatu(SC) Isporlàtu Esporlatu – Veduta LocalizzazioneStato Italia Regione Sardegna Provincia Sassari AmministrazioneSindacoAntonio Fadda (lista civica) dall'11-10-2021 TerritorioCoordinate40°23′08″N 8°59′24″E / 40.385556°N 8.99°E40.385556; 8.99 (Esporlatu)Coordinate: 40°23′08″N 8°59′24″E / 40.385556°N 8.99°E40.385556; 8.99 (Esporlatu) Altitudine474 m s.l.m. Superficie18,4 km² …

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字が含まれています(詳細)。 数字の大字(だいじ)は、漢数字の一種。通常用いる単純な字形の漢数字(小字)の代わりに同じ音の別の漢字を用いるものである。 概要 壱万円日本銀行券(「壱」が大字) 弐千円日本銀行券(「弐」が大字) 漢数字には「一」「二」「三」と続く小字と、「壱」「弐」…

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字が含まれています(詳細)。 数字の大字(だいじ)は、漢数字の一種。通常用いる単純な字形の漢数字(小字)の代わりに同じ音の別の漢字を用いるものである。 概要 壱万円日本銀行券(「壱」が大字) 弐千円日本銀行券(「弐」が大字) 漢数字には「一」「二」「三」と続く小字と、「壱」「弐」…

Soft drink from Thailand EstTypeColaManufacturerSermsuk Public Company LimitedCountry of origin ThailandIntroduced2012; 12 years ago (2012)Websitewww.estthai.com Est (stylized as est; Thai: เอส) Cola is a cola soft drink from Thailand, manufactured by Sermsuk Public Company Limited. It was launched on 2 November 2012.[1] History Est Cola was created following the termination of the company's contract with PepsiCo, for whom it had bottled and distributed Pepsi…

此條目可参照英語維基百科相應條目来扩充。 (2022年1月31日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记{{Translated page}}标签。 艾哈迈德·哈桑·贝克尔أحمد حسن البكر第4任伊拉克总统任期1968年7月17日—1979年7月16日副总统萨达姆·侯赛…

NGC 2169Ammasso apertoNGC 2169 situata nella costellazione OrioneScopertaScopritoreGiovanni Battista Hodierna Dataprima del 1654 Dati osservativi(epoca J2000.0)CostellazioneOrione Ascensione retta06h 08m 33s[1] Declinazione+13° 57′ 57″[1] Distanza3430[2] a.l. (1052[2] pc) Magnitudine apparente (V)5,9[1] Dimensione apparente (V)7' Caratteristiche fisicheTipoAmmasso aperto ClasseIII 3 m Età stimata11 milion…

Kasad in his youth Pritam Singh Sahni, or Kasad (1924–2008) was a Punjabi poet from New Delhi, India.[1] Kasad was active in Punjabi Kavi circles. He authored more than 20 books of Punjabi poetry and was also a playwright. Kasad's family moved from Gah, Pakistan during Partition of India in 1947. Although he struggled to support his family and settle in a new place, he was able to write poetry and to participate in gatherings all over India. In 1962, Kasad received a letter of appr…

American actress and singer (b. 1934) For other uses, see Shirley Jones (disambiguation). Shirley JonesJones in the 1970sBornShirley Mae Jones[1] (1934-03-31) March 31, 1934 (age 90)Charleroi, Pennsylvania, U.S.OccupationsActresssingerYears active1950–presentSpouses Jack Cassidy ​ ​(m. 1956; div. 1975)​ Marty Ingels ​ ​(m. 1977; died 2015)​ Children3, including Shaun and PatrickMus…

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Driver circuit – news · newspapers · books · scholar · JSTOR (January 2015) (Learn how and when to remove this message) The driver ADP3418 chip (bottom left), used for driving high-power field transistors in voltage converters. Above it is seen next to such a tran…

Kembali kehalaman sebelumnya