Content deleted Content added
ColaEuphoria (talk | contribs) |
Add category |
||
(34 intermediate revisions by 29 users not shown) | |||
Line 1:
{{Short description|Audio programming language}}
{{redirect|FAUST|other uses|Faust (disambiguation){{!}}Faust}}
{{
{{Infobox software
| name
| developer
| author
| released
| latest release version =
| latest release date
| operating system
| genre
| repo = {{URL|https://github.com/grame-cncm/faust/}}
| programming language
| license
| website
}}
{{Portal|Free and open-source software}}
'''FAUST''' (Functional AUdio STream) is a [[
==Overview==
The FAUST [[programming model]] combines a
* The functional programming approach provides a natural framework for [[signal processing]]. Digital signals are modeled as [[Sequence|discrete functions]] of time, signal processors as [[Higher-order function|second order functions]] that operate on them, and
* Block
A FAUST program
<
process = ...;
</syntaxhighlight>
The FAUST [[compiler]] translates FAUST
The generated code works at the sample level. It is therefore suited to implement low-level [[Digital signal processing|DSP]] functions like [[Infinite impulse response|recursive filters]].
The
FAUST is a textual language but
==Example
FAUST programs define a <code>process</code> function that operates on incoming data. This is analogous to the <code>main</code> function in most programming languages. The following is an example that produces silence:
<
process = 0;
</syntaxhighlight>
The second example copies the input signal to the output. It involves the <code>_</code> primitive that denotes the [[identity function]] for signals:
<
process = _;
</syntaxhighlight>
Another example sums a stereo signal into a mono signal using the <code>+</code> primitive:
<
process = +;
</syntaxhighlight>
[[File:Faust-simple-block-diagram.jpg|thumb|Block
Most FAUST primitives are analogous to their C counterpart on numbers, but lifted to signals. For example, the FAUST primitive <code>sin</code> operates on a signal X by applying the [[C (
Some [[signal processing]] primitives are specific to FAUST. For example, the delay operator <code>@</code> 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
Contrary to [[Max (software)|Max-like]] [[visual programming languages]] where the user does manual connections, FAUST primitives are assembled in [[block diagram]]s by using a set of high-level block diagram [[Function composition|composition]] operations.
[[File:Faust-simple-block-diagrams.jpg|thumb|upright=1.75|Simple examples of block
{| class="wikitable"
|+ The block
| f~g || Recursive composition (precedence 4)
|-
Line 70 ⟶ 72:
Using the sequential composition operator <code>:</code> the output of <code>+</code> can be routed to the input of <code>abs</code> to compute the [[absolute value]] of the signal:
<
process = + : abs;
</syntaxhighlight>
Here is an example of parallel composition using the <code>,</code> operator that arranges its left and right expressions in parallel. This is analogous to a stereo cable.
<
process = _,_;
</syntaxhighlight>
These operators can be
<
process = _,0.5 : *;
</syntaxhighlight>
The above may be rewritten in [[currying|curried]] form:
<
process = *(0.5);
</syntaxhighlight>
The recursive composition operator <code>~</code> can be used to create block
<
process = + ~ _;
</syntaxhighlight>
==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.
[[File:Faust-mixer-jackqt.jpg|thumb|Screenshot of mixer.dsp (available in the FAUST distribution) using the jack-qt architecture]]
Line 97 ⟶ 99:
{| class="wikitable"
|+ Some architecture files available for FAUST
! File
| alsa-gtk.cpp || ALSA application + GTK▼
! Architecture
|-
| alsa-
|-
|-
| android.cpp || Android applications
Line 105 ⟶ 110:
| au.cpp || Audio Unit plug-in
|-
| ca-qt.cpp || CoreAudio application +
|-
| ios-coreaudio.cpp || iPhone and iPad applications
Line 111 ⟶ 116:
| jack-gtk.cpp || JACK application + GTK
|-
| jack-qt.cpp || JACK application +
|-
| ladspa.cpp || LADSPA plug-in
Line 117 ⟶ 122:
| max-msp.cpp || Max MSP plug-in
|-
| pd.cpp ||
|-
| q.cpp || Q language plug-in
|-
| supercollider.cpp ||
|-
| vst.cpp || VST plug-in
Line 130 ⟶ 135:
|}
==Generating block diagrams==
A useful option makes it possible to
As already said, the key idea here is not to compile the block diagram literally, but the mathematical function it denotes. Modern C/C++ compilers too don’t compile programs literally. But because of the complex semantic of C/C++ (due to side effects, pointer aliasing, etc.) they can’t go very far in that direction. This is a distinctive advantage of a purely functional language: it allows compilers to do very advanced optimisations.▼
▲
The Faust semantics is almost the same as that of [[Haskell (programming language)|Haskell]]'s [[Arrow (computer science)|Arrows]] type class.▼
==Arrows-like semantics==
▲The Faust semantics is almost the same as that of [[Haskell (programming language)|Haskell
However, the Arrow type class is not bound to signal processors.
{| class="wikitable"
|+ Equivalences between FAUST and Arrow combinators
| <code>f~g</code> ||
|-
| <code>f,g</code> || <code>f***g</code>
Line 152 ⟶ 157:
|}
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 <code>&&&</code> must match exactly.
==References==
Line 194 ⟶ 197:
| year = 2011
}}
* {{cite journal
|first1
|last1
|first2
|last2
|title
|journal
|url
|year
|volume=37
|issue=3
|pages=113–131
|doi=10.1016/j.cl.2011.03.001
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{Cite web
| first = Julius O.
Line 211 ⟶ 218:
| year = 2011
}}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
| first3 = Dominique
Line 244 ⟶ 251:
| year = 2010
}}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
| first1 = Pierre
Line 269 ⟶ 276:
| last2 = Orlarey
| title = Depandant Vector Types for Multirate Faust
| journal = Proceedings of the 7th Sound
| url = http://smcnetwork.org/files/proceedings/2010/51.pdf
| pages = 345–352
| year = 2010
| access-date = 2011-10-11
| archive-url = https://web.archive.org/web/20120407043121/http://smcnetwork.org/files/proceedings/2010/51.pdf
| archive-date = 2012-04-07
| url-status = dead
}}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite book
| first1 = Pierre
Line 295 ⟶ 306:
| url = http://faust.grame.fr/images/faust-doc/papers/multirate-faust.pdf
| year = 2009
}}{{Dead link|date=December 2019 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
| first2 = Dominique
Line 306 ⟶ 317:
| url = http://smc2009.smcnetwork.org/programme/pdfs/232.pdf
| year = 2009
| archive-date = 2012-04-25
| access-date = 2011-10-11
| archive-url = https://web.archive.org/web/20120425061241/http://smc2009.smcnetwork.org/programme/pdfs/232.pdf
| url-status = dead
}}
* {{cite book
Line 320 ⟶ 335:
| isbn = 978-2-7521-0054-2
| year = 2009
}}{{Dead link|date=December 2019 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
| first = Albert
Line 346 ⟶ 361:
| last = Smith III
| title = Introduction to Digital Filters: With Audio Applications
| chapter = Appendix K.
| publisher = W3K Publishing
| year = 2007
| isbn = 978-0-9745607-1-7
| chapter-url =
| pages =
}}
* {{cite journal
Line 389 ⟶ 404:
| publisher = Computer Music Association
| url = http://quod.lib.umich.edu/cgi/t/text/text-idx?c=icmc;idno=bbp2372.2005.*
|
| year = 2005
| page = 286
Line 404 ⟶ 419:
| url = http://faust.grame.fr/images/faust-doc/papers/faust-soft-computing.pdf
| year = 2004
}}{{Dead link|date=December 2019 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
* {{cite journal
|
|
|
|
|
|
|
|
|
|
}}{{dead link|date=December 2016 |bot=InternetArchiveBot |fix-attempted=yes }}
{{Refend}}
==External links==
{{
*
* {{GitHub|grame-cncm/faust}}
[[Category:Audio programming languages]]
[[Category:Programming languages created in 2002]]
|