PmonoFx? How to approach it?

I’m aware of PbindFx with no main envelope and type \set
Two use cases for per-event fxs on Pmonos:

  • a Pmono source, with a Pbindfx like pattern of per-event effects
  • a Pmono source with a Pmono fx, whose events run synchronized

Is the technique mentioned in the above thread the best way to go? Or are there other options? How would you approach a situation where you want to add an fx to a Pmono?

There are certainly many options to make combinations of Pmono and fxs.

The first case you mentioned (if I understand correctly) is described in the thread, Pmono is routed into the PbindFx. The second case could be done in by routing via an audio bus (set ‘out’ of the source Pmono) and sharing the duration data between the streams.

As with (2) by going via a bus.

As an alternative to sequencing fx events you could run different fx instances with different params in parallel and sequence the routing to different buses.

And you could run source and fx sequencing with differentiated rhythms.

The use of Ndefs could save the bus definitions in some of these cases, but I’m not a JITLib expert.

1 Like

Thanks @dkmayer
For now I’m going for something like the following… in the back of my head I know it will be a disaster if I need more flexibility though (like more fxs, more complex graphs, but for now with only one fx it looks ok).
Any feedback or comment would be very appreciated :slight_smile:

// pdefs and synthdefs at the end

// independent durs:
Pbus(
    Ppar([
        Pdef(\source),
        Pbind(\in,Pkey(\out), \addAction, \addToTail) 
        <> Pdef(\fx)
    ])
).play

// shared durs:

Penvir((),Pbus(
    Ppar([
        Pdef(\source).collect(~src=_),
        Pbind(\dur, Pfunc{~src.dur}) 
        <> Pbind(\in, Pkey(\out), \addAction, \addToTail) 
        <> Pdef(\fx)
    ])
)).play

// pdefs
Pdef(\source, Pmono(\imp,\freq,Pseq([2],inf),\dur,Pxrand(Scale.major.ratios,inf)));

Pdef(\fx,Pbind(
    \instrument,\comb,
    \in, Pkey(\out),
    \del,Pexprand(0.001,0.1),
    \dur,Pseq([1],inf),
))

//synthdefs
SynthDef(\imp){
    Out.ar(\out.kr(0),
        Impulse.ar(\freq.kr(1))
        *Env.asr.kr(2,\gate.kr(1))
    )
}.add;

SynthDef(\comb){|del=0.1,decay=1|
    Out.ar(\out.kr(0),
        CombL.ar(
            In.ar(\in.kr(0),2),
            del,del,decay
        )
        *Env.asr.kr(2,\gate.kr(1))
    )
}.add;