Beginner question

how do i send one oscillator output into 2 or more bandpass filters in parallel?
please give a simple code example if you can

thank you very much

Welcome!

Mouse X and Y control the frequencies of two parallel BP filters which are then summed:

(
{
  var osc = Saw.ar(100) * 0.2;
  var freq1 = MouseX.kr(100, 10000, \exponential);
  var freq2 = MouseY.kr(100, 10000, \exponential);
  var bp1 = BBandPass.ar(osc, freq1);
  var bp2 = BBandPass.ar(osc, freq2);
  Pan2.ar(bp1 + bp2);
}.play
)

A bit more advanced, create an array of 10 BP filters with randomly varying frequencies and spread them across the stereo field:

(
{
  var osc = Saw.ar(100) * 0.2;
  var freqs = { LFDNoise3.kr(Rand(0.1, 10)).exprange(100, 10000) }.dup(10);
  var bps = BBandPass.ar(osc, freqs, 0.5);
  Splay.ar(bps);
}.play
)

hope this gets you off to a good start!

1 Like

wow thanks for the answer! i asked on facebook too, theres a supercollider group there too. what’s interesting is that everyone has a different solution to the same question. thanks for your help. i will try out these examples now. supercollider and the community are awesome.

Worth noting BPF.ar is a lot more efficient than BBandPass.ar. The basic filter UGens tend to have a lot less overhead than the Biquad filters