[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Polling Ugen for MIDI data?




Am 09.03.2019 um 19:23 schrieb benmunozj@xxxxxxxxx:

Is there a way to do this without using Pseg? Basically, I want to be able to control a parameter in my DAW using the output of a Ugen like SinOsc for instance. Is there some way to periodically grab the instantaneous value of a Ugen and pass it to a pattern which could transmit it as a midi control message?


Hi,

the easiest way to do this is using synchronous buses. Using midi is just an additional option, which I omiited here:


c = Bus.control(s, 1);

x = { Out.kr(c, SinOsc.kr(0.3, 0, 20, 70)) }.play;


// play event pattern

(
p = Pbind(
    \dur, 0.15, 
    \midinote, Pfunc { c.getSynchronous }
).play;
)
 
(
p.stop;
x.free;
)


The example is taken from miSCellaneous_lib quark's tutorial "Event patterns and LFOs", where different kinds of such control (envelopes, functions of time, mapping to buses etc.) are compared. Before the invention of shared memory it was more critical to use server values in the language for control purposes. The PHS / HS family was written for that. It still works, but, because of synchronous buses, is a bit outdated now. From my personal experience, I observed a tendency to use Envelopes and Pseg more and more. 

Greetings

Daniel

----------------------------------------------------
http://daniel-mayer.at/software_en.htm
----------------------------------------------------