Audiobus(server,numchann)

That’s correct:

Plus some more characters.

If the !2 is responsible for the spillover ,Shouldn’t it then be going from 0-1 to 4-5 ?
Why would it spill over into preserved input busses ?
Will check tommorow if that’s indeed the case with the panner!2

I am not sure if I am following you .
For every note a new synth is created , iow voices .
If all these are routed to a bus with an effect , the ( instantiated) effect just processes these voices , the effect remains mono or stereo .
It just processes the incoming audio stream , not every single voice
Are you saying that new effects are instantiated for every voice ?
I thought this only happens when the effect is part of the synthdef voice .
Forgive me if I misunderstood you.

No. A single Out unit will place its channels only onto consecutive bus numbers. You’re responsible for constructing those channels correctly (if you want stereo, don’t give it quad, for instance).

hjh

This is the same as the variable-resolution issue that we talked about before.

When you create the pattern object, ~bus gets immediately resolved to its concrete Bus object.

The pattern retains no magical link back to the bus variable.

If you change the bus variable’s referent to a new Bus, the pattern could only pick that up if it has a magical variable link. But there is none!

You can explicitly create a link by \bus, Pfunc { ~crazy } – this isn’t magical because it’s written out :wink:

hjh

Unfortunately, I’m not sure exactly what in my post you’re referring to…

You will only have as many reverbs as you instantiate. It has nothing to do specifically with a SynthDef or not. SuperCollider has no idea what an effect is, or what a voice is, or etc. This are distinctions that you’re making (and me too). A SynthDef doesn’t even technically have to make or modify sound at all.

So, if you instantiate only one reverb, and route all your voices into it, that’s what it’ll be. Using bus 30 & 31 or 0 & 1, or which ever you decide upon, it’s no different. All running voices are routed to whichever bus you specify. If you use Out for all the voices, the effect is that they will be summed on their respective bus. If that bus so happens to have your reverb at the end of the chain, so be it.

Check out those help files. And it also matters that the reverb is last in the chain of all your nodes, regardless of which bus it’s listening to, and which bus you’re sending your voices.

I tried running the code from your screenshot (as best as I can guess, since you’re running things out of order), and I can’t reproduce this problem.

At this point, there is too much guesswork. For example, when you’ve written Pdef(\crt).play(t) before t = TempoClock..., then I have to guess how you’re executing it. Probably I’m not doing the same thing that you are. Or possibly you ran something 30 minutes ago and forgot about it, and it’s affecting the current results.

So I would suggest to collect the actual instructions that you’re running. Then post those.

// start from scratch! completely from scratch!
// make sure there is absolutely nothing left over from some other code bit
thisProcess.recompile;

History.clear.end;

History.start;


// ... now do the things here...


History.end;

History.document;

Now you should have a new tab in the editor with:

///////////////////////////////////////////////////
// History, as it was on Wed Jul  6 08:22:40 2022.
///////////////////////////////////////////////////

// - 0:0:0.0 -  
(
SynthDef(\Reverberate, {
	|in = 30, out = 0, mix = 1|
	var signal, processed;
	signal = In.ar(in, 2);
	processed = FreeVerb.ar(signal, mix:mix);
	processed = (signal+processed)*0.5;
	processed.debug("reverb shape");
	Out.ar(out, processed);
}).add
)

// - 0:0:2.02 -  
~bus = Bus.audio(s, 2);

... etc...

You’re not going to get any concrete answers to these questions unless we know concretely, exactly, what you’re doing, in what order.

hjh

1 Like

What’s out of place in the example ?
It’s just the standard reverb with an instrument ( which can be anything you want).
A synth to launch the effect and a var to free it .
A bus variable and free bus
The Pdef(/crt).play(t) is bound to tempo
Tempo code seems good to
t=Tempoclock(124/60)_Permanent(true)
What code exactly is out place ?
Will upload snippet later

Going back to the latest posted example

  • Pdef(\crt) uses \bus, ~crazy but ~crazy = Bus.audio(s, 2) is all the way at the end. Running the statements in order, Pdef(\crt) plays nothing because \bus is being populated by nil.
  • Pdef(\crt).play(t) is written before t = TempoClock... so, if I run the statements in the order written, it plays at 60 bpm, not at 126 bpm.

So what is the order? Logically it would be SynthDef first, bus creation second, Pdef definition third, TempoClock creation fourth, Pdef(\crt).play fifth… but it isn’t written that way, so I don’t actually know what you’re doing. (And, the fact that you’re getting inconsistent behavior at different times suggests that the order in which you are running the statements is also not consistent.)

The code as written may be a useful notation for yourself, but it isn’t communicating accurately to other people. In this context, accurate communication is important.

hjh

See also Bus routing: ddwMixerChannel's approach

hjh

About the order of statements , doesn’t that only make sense when you’re executing them all at once or on start up .
Done manually
I evaluate tempoclock first , then the reverb, followed by synthdefs and lastly the pdefs and pdefs play .
Always worked till now

Just started up the pc, a single sine osc !2
Notice the audio level input
As I explained earlier , when I started two years ago with supercollider , it would only start up if it had acces to the microphone .
I had to make these settings in windows system settings , perhaps that is the reason why there is always a signal on bus 2.3
yep , it’s def. the microphone setting , I just turned it OFF in windows and SC gives me the following message
"

Booting with:
In: MME : IN (INTEGRA-7)
Out: MME : OUT (INTEGRA-7)
SC_PortAudioDriver: PortAudio failed at Pa_OpenStream with error: ‘Unanticipated host error’
could not initialize audio.
Server ‘localhost’ exited with exit code -1073740791.

"

For your personal use, that’s correct.

In context of this thread, you’re raising questions about differences in behavior between slight variations in the code.

To analyze the reasons for the different behaviors, it’s necessary to know exactly what was run, in what order.

If you write the code in the order 1-5-2-4-3 but executed it in the order 1-2-3-4-5, then it’s going to be harder for anyone else to understand the scenario.

This increases the probability of you receiving irrelevant or wrong answers (wasting time).

Help us to help you better.

Ok. For like the third time in this thread.

The audio input buses are always on.

They are always getting a signal from the soundcard.

You cannot turn this off. (Please stop trying to turn this off.)

Actually it just occurred to me – the fact that you see it in the level meter means that it must be coming from outside of SC. The level meter places the input-meter synth first in the chain (and the output-meter synth last). Therefore the input level being shown should be unaffected by any SC audio processing. If it’s unaffected by SC processing, then the level meter isn’t showing SC audio in the hardware input buses. Thus any nonzero audio in the hardware inputs must be external to SC.

If it’s external to SC, then it isn’t reflecting any bugs or weird behavior in SC. So there’s really nothing to worry about.

“But there’s a signal there and I don’t need it” – there is a simple solution to this: just don’t read from those buses.

hjh

I was mostly talking about wet dry processing in general
Most of the time I am sequencing with Pdefs ,
Synthdef (for synth ) has one Out.ar with a bus effect argument , another output Out.ar to main output , thus arg 0
When sequencing the synthdef from Pbind ,\out,~effectsbus , the other Out.ar in the synthdef itself provides the dry signal and no need to add this one in thePbind .
So far it’s working o.k. , just asking what the preferred method is

(
SynthDef(\layla,
	{|mdt=0.250,dt=0.10,dect=0.1,modspeed=0.5,modamt=0.01,hpf=100,in|
		var sig ,modulator;

		sig=In.ar(in,2);
		modulator=SinOsc.ar(modspeed)*modamt;
		sig=CombC.ar(sig,mdt,dt+modulator,dect);
		sig=HPF.ar(sig,hpf);
		Out.ar(0,sig)
}).add)

~comber=Synth(\layla,[\in,~speak,\mdt,0.5,\dt,0.01 ,\dect,0.8 ,\modspeed,0.8,\modamt,0.001,\hpf,100])
~comber.free
~comber.set(\mdt,0.5,\dt,0.01 ,\dect,0.8 ,\modspeed,0.8,\modamt,0.001,\hpf,100)//comber
~comber.set(\mdt,0.5,\dt,0.450 ,\dect,10 ,\modspeed,0.01,\modamt,0.001,\hpf,100)//  long delay
//



~speak=Bus.audio(s,2)
~speak.free
~speak




////
(
SynthDef (\simple,
{
|att=0.001,dec=0.200,mod=500,pitch=0,filterfreq=400,reso=0.5,vol=0.5,pan=0,out|
var sig,env;

		env=EnvGen.ar(Env([0,1,0],[att,dec],[0,-5]),doneAction:2);
		sig=Pulse.ar(pitch.midicps,mul:0.5)+Saw.ar((pitch+12.1).midicps,mul:0.5);///////I an
		sig=RLPF.ar(sig,filterfreq+(env*mod).clip(40,20000),rq:reso);
		sig=sig*env;
		sig=Pan2.ar(sig,pos:pan);
		Out.ar(out,sig*vol);//to effects bus ~speak
		Out.ar(0,sig*vol);//to main out
}).add
)
///////
(
Pdef(\zxcv,

	Pbind(\instrument,\simple,
		\dur,Pseq([4,4,4,4],inf),
		\pitch,Pseq([
			Pseq([[60,65,72]],4),
			Pseq([[63,65,67]],4)-3,
			Pseq([[60,69,65]],4)-7,
			Pseq([[53,60,67]],4)+2],inf),



		\filterfreq,Prand([400,440,600,400,2000,400,900,350,3000],inf),
		\dec,Prand([2,3,4],inf),
		\att,Pwhite(1.5,3,inf),
		\reso,Pseq([1,0.5,0.7],inf),
		\vol,Pseq([0.1,0.2],inf),
		\pan,Pseq([-0.3,1,0,0.3,1],inf),
		\out,~speak,
	)
))
/////////
t=TempoClock(124/60).permanent_(true)
Pdef(\zxcv).play(t);
Pdef(\zxcv).stop;
/////////////



This is also a method for changing the out in a Pdef
~speak is a bus variable
Using ~change in the pdef , changes between a totally wet and dry signal , ofcourse the pdef needs to be re-analyzed for changes to take effect .
Is it a no-go to assign a variable to an already declared variable ?
It works pretty well

~change=0//dry
~change=~speak//effects bus
~buss_10=Bus.audio(s,2);//creating new audio bus 
~change=~buss_10//switching to new audio bus 
~change=0///will set to main out 
~change=~speak//will set to ~speak bus which houses the effect 
//
(
Pdef(
	\crt,
	Pbind(
		\instrument,
		\twoop,
		\pitch,Pseq([40,40,40,49,37,42,42,54],inf)-2,
		\dur,Pseq([1/3,1/3,1/3],inf),
		\fmamt,Prand([2,1,3,10,2,10,2,3,4,11],inf),
		\modrel,Prand([0.425,0.525,0.500,0.550,1,0.625,0.500,0.5,0.8],inf),
		\modoffset,Prand([12,0,12,24],inf),
		\feed,Pwhite(0.3,0.5,inf),
		\pan,Prand([-0.3,0,0.3],inf),
		\amprel,Pwhite (0.08,0.3,inf),
		\out,~change,
		)
	)
)
)
SynthDef(\myFx, { |bus, mix|
    var sig = In.ar(bus, 2);
    var wet = ... your fx processing...;
    ReplaceOut.ar(bus, XFade2.ar(sig, wet, mix * 2 - 1));
}).add;

I usually start with a template like this. All other options will be more complicated IMO.

hjh

I don’t get why there is the same bus arg for the Replace.out ,wouldn’t 0 be suffice to route the effect to the main out ?
When I set the out of an effects to the same arg as it’s input ( like yo do in your example ) I hear nothing because the effect stays on that bus
Here’s a simple distortion effect
Set out to arg.bus and you won’t hear the processed sound

`
(
SynthDef(\dister,
   {|amt=1,bus,gain=0.4|
   	var sig;
   	sig=In.ar(bus,2);
   	sig=(sig*amt).tanh;
   	sig=sig*gain;
   	sig=Out.ar(0,sig);
}).add
)

~distro=Synth(\dister,[\bus,~grunge,\amt,10,\gain,0.5])
~distro.set(\amt,0.5);
~distro.set(\amt,10,\gain,0.3);
~distro.set(\amt,6,\gain,0.3);
~distro.free


~grunge=Bus.audio(s,2)`


IMO the simplest way to write fx inserts is to keep them on the same bus.

Then use another synth for the routing.

You’re probably thinking that another synth for routing is a complication. Actually I find that a more modular design ends up being simpler to use and debug. This is consistent with general findings in computer science.

I spelled it all out in the other thread, with a complete demonstration. Actually I wrote that thread for you.

hjh

Am I right in thinking that the oscilloscope busses actually show the signal that is GOING INTO the bus and not leaving the buss ( so processed )
For demonstration purposses I kept it as simple as possible
A synthdef saw wave going into a Synthdef hp filter
Synthdef saw out=nr 10
Synthdef hpfilter effect in =10
Looking at the scope on bus 10 we clearly see an unfiltered signal
The actual processed output appearing in the speakers is clearly filtered

(
SynthDef(\filter,
	{
		|in,vol=0.5,cutoff=800,reso=0.5|
		var sig;
		sig=In.ar(in,2);
		sig=RHPF.ar(sig,freq:cutoff,rq:reso);
		sig=sig*vol;
		Out.ar(0,sig)
}).add
)

///////
~filtah=Synth(\filter,[\cutoff,200,\reso,0.1,\in,10])
~filtah.set(\cutoff,1200,\reso,0.2)
~filtah.free

/////
(
SynthDef(\saw,
{ |out,freq=60,vol=0.5,att=0.001,dec=0.250|
var sig,env;
sig=SawDPW.ar(freq.midicps)*vol;
env=EnvGen.ar(Env([0,1,0],[0.001,0.250],[0,-5]),doneAction:2);
sig=sig*env!2;
Out.ar(out,sig);
}).add
)
////
~yoda=Synth(\saw)
~yoda.free;
/////
(
Pdef(\seq,
	Pbind(\instrument,
		\saw,
		\dur,0.125,
		\freq,Pseq([48,51,49,55,52],inf),
		\out,10,
	)
)
)
//
Pdef(\seq).play
Pdef(\seq).stop
///

Could you please answer why your last posted effect code has the same argument for both input and output ?
If I do that , the effects stays on that bus