One correction : sed -i 's/par(/seq(/g' scanSynth.dsp

or as an attachment

Can I use seq for rwtable writing stream ? How else to create a stream?

Sébastien


Le 07/06/2018 à 18:30, Sébastien Clara a écrit :

Hi list,

I try to implement the scanned synthesis algo in Faust.You can find all the information about this synthesis there : http://www.billverplank.com/ScannedSynthesis.PDFand more particularly in the appendix.

Unfortunately, my code crashes during compilation and I do not know if my mistake comes from:

- the construction of my circular string,

- the excitement of my string,

- when updating my string,

- my use of rwtable,

- or a mix of all this?

Any idea? Thanks,

Sébastien




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

declare name "Scanned Synthesis";
declare description "Source : http://www.billverplank.com/ScannedSynthesis.PDF";;
// declare nvoices "8";


import("stdfaust.lib");


gate = button ("v:ScannedSynthesis/h:[1]midi/[0]gate");
freq = hslider("v:ScannedSynthesis/h:[1]midi/[1]freq[unit:Hz] [style:knob]", 
220, 20, 5000, 1);
gain = hslider("v:ScannedSynthesis/h:[1]midi/[9]gain [style:knob]", 0.1, 0, 1, 
0.1):si.smoo;
bend = 
hslider("v:ScannedSynthesis/h:[1]midi/[2]bend[hidden:1][midi:pitchwheel][style:knob]",1,0.9,1.1,0.01):si.polySmooth(gate,0.999,1);


sr = 1/0.005;
nbMass = 30;

m = hslider("v:ScannedSynthesis/h:[2]Physical/[1]mass [style:knob]", 1, 0, 100, 
0.01); //masse de l’élément i.
k = hslider("v:ScannedSynthesis/h:[2]Physical/[2]tension [style:knob]", 1, 0, 
100, 0.01); //raideur effective entre les éléments i et i-1.
c = hslider("v:ScannedSynthesis/h:[2]Physical/[3]spring [style:knob]", 1, 0, 
100, 0.01); //raideur entre la terre et le i ème élément,
d = hslider("v:ScannedSynthesis/h:[2]Physical/[4]damping [style:knob]", 1, 0, 
100, 0.01); //amortissement du i ème élément.
f = hslider("v:ScannedSynthesis/h:[2]Physical/[5]force [style:knob]", 0.1, 0, 
100, 0.1);

p1 = (2+(sr*d/m)+(2*2*sr*k/m))/denom;
p2 = (2*sr*k/m)/denom;
p3 = 1/denom;
p4 = (2*sr/m)/denom;
denom = 1-(sr*d/m)+(2*sr*c/m);


x = ba.if(gate==1,
        seq(i, nbMass, ba.if(i==int(nbMass/2),1,ba.take(i+1,x'))),
        seq(i, nbMass,
                // Xi(n) = P1.Xi(n-1) + P2.[Xi-1(n-1) + Xi+1(n-1)] + P3.Xi(n-2) 
+ P4.f
                ba.if(i==0,
                        (p1*ba.take(i+1,x@ba.sec2samp(1/sr))) + 
(p2*(ba.take(nbMass,x@ba.sec2samp(1/sr)) + ba.take(i+2),x@ba.sec2samp(1/sr))) + 
(p3*ba.take(i+1,x@ba.sec2samp(2/sr))) + (p4*f),
                        (p1*ba.take(i+1,x@ba.sec2samp(1/sr))) + 
(p2*(ba.take(i,x@ba.sec2samp(1/sr)) + 
ba.take((i+2)%(nbMass+1)),x@ba.sec2samp(1/sr))) + 
(p3*ba.take(i+1,x@ba.sec2samp(2/sr))) + (p4*f)
                )
        )
);

upD = +(1)~_;
process = rwtable(nbMass, 0.0, upD%nbMass, x, os.phasor(nbMass, 
freq*bend))*gain;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to