[Cs-dev] Faust opcodes
Date | 2013-06-13 16:06 |
From | Michael Gogins |
Subject | [Cs-dev] Faust opcodes |
Attachments | None None |
What does it take to build and run the Faust opcodes? Does it work with double-precision samples? How much of a compiler do you need installed on the Csound user's machine?
Thanks,
Mike Michael Gogins
Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com |
Date | 2013-06-13 18:37 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
I will write a bit about these later, but responding to your question. The dependencies are two: 1) LLVM - llvm.org 2) libfaust - this is from git faust2 branch. With these you can build the opcodes and run them. In my machine both LLVM and libfaust are statically linked, so the opcode lib contains all it's needed for running the opcodes. It does work with doubles (or floats). Regards On 13 Jun 2013, at 16:06, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-06-13 18:39 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
Way cool! Have you used Faust-generated code for anything yet, i.e. to make music? Thanks, Mike
Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Thu, Jun 13, 2013 at 1:37 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2013-06-13 18:47 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
I've just written the opcodes, so I have not had chance to do much but test it. Here's a code example: <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> nchnls=2 0dbfs = 1 giPluck faustcompile {{ import("music.lib"); // Excitator //-------- upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : >(0.0); size = hslider("excitation", 128, 2, 512, 1); // resonator //----------------- dur = hslider("duration", 128, 2, 512, 1); att = hslider("attenuation", 0.1, 0, 1, 0.01); average(x) = (x+x')/2; resonator(d, a) = (+ : delay(4096, d-1.5)) ~ (average : *(1.0-a)) ; process = noise * hslider("level", 0.5, 0, 1, 0.01) : vgroup("excitator", *(button("play"): trigger(size))) : vgroup("resonator", resonator(dur, att)); }}, "-vec -lv 1" instr 1 i3, a1 faustaudio giPluck k1 line p5, p3, p5*1.2 faustctl i3,"duration", sr/k1 faustctl i3,"attenuation", 0.01 faustctl i3,"play", 1 event_i "i",1, 0.1, 1, 1, 200+rnd(200) outs a1,a1 endin </CsInstruments> <CsScore> i1 0 4 1 200 e </CsScore> </CsoundSynthesizer> On 13 Jun 2013, at 18:39, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-06-13 18:53 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
Looks like a good, usable design. Could LLVM be used in this same way to compile C or C++ code for an opcode? It looks like the infrastructure here takes care of dynamic loading and dynamic linking for the user.
Regards, Mike Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Thu, Jun 13, 2013 at 1:47 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
|
Date | 2013-06-13 19:08 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
I guess it could. Without looking in detail at the internals (which I have not done), the description of what it happens is that LLVM compiles faust code into binary executable that is then instantiated. This binary code has a simple C++ interface which is called by the host (ie. Csound) to instantiate and run it to produce samples. The API is very straightforward. Victor On 13 Jun 2013, at 18:53, Michael Gogins wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |
Date | 2013-06-13 19:52 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] Faust opcodes |
Attachments | None None |
and here's a short video On 13 Jun 2013, at 19:08, Victor Lazzarini wrote:
Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie |