FaustLive - Linux Audio Conference

FaustLive
Just-In-Time Faust Compiler... and much more
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober
{sdenoux, letz, orlarey, fober} @grame.fr
LAC
03 May 2014
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
1 / 34
Table of contents
Faust
FaustLive - Basic Features
FaustLive - Interfacing systems
FaustLive - Audio Drivers
FaustLive - Remote Processing
FaustLive - Export
Conclusion
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
2 / 34
Faust
Faust Language
Faust is a Domain-Specific Language for real-time signal processing and
synthesis. A Faust program denotes a signal processor :
I
A signal processor is a mathematical function that maps a group of n
input signals to a group of m output signals.
I
Everything in FAUST is a signal processor :
I
I
I
’+’
’3.14’
Programming in FAUST is essentially combining signal processors.
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
3 / 34
Faust
Faust - Example
random = +(12345) *(1103515245);
noise = random/2147483647.0;
process = noise * vslider("Volume[style:knob]", 0, 0, 1, 0.1);
Learn more about faust programming : http://faust.grame.fr
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
4 / 34
Faust
Faust Compiler - Role
%
.9)%
6'"5(%%
7,/$%
:.;/,<5%
!"#$%
&'('%
A'>%
A5*%
!"#$%
&'('%
7,8*.-$#%
?;/#,./%
9)=%
!"#$%
&'('%
9:4%
4.;">%
)"*$#%
+,--./$#%
@)3%
@)3%
?-5'%
23%
75,";/%
)"*$#%
+,--./$#%
0'+1%
23%
A'>%
75,";/%
A5*%
)"*$#%
+,--./$#%
4'/5*'%
%
A'>%
75,";/%
A5*% 4@C%
&))B%
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
5 / 34
Faust
Faust Compiler - Structure
!
3456-*!
+(5+04(!
/,01+!!
".2(!
/,01+!
".%&-'(4!
"##!
$%&'(%()*
+,+-.)!
755!!
".%&-'(4!
3&&'-5,+-.)!
84!
9'0:-)!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
6 / 34
Faust
Faust Application Structure
!
!
"#$%!
&'($%)*+$!
!
*",&-!
+-./"(*(&-'!
!
*",&-!
,%&0$%!
!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
7 / 34
Faust
Faust Application Structure
!
!
!
"#$%&!
'()*!
"#$%&!
'&()#*"*%&+!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
8 / 34
Faust
Faust Application Structure
!
!
!"#$%&'#&("')
!
+,!
!
-$).(!
/0.1*0!
!
!
"#$%&!
'()*!
"#$%&!
'&()#*"*%&+!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.frLAC
() 03 May 2014
9 / 34
Faust
Faust Application Structure
!
!
!"#$%&'#&("')
!
+,!
!
-$).(!
/0.1*0!
!
!
"#$%&!
'()*!
"#$%&!
'&()#*"*%&+!
!
"#$%&!
$,%-.,!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
10 / 34
Faust
Faust Application Structure
!
!
!
"#$%!
&'($%)*+$!
!"#$%&'#&("')
!
+,!
!
-$).(!
/0.1*0!
!
!
"#$%&!
'()*!
*",&-!
+-./"(*(&-'!
!
*",&-!
,%&0$%!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
11 / 34
Faust
Embeddable Compilation Chain
!
!
)*+,-!!
./01!
"'()*+,-!
""#$!
%&!
"'(""#$!
223450,657*8-/9:;!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
12 / 34
Faust
Faust Compiler’s API
I
createDSPFactory(const std::string& filename,
int argc, const char* argv[],
const std::string& target,
std::string& error_msg,
int opt_level)
Builds the prototype of the class
I
createDSPInstance(llvm_dsp_factory* factory)
Creates an instance of this class
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
13 / 34
Faust
Existing Embedded Faust Compilers
I
Max/MSP (faustgen)
I
CSound (faustcsound)
I
Antescofo
I
Open Music (through LibAudioStream)
I
iScore
I
Your Developement Is Coming Soon ...
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
14 / 34
FaustLive - Basic Features
What is FaustLive ?
FaustLive is a QT-based software.
!
!
"#$%!
&'($%)*+$!
It aims to create a dynamic
environment for Faust prototyping.
!
*",&-!
+-./"(*(&-'!
It includes more advanced features.
!
It is self-contained.
*",&-!
,%&0$%!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
!
15 / 34
FaustLive - Basic Features
Basic Features
2 basic features ...
I
Drag and Drop Compilation
I
Source Edition
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
16 / 34
FaustLive - Basic Features
Basic Features
2 basic features ...
...customized with
I
Drag and Drop Compilation
I
Crossfade
I
Source Edition
I
Maintained Jack Connections
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
16 / 34
FaustLive - Basic Features
Basic Features
2 basic features ...
...customized with
I
Drag and Drop Compilation
I
Crossfade
I
Source Edition
I
Maintained Jack Connections
!
!
!
!
!
!
!
!
"##! $'(&!
$%&!
!
"##!
$%&!
$'(&!
"#$%!
&'($%)*+$!
!
!
!
!
!
*",&-!
+-./"(*(&-'!
!
!
!
*",&-!
,%&0$%!
!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
16 / 34
FaustLive - Basic Features
Embedded Full Compilation Chain in FaustLive
!
!
!"#$%%$%&'())&*+",-)./-+0&*1.-0&
'()*+!!
,-./!
"01'()*+!
""#$!
%&!
"01""#$!
'2345!
"%#6!
27890+/8+)7/!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
17 / 34
FaustLive - Interfacing systems
Interfaces Diversity
!
!
"#$%!
&'($%)*+$!
!
*",&-!
+-./"(*(&-'!
!
*",&-!
,%&0$%!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
18 / 34
FaustLive - Interfacing systems
!
Interfacing systems
I
OSC Control
Open Sound Control protocol
is enabled on an UDP port.
!
!
!
I
HTTP Control
A HTTP server is started to
deliver a HTML interface.
The interface is available on
any browser.
!
!"#$%&'%()"*!*$%+&
!"#$%&#,$-.,&
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
19 / 34
FaustLive - Audio Drivers
Audio Drivers Diversity
!
!
"#$%!
&'($%)*+$!
!
*",&-!
+-./"(*(&-'!
!
*",&-!
,%&0$%!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
20 / 34
FaustLive - Audio Drivers
Audio Drivers Diversity
Available drivers :
I
On Linux : Jack and NetJack
I
On OSX : CoreAudio, Jack and NetJack
I
On Windows : PortAudio, Jack and NetJack
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
21 / 34
FaustLive - Audio Drivers
Remote Audio Rendering with NetJack
NetJack is used in a light mode, through libjacknet, instead of using Jack
server. This library contains the slave/master NetJack protocol.
!"#$%&
'$#()*+&
!
,+-".+&
'$#()*+&
!
!
!
"#$%&!
/012345&
46//04176/&
!
'$"(&)!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
22 / 34
FaustLive - Remote Processing
Remote Processing
!
!
"#$%!
&'($%)*+$!
!
*",&-!
+-./"(*(&-'!
!
*",&-!
,%&0$%!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
23 / 34
FaustLive - Remote Processing
Remote Processing
!"#$%&
'$#()*+&
!
,+-".+&
'$#()*+&
!
!
!
!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
24 / 34
FaustLive - Remote Processing
Tools for remote Processing
I
Remote Server, a command line application that starts a server
waiting for:
I
I
Compilation requests
Processing requests
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
25 / 34
FaustLive - Remote Processing
Tools for remote Processing
I
Remote Server, a command line application that starts a server
waiting for:
I
I
I
Compilation requests
Processing requests
Remote Client API, a "proxy" API to make transparent the creation
of remote dsp.
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
25 / 34
FaustLive - Remote Processing
Tools for remote Processing
I
Remote Server, a command line application that starts a server
waiting for:
I
I
Compilation requests
Processing requests
I
Remote Client API, a "proxy" API to make transparent the creation
of remote dsp.
I
FaustLive, using the API for remote processing.
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
25 / 34
FaustLive - Remote Processing
Remote Processing - Flows
"#$%&'()*!
!!
"4567!
189:!
+*,-&*./%0!
#0(!
+*,-&*!
,#12(3*!
;<:47:+:=87:/%0"4;78<>!
;<:47:/%0"4;78<>!
EED=F96G!
FH4;78<>!
<:=87:F96GF!
H4;78<>!
;<:47:+:=87:/%0(?674?;:!
!
. 6:?9!<:@5:67!
. ;<:47:!?:7A4;B!=467:<!
<:=87:F96G!
3*&I#1J!1-33*1&(-3!
<:;:CD:+:@5:67!
!
. ;<:47:/%0(?674?;:!
. ;<:47:!?:7A4;B!6E4D:!
EED=F96G!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
26 / 34
FaustLive - Remote Processing
Faust Remote API
I
getRemoteMachinesAvailable(map<string,pair<string,int>*
machine_list)
I
createRemoteDSPFactory(const string& filename,
int argc, const char* argv[],
const string& ip_server, int port_server,
string& error_msg, int opt_level)
I
createRemoteDSPInstance(remote_dsp_factory* factory,
int argc, const char* argv[],
int sampling_rate, int buffer_size,
RemoteDSPErrorCallback error_callback,
void* error_callback_arg, int& error)
I
getRemoteFactoriesAvailable(const string& ip, int port,
vector<pair<string, string> >* factories_list)
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
27 / 34
FaustLive - Remote Processing
Remote Processing - Configuration
!"#$%
!"#$%&'()%*$!
!"#$%&'()
!
!"#$%&
!"#$%&'()%*$(!
!"#$%&#'($)'
!"#$%&
!"#$%
!"#$%&'()%*$!
!"#$%&'()*+,-.'!,
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
28 / 34
FaustLive - Remote Processing
Remote Processing - iPad Use Case
I
A motivation :
Experiment quickly the faust applications that use
accelerometers.
I
A technical obstacle :
The interdiction to embed compilers in iOS application.
I
A solution:
Use the remote processing service.
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
29 / 34
FaustLive - Remote Processing
Remote Processing - iPad Configuration
!"#$%&'()%*$!
!"#$%&'()
"#$%&$'()*%+&,#-!
!"#$%&'()%*$!
!"#$%&'()*+,-.'!,
.$&/0%12%32$*%+&,#1$4!
!"#$%&'()%*$!
!"#$%&'()*+,-.'!,
"#$%&$'()564&%6+$!
!"#$%&'()%*$!
!"#$%&'()*+,-.'!,
!
!"#$
!"#$
!"#$
789:/";!"<778"95<7!
!"#$%&'()%*$!
!"#$%&'()*+,-.'!,
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
30 / 34
FaustLive - Export
Export with FaustWeb
FaustWeb is a web service for remote compilation :
http://faustservice.grame.fr.
"#$%&!
'()*!
!
"#$%&+*,!
-../01#&0(2!!
34!
5/$602!
FaustWeb can be used through a browser or programatically
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
31 / 34
FaustLive - Export
Export with FaustWeb
!
!"#$%+),*
!"#$%&'()*
123!
43$%/#.0!
5+0.!)(!
.$%/#.0!
!
"#$%&'!()%!!
$*$+,$-,#!.$%/#.0!
89:;!
<6-7!&%=#!
"#$%&%'()%*+!*&!!
&(,-)!-.+)(/!
-2(345#.!
!
0$#()%*+!*&!
,+%1,#!-2(345#.!
&*$!)2#!6-7!
!
?@;!
<5#.<7=()&*$>!
<($'2%)#'),$#!
A%+($.!&%=#!
0*>7%=()%*+!&*$!
'2*-#+!
($'2%)#'),$#!
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
32 / 34
Conclusion
Conclusion
I
FaustLive has some perspectives
For example : embed the remote server into FaustLive
I
Binaries will be soon available on : http://faust.grame.fr/
for OSX, Windows
I
The sources are already available on :
http://sourceforge.net/p/faudiostream/faustlive/ci/master/tree
I
This research was granted by the ANR (Agence Nationale de la
Recherche) [INEDIT]
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
33 / 34
Conclusion
Thank you for your attention
Sarah Denoux, Stephane Letz, Yann Orlarey, Dominique Fober FaustLive
{sdenoux, letz, orlarey, fober} @grame.fr
LAC() 03 May 2014
34 / 34