I apologize as always if this question has been asked already. I searched and didn’t find anything.
I’m trying to send MIDI data and audio out from a proxy node. Specifically the Pbind lives on the first slot of the proxy:
(
~lead = { | out = 0, freq = 48, relTime = 2 |
var sig = 0, temp, env, curv;
out.postln;
// curv = [\step, \sin, \wel].scramble;
env = EnvGen.kr(Env.perc(0.5, releaseTime:relTime, curve: \step), doneAction: 2);
8.do{ | i |
temp = LFPulse.ar(freq + Rand(0, i), LFPulse.kr(Rand(0, i).round(rrand(0.125, i))).midicps)!2 / 8;
sig = sig + temp * env * 0.9;
Out.ar(out, sig * 1/16);
};
};
~lead[1] = \xset -> Pbind(
/* \type, \midi,
\midiout, m,
\midicmd, \noteOn,
\chan, 0,*/
\dur, Pseq([0.125, 0.5, 1, 2, 0.25, 0.125, 0.125, 0.5, Rest(4), Rest(2), Rest(1)].scramble, inf),
\degree, Pseq(Scale.hijaz.degrees.mirror.scramble -5, inf),
\octave, Pwhite(2, 4, inf).round(1),
\relTime, Pseq([1, 2, 3, 0.5], inf),
);
)
This provides me with a modifiable live-code proxy. I’d like to record both the audio out from the Synth proxy at slot [0] and the have the midi out to Reaper. I’m working on a custom Class that will set up Reaper by destroying and creating all necessary tracks for proxies that I feed it.
But my main question is having two Pbinds work in tandem - meaning everything from the audio generated event stream gets also sent to MIDI. Maybe Ppar, but that doesn’t seem correct either.
Eventually for my Reaper setup class, I’ll need also to get the \type
of any proxy and if is type \midi
use that to set a MIDI track for recording inside of Reaper. I think I can manage that part but first need to just get audio and MIDI out. The idea is of course to have audio stems using SC for synths, but also having the midi data available for other uses in a DAW.
Oh, and I tried Pchain, but that didn’t seem to work with a proxy slot. Once again needing environment variables - I was trying for less setup and am thinking of going back to Ndefs.
Be Well Everyone!