PmonoStreams: Exposing the note-generation mechanism

My Syn/Plug interface provides \syn, \synOn, \synOff, \synSet event types.

I haven’t done Pmono/PmonoArtic yet, because PmonoStreams are tightly coupled with a specific handful of event types.

AFAICS there are two directions I could take this:

  1. Write PmonoSyn, PmonoArticSyn, with new PmonoStream-like classes. Pro: Core class library doesn’t change, so the ddwPlug quark would be generally compatible. Cons: Code duplication; users wonder why they can’t just use Pmono.

  2. Change PmonoStream classes in the core library to allow overriding the event types used. Pro: Fewer classes. Con: ddwPlug would be incompatible with older SC versions wrt Pmono. Considering our typical release schedule, I couldn’t begin to guess when a compatible version would be released.

Any suggestions…?

TIA,
hjh

As often happens: Step 1: Complain. Step 2: Realize there’s another way.

I just tested a wrapper class that translates the events. Seems fine. So I think it’s not an issue now.

E.g., this works now (with latest ddwPlug) – slur-group attacks get a “zap”:

(
SynthDef(\modAtkEnv, { |out, value, ratio = 4, clipLo = 20, clipHi = 20000, decay = 0.08, lag = 0.02|
	Out.kr(out, (
		Lag.kr(value, lag) * EnvGen.kr(Env([1, ratio, 1], [0, decay], \exp))
	).clip(clipLo, clipHi))
}).add;
)

(
p = Pmsyn(
	PmonoArtic(\default,
		\freq, Pexprand(300, 900, inf),
		\freqPlug, { |freq|
			Plug(\modAtkEnv, [value: freq, ratio: 8, decay: 0.03], map: (freq: \value))
		},
		\dur, 0.25,
		\legato, Pwrand([0.4, 1.05], [0.25, 0.75], inf)
	)
).play;
)

p.stop;

hjh