GraysonPeddie wrote:I'm trying out Faust.
Could you please explain how this line of code works?
Code: Select all
process = par(in,5, _) <: ((_,_,_,_,_),( (_,_,_,_,_) :> lowpass(3,freq) : *(gain))) ;
well,
par(in,5, _) create 5 parallel lines, here Input Ports, as it is the first expression in the process ,
<: splits the previous sequence, here in splits the 5 lines into 10 lines, so it double the lines.
(_,_,_,_,_) this creates as well 5 parallel lines,
:> merge the lines of the previous sequence,
lowpass(3,freq) well, create a 3order lowpass with cutoff frequency
freq,
*(gain), multiply with "gain".
The
par keyword leads to the needed effect in the sequence, for example if you put a split (<:) behind a sequence like this
(_,_) , the result will look like this (1,2)<:(1,1,2,2). If you use par you will get par(2,_)<:(1,2,1,2).
So in the above code you get
par(in,5, _) <: (1,2,3,4,5),(1,2,3,4,5)
now we have
( (_,_,_,_,_) :> lowpass(3,freq) : *(gain)
) which makes it "one sequence, were 5 lines merged into one lowpass, and we have par(in,5, _) <:
((_,_,_,_,_),( (_,_,_,_,_) :> lowpass(3,freq) : *(gain))
), makes it one sequence. The result be 6 outputs, were 5 be simple lines (copy input to output) and the 6't be 5 merged lines into one lowpass. This cover the line par(in,5, _) <: (1,2,3,4,5),(1,2,3,4,5).
now, you like to use 6 inputs, use par(in,6, _) <: (1,2,3,4,5,6),(1,2,3,4,5,6). But you wouldn't use the 6't output in the first expression, therfore you can use a dead end, par(in,6, _) <: ((_,_,_,_,_,
!),( (_,_,_,_,_,_) :> lowpass(3,freq)
So to get what you want, you can replace the lines in the first expression with you highpasses.
par(in,6, _) <:(hp1,hp2,hp3,hp4,hp5,!),(_,_,_,_,_,_):> /(6) : lp;