Why is my example not duplicating and spreading the filter frequency ?
The second examle ( from a tutoriall ) does the same thig but rather on pitch frequency + panning , which I have ommited in my example
//
(
{
var a;
a=Saw.ar(220);
Mix.fill(4,{RLPF.ar(a,1000.200.rand,mul:1/4)});
}.play
)
//
Yes ,the period was a syntax error
I still havenât succefully achieved what youâre suggesting
I want the filter frequencies to be spread , just like the pitch example ( see above )
Also , why .rrand instead of .rand , the pitch example uses the latter
(
{
var a;
a=Saw.ar(220);
Mix.fill(4,{RLPF.ar(a,(200+1000.rand),mul:1/4)});
}.play
)
Here side by side , only difference is the filter versus pitch fill, it has the same settings as the pitch example (except higher values ) , but it doesnât give a filter unsion effect
you have a single oscillator going through 4 parrallel low pass filters think about it for a second - a 220 cycle saw wave have a fundamental of 220, a first partial of 440 a second partial at 660 etc.
if you have a low pass filter at 400 and a low pass filter at 500 what you will hear is simply a steeper cutoff above that first partial at 440. You will not get a clear impression of 2 different cutoff points.
now add another one at 1200. Now you have a little more of the first 3 partials and a shallower cutoff above that. again you will not hear distinct filter cutoff levels.
maybe what you want is resonant band pass filters in series!
regarding rrand⌠not to be a pedant but look it up in the help!
True to that about the lowpass filter, letâs try bandpass filter , we should have resonant peaks for each frequency ( fill is 4 , so four frequencies )
Still no frequency spread
I have looked up about rrand , the reasn why I used .rand is becasue of the example that used it succesfully for the pitch spread .
The manual does not clarify anything on how to achieve filter frequency spread , let alone the use of .rrand
Can you explain why .rand does not work with the filter but does with the pitch example ?
I am at the point of giving up completely .
As in the other thread, part of the problem here is to define your terms clearly.
âCan you explain why .rand does not work with the filter but does with the pitch example?â So right here â those words âdoes not work.â They are essentially useless for troubleshooting.
99 times out of a hundred, in programming, âdoes not workâ really means âI expected x but got y.â Youâre hearing something different from what you expected. Ok.
So⌠what is the thing you expected to hear?
Then, problem-solving in programming (at least for me) proceeds like a kind of pincer movement: bottom up (building a lower level component I know I will need), and top down (sketching out the big picture and filling in details one by one with lower level functions). Trying to build the whole thing in one go almost always fails. What works: taking one piece of the puzzle at a time.
Iâd suggest: first, make one filter sound the way you want it to. Just one, at one frequency. âFrequency spreadâ is a separate problem. You donât have to do frequency spread in your first draft. Just get one filter to sound like you want. You can add the random frequencies later.
Some concrete advice about BPF:
If itâs too quiet, try rq = (something); BPF.ar(sig, ffreq, rq) / rq. That changes it to a âconstant skirt gainâ filter which compensates for the loss of energy.
Try different sources. If Saw isnât getting what you want, try other waves (maybe Blip â sawtooth loses energy in higher partials, Blip doesnât) or noise. (Noise â BPF is a common formula.)
If the fundamental frequency of the input oscillator is higher than the filter frequency, likely thatâs wasting a filter. Doesnât make sense to have a filter preserving frequencies that you already know are not present in the input.
Edit: Forgot this one. Filter resonance, the sense of pitch may be a bit weak â but distort the f@*! out of it, and the pitch becomes stronger (as in Underworldâs âRezâ).
PS the BPFs already do have âfrequency spreadâ:
(
a = {
var a;
a=Saw.ar(220);
Pan2.ar(Mix.fill(4,{BPF.ar(a,(200+1000.rand),0.1,mul:1/4)}, SinOsc.kr( 0.5 ) ) );
}.play
)
a.trace;
a.free;
Scanning the trace output for BPF lines:
unit 1 BPF
in 0.196408 1056 0.1
out 0.0355624
unit 3 BPF
in 0.196408 890 0.1
out 0.0887948
unit 5 BPF
in 0.196408 829 0.1
out 0.0286774
unit 7 BPF
in 0.196408 680 0.1
out -0.0250518
So you have 4 BPFs with frequencies 1056, 890, 829, 680.
âCan you explain why .rand does not work with the filter but does with the pitch example ?â â it is already working with the filter.
The problem is with the sound-generation approach.
Sorry but the statement that the saws are the same frequency doesnât matter att all ,
Hereâs a simple example I did in reaktor which I know like the back of my hand
Altough you only see one osc module and 1 filter module , there are in fact 4 of each becausee the ensemble is set to four voices .
I used the voice count to divide the frequency of the filter : 8000 by 4 (nr. of voices ) and then multiplied by each voice ( which has a unique i.d. number starting from 1,2,3 etc) , so you get resonant peaks at 2000,4000,6000,anfd 8000 hz , whcih you clearly see in the spectrum view
The saw oscillator set to midi pitch 32 , and this goes for all 4 duplicates ( some slight detuning of 50 cents per osc.) ,
This is what I wanted to achieve in supercollider , more or less with random filter frequency deviation
So you used a different oscillator frequency and different filter frequencies from your Reaktor patch⌠Iâm not quite surprised that it didnât sound the same.
Acoustical reason: If the oscillator is at 220 Hz, partials will be 220, 440, 660, 880, 1100, 1320 and so on. The randomly chosen filter frequencies are between 200 and 1200 Hz â so the harmonics available to be filtered are very widely spaced compared to the filter frequencies. Thereâs no way youâll get clearly defined resonant peaks that way â raising the oscillator by a factor of 4 and dropping the filters by a factor of 10 totally changes the behavior of the system. The result you reported initially is acoustically correct for the parameters given.
I am certainly having difficulties explaining myself , thanks for the upload but thatâs not what I wanted
, but is that just one filter with four frequencies ( written in the array ) ,
The reaktor example was just a showcase of filter spread .
Either way , both of you thanks for the help @semiquaver by no means was my comment meant to be agressive .
I hope you can understand that this is a bit frustrating for me , at least the whole coding concept .
Sometimes I wonder why I am learning supercollider since I can do this stuff in reaktor withouut to much haslee ( reaktor core has itâs flaws too ) but there is something satisfying and magical about writing a few lines of code .
edit
At least I learned something new , writing (100,200âŚ600) gives an array with increments of 100 up to 600 ( edit wrong about that one)
But I think you wrote an error in your comment line or Array.series(4, 2000, 2000) (this gives nothing )
Shouldnât that be [4,2000,2000] ?
This is incredibly powerfull , by just typing an array in filter frequency , weâre essentially making duplicates of that filter , + sum
Can you understand why it is so frustrating , sum + array are essential for this , yet no combination of these kind of examples are to be found.
Sure the manula talks about adressing the left and right output etc⌠but not how the sum can be used etcâŚ
Question how would one write , without the komma being interpreted as the start of new argument
I know I could assign this to a variable , but still
Start from freq 100 , increments by 50hz up to 400
I know that a comment line gives nothing ( I see that as an insult )
YOu wrote in comment as an alternative method Array series (4, 2000, 2000)
When pasted and exectuted ( not as a comment it does not give an array
Only later I found out that âArray seriesâ is part of code Array.series(4, 2000, 2000)
And I sincerely thank you for the.sum example , just trying to say that this would be welcome in the manual .
Supercollider is almost impossible to learn with just the manual
I honestly didnât intend any insult â I had written a correct expression and was surprised to hear that it produced nothing, and I was speculating as to reasons why a correct expression would produce nothing. Accidentally running it as a comment is a plausible reason⌠Iâm sorry my remark was taken badly.
With that said, weâre in a context here where people are trying to help you and youâve been quite argumentative. I also feel insulted by some of the exchange here.
If you donât understand code that someone has posted, Iâd like to suggest that maybe it would be a better approach to ask why the example is written that way, instead of âthanks for the upload but thatâs not what I wantedâ (it is what you wanted! â basically implying that I donât understand a parallel filter bank or how to write it). That was frustrating⌠taking time to explain something and being told âyou donât get itâ⌠not a good way to treat volunteer helpers.
I agree with you here.
Programmers are often bad at technical writing.
SC documentation tends to focus on objects and methods and largely excludes patterns of usage. Iâve been making that comment for years but time is scarce, for all of us. Some years ago I wrote documentation for patterns that includes a âCookbookâ section of common use cases. We could use a synthesis cookbook but it hasnât been written yet.
Does that look weird, with the doubled parentheses? It kinda does⌠which is probably why you didnât think of it. But the two pairs of parentheses have different meanings. The outer pair encloses the argument list for ar. The inner pair is for the series notation.
Because this situation needs series notation inside an argument list, you have to have both pairs.
As a general comment: Based on reading a lot of your posts, I get the impression that, in code, youâre reading the words and numbers as very important and the symbols as not so important. (For instance, when I wrote Array.series(...) = âArray -dot- series(âŚ)â and you read âArray series,â or my series notation had two dots and you read three.)
The symbols are just as important as the words. Itâs a matter of retraining your eye to catch these details.